@zeniai/client-epic-state 5.0.31-betaAR7 → 5.0.31-betaAR9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -133,6 +133,19 @@ export interface AccountFilterOption {
133
133
  accountId: ID;
134
134
  accountName: string;
135
135
  accountType: AccountType;
136
+ /**
137
+ * Raw payment-type enum (e.g. 'credit_card', 'check', 'cash') sourced from
138
+ * the backend payload via mapAccountBasePayloadToAccountBase. Used as the
139
+ * `value` for the Payment Account Type filter dropdown so it can be compared
140
+ * directly against `transaction.paymentType` by the matcher.
141
+ */
142
+ paymentType: string | undefined;
143
+ /**
144
+ * Human-readable label (e.g. 'Credit card', 'Check') for the same payment
145
+ * type. Sourced from the backend payload (mirrors ZENI_PAYMENT_TYPE_TO_NAME_MAP)
146
+ * so no client-side label map is required.
147
+ */
148
+ paymentTypeName: string | undefined;
136
149
  }
137
150
  /**
138
151
  * Partitions accounts for transaction filter dropdowns: bank/credit_card → paymentAccountNames,
@@ -215,6 +215,8 @@ const getTransactionFilterAccountOptions = (accountState) => {
215
215
  accountId: account.accountId,
216
216
  accountName: account.accountName,
217
217
  accountType: account.accountType,
218
+ paymentType: account.paymentType,
219
+ paymentTypeName: account.paymentTypeName,
218
220
  };
219
221
  if ((0, accountState_1.isPaymentAccountType)(account.accountType)) {
220
222
  paymentAccountNames.push(option);
@@ -201,6 +201,8 @@ export const getTransactionFilterAccountOptions = (accountState) => {
201
201
  accountId: account.accountId,
202
202
  accountName: account.accountName,
203
203
  accountType: account.accountType,
204
+ paymentType: account.paymentType,
205
+ paymentTypeName: account.paymentTypeName,
204
206
  };
205
207
  if (isPaymentAccountType(account.accountType)) {
206
208
  paymentAccountNames.push(option);
@@ -339,15 +339,13 @@ const getCategoryValueForTransaction = (key, transaction) => {
339
339
  return transaction.transaction.account?.accountName;
340
340
  }
341
341
  case 'payment_account_type': {
342
- // Match the value the row renders: TransactionCategorizationListRow reads
343
- // `currentTransaction?.paymentTypeName` for the Payment Type column
344
- // (e.g. "Credit Card", "Check"). NOTE: the Payment Account Type filter
345
- // dropdown options are currently derived from raw `account.accountType`
346
- // values (e.g. "credit_card", "bank") in
347
- // `ExpenseAutomationPage.filterOptions`. With this matcher change, the
348
- // dropdown options must be aligned to also emit `paymentTypeName` values,
349
- // otherwise the filter will silently match nothing.
350
- return transaction.transaction.paymentTypeName;
342
+ // Compare against the raw `paymentType` enum (e.g. "credit_card", "check",
343
+ // "cash"). The same enum is what TransactionCategorizationListRow uses for
344
+ // its icon switch on line ~1675, and it's what the dropdown options emit
345
+ // as `value`. Display labels come from each account's `paymentTypeName`
346
+ // field (populated by mapAccountBasePayloadToAccountBase from the backend
347
+ // payload) no client-side label map required.
348
+ return transaction.transaction.paymentType;
351
349
  }
352
350
  case 'category': {
353
351
  // Get from transactionLocalData (preferred) or from transaction lines