@zeniai/client-epic-state 5.0.31-betaAR1 → 5.0.31-betaAR11

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.
@@ -1,9 +1,9 @@
1
1
  import { AccountsViewParentID } from '../../commonStateTypes/accountView/nestedAccountID';
2
2
  import { ClassesViewParentID } from '../../commonStateTypes/classesView/nestedClassID';
3
- import { ProjectsViewParentID } from '../../commonStateTypes/projectView/projectViewParentID';
4
3
  import { AdditionalBalancesOptions } from '../../commonStateTypes/coaBalance/additionalBalances/getAdditionalBalances';
5
4
  import { COABalancesFilter } from '../../commonStateTypes/coaBalance/coaBalancesFilter';
6
5
  import { ID } from '../../commonStateTypes/common';
6
+ import { ProjectsViewParentID } from '../../commonStateTypes/projectView/projectViewParentID';
7
7
  import { EntityOrder } from '../../commonStateTypes/selectorTypes/selectorTypes';
8
8
  import { ReportIDPlusForecastID } from '../../commonStateTypes/viewAndReport/viewAndReport';
9
9
  import { Account, AccountBase, AccountState, AccountType } from './accountState';
@@ -132,6 +132,7 @@ export declare const getAllAccounts: (accountState: AccountState) => Account[];
132
132
  export interface AccountFilterOption {
133
133
  accountId: ID;
134
134
  accountName: string;
135
+ accountType: AccountType;
135
136
  }
136
137
  /**
137
138
  * Partitions accounts for transaction filter dropdowns: bank/credit_card → paymentAccountNames,
@@ -208,9 +208,13 @@ const getTransactionFilterAccountOptions = (accountState) => {
208
208
  const paymentAccountNames = [];
209
209
  const categoryOptions = [];
210
210
  for (const account of accounts) {
211
+ if (account.accountType == null) {
212
+ continue;
213
+ }
211
214
  const option = {
212
215
  accountId: account.accountId,
213
216
  accountName: account.accountName,
217
+ accountType: account.accountType,
214
218
  };
215
219
  if ((0, accountState_1.isPaymentAccountType)(account.accountType)) {
216
220
  paymentAccountNames.push(option);
@@ -194,9 +194,13 @@ export const getTransactionFilterAccountOptions = (accountState) => {
194
194
  const paymentAccountNames = [];
195
195
  const categoryOptions = [];
196
196
  for (const account of accounts) {
197
+ if (account.accountType == null) {
198
+ continue;
199
+ }
197
200
  const option = {
198
201
  accountId: account.accountId,
199
202
  accountName: account.accountName,
203
+ accountType: account.accountType,
200
204
  };
201
205
  if (isPaymentAccountType(account.accountType)) {
202
206
  paymentAccountNames.push(option);
@@ -332,33 +332,20 @@ const getCategoryValueForTransaction = (key, transaction) => {
332
332
  return undefined;
333
333
  }
334
334
  case 'payment_account_name': {
335
- // Get from transaction.account or from lines
336
- if (transaction.transaction.account?.accountName) {
337
- return transaction.transaction.account.accountName;
338
- }
339
- // Get from first line's account
340
- const firstLine = transaction.transaction.lines?.[0];
341
- if (firstLine?.type === 'transaction_with_account_and_class_line' ||
342
- firstLine?.type === 'transaction_with_product_or_service_line' ||
343
- firstLine?.type === 'journal_entry_transaction_line') {
344
- const accountLine = firstLine;
345
- return accountLine.account?.accountName;
346
- }
347
- return undefined;
335
+ // Match the value the row renders: TransactionCategorizationListRow reads
336
+ // `currentTransaction?.account?.accountName` for the Payment Account Name
337
+ // column. Returning the same field here keeps filter-match parity with the
338
+ // visible cell, so any row a user can see is also a row the filter can match.
339
+ return transaction.transaction.account?.accountName;
348
340
  }
349
341
  case 'payment_account_type': {
350
- // Similar to payment_account_name but for type
351
- if (transaction.transaction.account?.accountType) {
352
- return transaction.transaction.account.accountType;
353
- }
354
- const firstLineForType = transaction.transaction.lines?.[0];
355
- if (firstLineForType?.type === 'transaction_with_account_and_class_line' ||
356
- firstLineForType?.type === 'transaction_with_product_or_service_line' ||
357
- firstLineForType?.type === 'journal_entry_transaction_line') {
358
- const accountLineForType = firstLineForType;
359
- return accountLineForType.account?.accountType;
360
- }
361
- return undefined;
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;
362
349
  }
363
350
  case 'category': {
364
351
  // Get from transactionLocalData (preferred) or from transaction lines
package/lib/index.d.ts CHANGED
@@ -38,7 +38,7 @@ import { AgingDateSelectionType, AgingDetailReportInvoice, AgingDetailReportUISt
38
38
  import { isAgingReport, isCashFlowOrBalanceSheetReport, isDashboardClassesViewReport, isDashboardReport, isFluxAnalysisOpExReport, isOpExByVendorReport, isPAndLClassesViewReport, isPAndLProjectViewReport, isPAndLReport } from './commonStateTypes/viewAndReport/reportIDHelper';
39
39
  import { PageToken, Report, ReportFormat, ReportID, ReportIDPlusForecastID, SelectorReport, SelectorView, View, toReportFormatStrict, toReportID } from './commonStateTypes/viewAndReport/viewAndReport';
40
40
  import { PAYMENT_BUSINESS_DAYS, filterDays, getNextNthWorkingDay, getPreviousNthWorkingDay, getYearsList, holidaysFormatted, isHoliday, isHolidayToday } from './commonStateTypes/workingDayHelper';
41
- import { AccountReport, AccountWithBalanceReport, getAllAccounts, getTransactionFilterAccountOptions } from './entity/account/accountSelector';
41
+ import { AccountFilterOption, AccountReport, AccountWithBalanceReport, getAllAccounts, getTransactionFilterAccountOptions } from './entity/account/accountSelector';
42
42
  import { ALL_ACCOUNT_TYPES, Account, AccountBase, AccountType, RecommendedAccountBase, ReconciliationAccountSourceType, StatementCloseDay, toAccountType, toReconciliationAccountSource } from './entity/account/accountState';
43
43
  import { NestedAccountReport } from './entity/account/subAccountSelector';
44
44
  import { AccountGroupReport } from './entity/accountGroup/accountGroupSelector';
@@ -647,7 +647,7 @@ export { VendorSpendTrendFilterTabType, toVendorSpendTrendFilterTabsTypeStrict,
647
647
  export { getNumberOfPeriods };
648
648
  export { SCHEDULE_DAYS_OF_MONTH, ScheduleDaysOfMonth, toScheduleDaysOfMonth, Day, Month, toMonth, toMonthStrict, Quarter, toQuarter, toQuarterStrict, AbsoluteDay, TimePeriod, };
649
649
  export { Tenant, TenantView, LoggedInUser, TenantBaseView, CurrentTenant, TenantProductSettings, getTenantBaseById, getCurrentTenant, getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, getTenantsByCheckInDateSelector, getTenantsBaseByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, toTenantCoreDetailsView, getTenantBaseViewForTenantView, getTenantBaseViewForTenantId, isZeniDomainTenant, isTenantUsingZeniCOA, TenantsBaseOrdered, TenantsOrdered, TenantCoreDetailsView, fetchActiveTenant, fetchAllTenants, updateCurrentTenant, clearAll, doMagicLinkSignIn, verifyDeviceWithTwoFA, resendVerifyDeviceOTP, sendEmailMagicLinkToUser, doSignIn, updateSignInState, DoSignInPayload, doSignOut, sendSessionHeartbeat, resetSignInState, RoleResource, Connection, fetchExcludedResourcesForTenant, fetchExternalConnectionsForTenant, saveExternalConnectionForTenant, fetchSubscriptionSummaryForTenant, isTenantBankingOnly, isTenantCardsOnly, isTenantBookkeepingEnabled, isOtherProductsEnabledForTenant, };
650
- export { Account, ALL_ACCOUNT_TYPES, AccountType, AccountBase, StatementCloseDay, toAccountType, AccountReport, getAllAccounts, getTransactionFilterAccountOptions, NestedAccountReport, AccountWithBalanceReport, AccountGroup, AccountGroupReportV2, AccountGroupType, toAccountGroupType, AccountGroupReport, getAccountGroupKey, AccountGroupKey, RecommendedAccountBase, };
650
+ export { Account, ALL_ACCOUNT_TYPES, AccountType, AccountBase, StatementCloseDay, toAccountType, AccountReport, AccountFilterOption, getAllAccounts, getTransactionFilterAccountOptions, NestedAccountReport, AccountWithBalanceReport, AccountGroup, AccountGroupReportV2, AccountGroupType, toAccountGroupType, AccountGroupReport, getAccountGroupKey, AccountGroupKey, RecommendedAccountBase, };
651
651
  export { Class, ClassBase, RecommendedClassBase, } from './entity/class/classState';
652
652
  export { getAllClasses, getClassById } from './entity/class/classSelector';
653
653
  export { ClassReport } from './entity/class/classSelectorTypes';