
export const RULE_TYPES = [
  { value: 'journal_entry', label: 'Journal Entry' },
  { value: 'transaction', label: 'Bank Transaction' },
  { value: 'charge', label: 'Charge/Assessment' },
  { value: 'payment', label: 'Payment' }
];

export const OPERATORS = [
  { value: 'equals', label: 'Equals' },
  { value: 'not_equals', label: 'Does Not Equal' },
  { value: 'contains', label: 'Contains' },
  { value: 'not_contains', label: 'Does Not Contain' },
  { value: 'starts_with', label: 'Starts With' },
  { value: 'ends_with', label: 'Ends With' },
  { value: 'greater_than', label: 'Greater Than (Number)' },
  { value: 'less_than', label: 'Less Than (Number)' },
  { value: 'is_empty', label: 'Is Empty' },
  { value: 'is_not_empty', label: 'Is Not Empty' },
];

export const ACTION_TYPES = [
  { value: 'set_field', label: 'Set Field Value' },
  { value: 'append_description', label: 'Append to Description' },
  { value: 'flag_review', label: 'Flag for Review' },
  { value: 'prevent_save', label: 'Prevent Saving (Block)' }
];

const COMMON_FIELDS = [
  { value: 'amount', label: 'Amount', type: 'number' },
  { value: 'description', label: 'Description', type: 'string' },
  { value: 'date', label: 'Date', type: 'date' },
];

export const getAvailableFields = (ruleType) => {
  switch (ruleType) {
    case 'journal_entry':
      return [
        ...COMMON_FIELDS,
        { value: 'type', label: 'Entry Type (Debit/Credit)', type: 'string' },
        { value: 'chart_of_account_id', label: 'Account ID', type: 'string' },
      ];
    case 'transaction':
      return [
        ...COMMON_FIELDS,
        { value: 'type', label: 'Type (Debit/Credit)', type: 'string' },
        { value: 'category', label: 'Category', type: 'string' },
        { value: 'reference_id', label: 'Reference ID', type: 'string' },
      ];
    case 'charge':
      return [
        ...COMMON_FIELDS,
        { value: 'account_id', label: 'Account ID', type: 'string' },
        { value: 'type', label: 'Type (Charge/Payment)', type: 'string' },
      ];
    case 'payment':
      return [
        ...COMMON_FIELDS,
        { value: 'payment_method', label: 'Payment Method', type: 'string' },
        { value: 'reference', label: 'Reference/Check #', type: 'string' },
      ];
    default:
      return COMMON_FIELDS;
  }
};
