@zeniai/client-epic-state 4.9.93 → 4.9.95

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.
Files changed (22) hide show
  1. package/lib/entity/account/accountSelector.d.ts +3 -3
  2. package/lib/entity/account/accountState.d.ts +1 -1
  3. package/lib/entity/account/accountState.js +3 -0
  4. package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +1 -1
  5. package/lib/entity/accountGroup/accountGroupSelector.d.ts +22 -22
  6. package/lib/view/accountList/accountListReducer.js +3 -0
  7. package/lib/view/accountMappingView/accountMappingPayload.d.ts +2 -2
  8. package/lib/view/accountMappingView/accountMappingPayload.js +90 -5
  9. package/lib/view/accountMappingView/accountMappingReducer.d.ts +1 -2
  10. package/lib/view/accountMappingView/accountMappingReducer.js +106 -20
  11. package/lib/view/accountMappingView/accountMappingState.d.ts +27 -2
  12. package/lib/view/accountMappingView/accountMappingViewSelector.d.ts +15 -0
  13. package/lib/view/accountMappingView/accountMappingViewSelector.js +56 -2
  14. package/lib/view/accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload.d.ts +32 -1
  15. package/lib/view/accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload.js +42 -2
  16. package/lib/view/accountMappingView/fetchAccountListForAccountTypesEpic.js +4 -11
  17. package/lib/view/accountMappingView/saveAccountMappingViewEpic.js +1 -2
  18. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  19. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  20. package/lib/view/settingsView/settingsViewHelpers.d.ts +1 -1
  21. package/lib/view/settingsView/settingsViewHelpers.js +4 -2
  22. package/package.json +1 -1
@@ -44,7 +44,7 @@ export declare function getAccount(accountState: AccountState, id: {
44
44
  coaId: string | undefined;
45
45
  classesViewParentId: ClassesViewParentID | undefined;
46
46
  accountsViewParentId: AccountsViewParentID | undefined;
47
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
47
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
48
48
  };
49
49
  export declare function getAccountWithBalance(accountState: AccountState, id: {
50
50
  accountId: ID;
@@ -66,7 +66,7 @@ export declare function getAccountWithBalance(accountState: AccountState, id: {
66
66
  coaId: string | undefined;
67
67
  classesViewParentId: ClassesViewParentID | undefined;
68
68
  accountsViewParentId: AccountsViewParentID | undefined;
69
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
69
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
70
70
  };
71
71
  export declare type AccountReport = ReturnType<typeof getAccount>;
72
72
  export declare type AccountWithBalanceReport = ReturnType<typeof getAccountWithBalance>;
@@ -106,7 +106,7 @@ export declare const getAccountsOrdered: (filter: COABalancesFilter, accountStat
106
106
  coaId: string | undefined;
107
107
  classesViewParentId: ClassesViewParentID | undefined;
108
108
  accountsViewParentId: AccountsViewParentID | undefined;
109
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
109
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
110
110
  }[];
111
111
  export declare const getAccountsByType: (accountState: AccountState, accountTypes: AccountType[]) => Partial<Record<AccountType, Account[]>>;
112
112
  export declare const getAccountIdsForTypes: (accountState: AccountState, accountTypes: AccountType[]) => ID[];
@@ -10,7 +10,7 @@ import { AccountsViewParentID } from '../../commonStateTypes/accountView/nestedA
10
10
  export declare const toAccountType: (v: string) => "cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets";
11
11
  export declare type AccountType = ReturnType<typeof toAccountType>;
12
12
  export declare const toAccountTypeStrict: (v: string | null | undefined) => AccountType | undefined;
13
- export declare const toAccountLabel: (v: string) => "prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense";
13
+ export declare const toAccountLabel: (v: string) => "prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses";
14
14
  export declare type AccountLabel = ReturnType<typeof toAccountLabel>;
15
15
  export declare const toAccountLabelStrict: (v: string | null | undefined) => AccountLabel | undefined;
16
16
  export declare function getAccountKey(reportIdUniqueKey: ReportIDPlusForecastID, accountId: ID, classesViewParentId?: ClassesViewParentID, accountsViewParentId?: AccountsViewParentID): `${string}-cash_balance` | `${string}-card_balance` | `${string}-operating_expenses` | `${string}-operating_expenses_by_classes` | `${string}-revenue` | `${string}-revenue_by_classes` | `${string}-net_burn_or_income` | `${string}-net_burn_or_income_story_card` | `${string}-net_burn_or_income_by_classes` | `${string}-cash_position` | `${string}-top_expenses` | `${string}-profit_and_loss` | `${string}-profit_and_loss_by_classes` | `${string}-balance_sheet` | `${string}-cash_flow` | `${string}-dashboard` | `${string}-finance_statement` | `${string}-transaction_list_of_account` | `${string}-transaction_list_missing_receipt` | `${string}-transaction_list_of_account_by_class` | `${string}-transaction_detail` | `${string}-cash_in_cash_out` | `${string}-insights_dashboard` | `${string}-company_details` | `${string}-class_list` | `${string}-account_list` | `${string}-account_list_by_type` | `${string}-vendor` | `${string}-task_card` | `${string}-bill_pay` | `${string}-reimbursement` | `${string}-bill_pay_card` | `${string}-reimbursement_card` | `${string}-bill_pay_promo_card` | `${string}-zeni_accounts` | `${string}-zeni_accounts_promo_card` | `${string}-charge_cards` | `${string}-reimbursement_promo_card` | `${string}-onboarding` | `${string}-operating_expenses_by_vendor` | `${string}-operating_expenses_by_vendor_summary` | `${string}-vendors_tab` | `${string}-accounts_payable_aging` | `${string}-accounts_receivable_aging` | `${string}-vendor_global_review` | `${string}-prepaid_expenses` | `${string}-fixed_assets` | `${string}-cash_balance+${string}` | `${string}-card_balance+${string}` | `${string}-operating_expenses+${string}` | `${string}-operating_expenses_by_classes+${string}` | `${string}-revenue+${string}` | `${string}-revenue_by_classes+${string}` | `${string}-net_burn_or_income+${string}` | `${string}-net_burn_or_income_story_card+${string}` | `${string}-net_burn_or_income_by_classes+${string}` | `${string}-cash_position+${string}` | `${string}-top_expenses+${string}` | `${string}-profit_and_loss+${string}` | `${string}-profit_and_loss_by_classes+${string}` | `${string}-balance_sheet+${string}` | `${string}-cash_flow+${string}` | `${string}-dashboard+${string}` | `${string}-finance_statement+${string}` | `${string}-transaction_list_of_account+${string}` | `${string}-transaction_list_missing_receipt+${string}` | `${string}-transaction_list_of_account_by_class+${string}` | `${string}-transaction_detail+${string}` | `${string}-cash_in_cash_out+${string}` | `${string}-insights_dashboard+${string}` | `${string}-company_details+${string}` | `${string}-class_list+${string}` | `${string}-account_list+${string}` | `${string}-account_list_by_type+${string}` | `${string}-vendor+${string}` | `${string}-task_card+${string}` | `${string}-bill_pay+${string}` | `${string}-reimbursement+${string}` | `${string}-bill_pay_card+${string}` | `${string}-reimbursement_card+${string}` | `${string}-bill_pay_promo_card+${string}` | `${string}-zeni_accounts+${string}` | `${string}-zeni_accounts_promo_card+${string}` | `${string}-charge_cards+${string}` | `${string}-reimbursement_promo_card+${string}` | `${string}-onboarding+${string}` | `${string}-operating_expenses_by_vendor+${string}` | `${string}-operating_expenses_by_vendor_summary+${string}` | `${string}-vendors_tab+${string}` | `${string}-accounts_payable_aging+${string}` | `${string}-accounts_receivable_aging+${string}` | `${string}-vendor_global_review+${string}` | `${string}-prepaid_expenses+${string}` | `${string}-fixed_assets+${string}`;
@@ -35,6 +35,9 @@ const ALL_ACCOUNT_LABELS = [
35
35
  'uncategorized_expense',
36
36
  'prepaid_expenses',
37
37
  'fixed_assets',
38
+ 'bank_charges_and_fees',
39
+ 'mileage',
40
+ 'accrued_expenses',
38
41
  ];
39
42
  const toAccountLabel = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_ACCOUNT_LABELS);
40
43
  exports.toAccountLabel = toAccountLabel;
@@ -42,5 +42,5 @@ export declare const cloneAccountsWithZeroBalance: (accounts: AccountReport[]) =
42
42
  coaId: string | undefined;
43
43
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
44
44
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
45
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
45
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
46
46
  }[];
@@ -42,7 +42,7 @@ export declare const getAccountGroup: (accountGroupState: AccountGroupState, acc
42
42
  coaId: string | undefined;
43
43
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
44
44
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
45
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
45
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
46
46
  }[];
47
47
  expensesInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
48
48
  accountsWithIncomeOrdered: {
@@ -76,7 +76,7 @@ export declare const getAccountGroup: (accountGroupState: AccountGroupState, acc
76
76
  coaId: string | undefined;
77
77
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
78
78
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
79
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
79
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
80
80
  }[];
81
81
  incomeInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
82
82
  accountsWithCogsOrdered: {
@@ -110,7 +110,7 @@ export declare const getAccountGroup: (accountGroupState: AccountGroupState, acc
110
110
  coaId: string | undefined;
111
111
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
112
112
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
113
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
113
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
114
114
  }[];
115
115
  cogsInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
116
116
  accountsWithCashInOrdered: {
@@ -144,7 +144,7 @@ export declare const getAccountGroup: (accountGroupState: AccountGroupState, acc
144
144
  coaId: string | undefined;
145
145
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
146
146
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
147
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
147
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
148
148
  }[];
149
149
  cashInInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
150
150
  accountsWithCashOutOrdered: {
@@ -178,7 +178,7 @@ export declare const getAccountGroup: (accountGroupState: AccountGroupState, acc
178
178
  coaId: string | undefined;
179
179
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
180
180
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
181
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
181
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
182
182
  }[];
183
183
  cashOutInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
184
184
  equityInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
@@ -213,7 +213,7 @@ export declare const getAccountGroup: (accountGroupState: AccountGroupState, acc
213
213
  coaId: string | undefined;
214
214
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
215
215
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
216
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
216
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
217
217
  }[];
218
218
  assetsInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
219
219
  accountsWithAssetsOrdered: {
@@ -247,7 +247,7 @@ export declare const getAccountGroup: (accountGroupState: AccountGroupState, acc
247
247
  coaId: string | undefined;
248
248
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
249
249
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
250
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
250
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
251
251
  }[];
252
252
  liabilitiesInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
253
253
  accountsWithLiabilitiesOrdered: {
@@ -281,7 +281,7 @@ export declare const getAccountGroup: (accountGroupState: AccountGroupState, acc
281
281
  coaId: string | undefined;
282
282
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
283
283
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
284
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
284
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
285
285
  }[];
286
286
  operatingActivitiesInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
287
287
  accountsWithOperatingActivitiesOrdered: {
@@ -315,7 +315,7 @@ export declare const getAccountGroup: (accountGroupState: AccountGroupState, acc
315
315
  coaId: string | undefined;
316
316
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
317
317
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
318
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
318
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
319
319
  }[];
320
320
  investingActivitiesInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
321
321
  accountsWithInvestingActivitiesOrdered: {
@@ -349,7 +349,7 @@ export declare const getAccountGroup: (accountGroupState: AccountGroupState, acc
349
349
  coaId: string | undefined;
350
350
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
351
351
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
352
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
352
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
353
353
  }[];
354
354
  financingActivitiesInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
355
355
  accountsWithFinancingActivitiesOrdered: {
@@ -383,7 +383,7 @@ export declare const getAccountGroup: (accountGroupState: AccountGroupState, acc
383
383
  coaId: string | undefined;
384
384
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
385
385
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
386
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
386
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
387
387
  }[];
388
388
  };
389
389
  export declare type AccountGroupReport = ReturnType<typeof getAccountGroup>;
@@ -424,7 +424,7 @@ export declare const getAccountGroupsOrdered: (filter: COABalancesFilter, accoun
424
424
  coaId: string | undefined;
425
425
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
426
426
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
427
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
427
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
428
428
  }[];
429
429
  expensesInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
430
430
  accountsWithIncomeOrdered: {
@@ -458,7 +458,7 @@ export declare const getAccountGroupsOrdered: (filter: COABalancesFilter, accoun
458
458
  coaId: string | undefined;
459
459
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
460
460
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
461
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
461
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
462
462
  }[];
463
463
  incomeInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
464
464
  accountsWithCogsOrdered: {
@@ -492,7 +492,7 @@ export declare const getAccountGroupsOrdered: (filter: COABalancesFilter, accoun
492
492
  coaId: string | undefined;
493
493
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
494
494
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
495
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
495
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
496
496
  }[];
497
497
  cogsInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
498
498
  accountsWithCashInOrdered: {
@@ -526,7 +526,7 @@ export declare const getAccountGroupsOrdered: (filter: COABalancesFilter, accoun
526
526
  coaId: string | undefined;
527
527
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
528
528
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
529
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
529
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
530
530
  }[];
531
531
  cashInInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
532
532
  accountsWithCashOutOrdered: {
@@ -560,7 +560,7 @@ export declare const getAccountGroupsOrdered: (filter: COABalancesFilter, accoun
560
560
  coaId: string | undefined;
561
561
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
562
562
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
563
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
563
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
564
564
  }[];
565
565
  cashOutInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
566
566
  equityInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
@@ -595,7 +595,7 @@ export declare const getAccountGroupsOrdered: (filter: COABalancesFilter, accoun
595
595
  coaId: string | undefined;
596
596
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
597
597
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
598
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
598
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
599
599
  }[];
600
600
  assetsInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
601
601
  accountsWithAssetsOrdered: {
@@ -629,7 +629,7 @@ export declare const getAccountGroupsOrdered: (filter: COABalancesFilter, accoun
629
629
  coaId: string | undefined;
630
630
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
631
631
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
632
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
632
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
633
633
  }[];
634
634
  liabilitiesInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
635
635
  accountsWithLiabilitiesOrdered: {
@@ -663,7 +663,7 @@ export declare const getAccountGroupsOrdered: (filter: COABalancesFilter, accoun
663
663
  coaId: string | undefined;
664
664
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
665
665
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
666
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
666
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
667
667
  }[];
668
668
  operatingActivitiesInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
669
669
  accountsWithOperatingActivitiesOrdered: {
@@ -697,7 +697,7 @@ export declare const getAccountGroupsOrdered: (filter: COABalancesFilter, accoun
697
697
  coaId: string | undefined;
698
698
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
699
699
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
700
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
700
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
701
701
  }[];
702
702
  investingActivitiesInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
703
703
  accountsWithInvestingActivitiesOrdered: {
@@ -731,7 +731,7 @@ export declare const getAccountGroupsOrdered: (filter: COABalancesFilter, accoun
731
731
  coaId: string | undefined;
732
732
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
733
733
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
734
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
734
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
735
735
  }[];
736
736
  financingActivitiesInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
737
737
  accountsWithFinancingActivitiesOrdered: {
@@ -765,6 +765,6 @@ export declare const getAccountGroupsOrdered: (filter: COABalancesFilter, accoun
765
765
  coaId: string | undefined;
766
766
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
767
767
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
768
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
768
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
769
769
  }[];
770
770
  }[];
@@ -18,8 +18,11 @@ exports.initialAccountList = {
18
18
  accountIdsByLabel: {
19
19
  uncategorized_expense: [],
20
20
  uncategorized_income: [],
21
+ bank_charges_and_fees: [],
22
+ mileage: [],
21
23
  prepaid_expenses: [],
22
24
  fixed_assets: [],
25
+ accrued_expenses: [],
23
26
  },
24
27
  hasValidState() {
25
28
  return this.fetchState == 'Completed';
@@ -1,8 +1,8 @@
1
- import { ID } from '../../commonStateTypes/common';
2
1
  import { AccountBasePayload } from '../../entity/account/accountPayload';
3
2
  import { ZeniAPIResponse } from '../../responsePayload';
3
+ import { AccountMappingLocalData } from './accountMappingState';
4
4
  export interface SaveAccountMappingPayload {
5
5
  accounts: Partial<AccountBasePayload>[];
6
6
  }
7
7
  export declare type SaveAccountMappingResponse = ZeniAPIResponse;
8
- export declare const toSaveAccountMappingPayload: (incomeAccount: ID | undefined, expenseAccount: ID | undefined) => Partial<AccountBasePayload>[];
8
+ export declare const toSaveAccountMappingPayload: (accountingLocalData: AccountMappingLocalData) => Partial<AccountBasePayload>[];
@@ -1,20 +1,105 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toSaveAccountMappingPayload = void 0;
4
- const toSaveAccountMappingPayload = (incomeAccount, expenseAccount) => {
4
+ const toSaveAccountMappingPayload = (accountingLocalData) => {
5
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
5
6
  const accounts = [];
6
- if (Boolean(incomeAccount) === true) {
7
+ if (Boolean(accountingLocalData.selectedIncomeAccountId) === true) {
7
8
  accounts.push({
8
- account_id: incomeAccount,
9
+ account_id: accountingLocalData.selectedIncomeAccountId,
9
10
  labels: ['uncategorized_income'],
10
11
  });
11
12
  }
12
- if (Boolean(expenseAccount) === true) {
13
+ else {
13
14
  accounts.push({
14
- account_id: expenseAccount,
15
+ account_id: (_a = accountingLocalData.previousIncomeAccount) === null || _a === void 0 ? void 0 : _a.accountId,
16
+ labels: [],
17
+ });
18
+ }
19
+ if (Boolean(accountingLocalData.selectedExpenseAccountId) === true) {
20
+ accounts.push({
21
+ account_id: accountingLocalData.selectedExpenseAccountId,
15
22
  labels: ['uncategorized_expense'],
16
23
  });
17
24
  }
25
+ else {
26
+ accounts.push({
27
+ account_id: (_b = accountingLocalData.previousExpenseAccount) === null || _b === void 0 ? void 0 : _b.accountId,
28
+ labels: [],
29
+ });
30
+ }
31
+ if (Boolean(accountingLocalData.selectedBillPayAccountId) === true) {
32
+ accounts.push({
33
+ account_id: accountingLocalData.selectedBillPayAccountId,
34
+ labels: ['bank_charges_and_fees'],
35
+ });
36
+ }
37
+ else {
38
+ accounts.push({
39
+ account_id: (_c = accountingLocalData.previousBillPayAccount) === null || _c === void 0 ? void 0 : _c.accountId,
40
+ labels: [],
41
+ });
42
+ }
43
+ if (Boolean(accountingLocalData.selectedReimbursementsAccountId) === true) {
44
+ accounts.push({
45
+ account_id: accountingLocalData.selectedReimbursementsAccountId,
46
+ labels: ['mileage'],
47
+ });
48
+ }
49
+ else {
50
+ accounts.push({
51
+ account_id: (_d = accountingLocalData.previousReimbursementsAccount) === null || _d === void 0 ? void 0 : _d.accountId,
52
+ labels: [],
53
+ });
54
+ }
55
+ if (accountingLocalData.selectedPrepaidExpensesAccountIds.length > 0) {
56
+ (_e = accountingLocalData.selectedPrepaidExpensesAccountIds) === null || _e === void 0 ? void 0 : _e.forEach((accountId) => {
57
+ accounts.push({
58
+ account_id: accountId,
59
+ labels: ['prepaid_expenses'],
60
+ });
61
+ });
62
+ }
63
+ else {
64
+ (_f = accountingLocalData.previousPrepaidExpensesAccount) === null || _f === void 0 ? void 0 : _f.forEach((account) => {
65
+ accounts.push({
66
+ account_id: account.accountId,
67
+ labels: [],
68
+ });
69
+ });
70
+ }
71
+ if (accountingLocalData.selectedFixedAssetsAccountIds.length > 0) {
72
+ (_g = accountingLocalData.selectedFixedAssetsAccountIds) === null || _g === void 0 ? void 0 : _g.forEach((accountId) => {
73
+ accounts.push({
74
+ account_id: accountId,
75
+ labels: ['fixed_assets'],
76
+ });
77
+ });
78
+ }
79
+ else {
80
+ (_h = accountingLocalData.previousFixedAssetsAccount) === null || _h === void 0 ? void 0 : _h.forEach((account) => {
81
+ accounts.push({
82
+ account_id: account.accountId,
83
+ labels: [],
84
+ });
85
+ });
86
+ }
87
+ if (accountingLocalData.selectedAccruedExpensesAccountIds.length > 0) {
88
+ (_j = accountingLocalData.selectedAccruedExpensesAccountIds) === null || _j === void 0 ? void 0 : _j.forEach((accountId) => {
89
+ accounts.push({
90
+ account_id: accountId,
91
+ labels: ['accrued_expenses'],
92
+ });
93
+ });
94
+ }
95
+ else {
96
+ (_k = accountingLocalData.previousAccruedExpensesAccount) === null || _k === void 0 ? void 0 : _k.forEach((account) => {
97
+ accounts.push({
98
+ account_id: account.accountId,
99
+ labels: [],
100
+ });
101
+ });
102
+ }
18
103
  return accounts;
19
104
  };
20
105
  exports.toSaveAccountMappingPayload = toSaveAccountMappingPayload;
@@ -6,8 +6,7 @@ export declare const initialState: AccountMappingState;
6
6
  export declare const initializeAccountMappingView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, fetchRecommendationForAccountMapping: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateRecommendationForAccountMapping: import("@reduxjs/toolkit").ActionCreatorWithPayload<AccountTypeRecommendationPayload, string>, updateRecommendationForAccountMappingFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
7
7
  status: ZeniAPIStatus;
8
8
  }, string>, fetchAccountListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateAccountListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
9
- incomeAccountPayload: AccountMetadataPayload[];
10
- expenseAccountPayload: AccountMetadataPayload[];
9
+ accountPayload: AccountMetadataPayload[];
11
10
  }, string>, updateAccountListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
12
11
  status: ZeniAPIStatus;
13
12
  }, string>, saveAccountMappingLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
@@ -10,10 +10,22 @@ exports.initialState = {
10
10
  data: {
11
11
  isExpenseRecommendationChecked: false,
12
12
  isIncomeRecommendationChecked: false,
13
+ isBillPayRecommendationChecked: false,
14
+ isReimbursementsRecommendationChecked: false,
13
15
  selectedExpenseAccountId: undefined,
14
16
  selectedIncomeAccountId: undefined,
17
+ selectedBillPayAccountId: undefined,
18
+ selectedReimbursementsAccountId: undefined,
19
+ selectedPrepaidExpensesAccountIds: [],
20
+ selectedFixedAssetsAccountIds: [],
21
+ selectedAccruedExpensesAccountIds: [],
15
22
  previousExpenseAccount: undefined,
16
23
  previousIncomeAccount: undefined,
24
+ previousBillPayAccount: undefined,
25
+ previousReimbursementsAccount: undefined,
26
+ previousPrepaidExpensesAccount: [],
27
+ previousFixedAssetsAccount: [],
28
+ previousAccruedExpensesAccount: [],
17
29
  },
18
30
  accountListFetchState: {
19
31
  error: undefined,
@@ -27,12 +39,25 @@ exports.initialState = {
27
39
  error: undefined,
28
40
  fetchState: 'Not-Started',
29
41
  },
30
- incomeAccountIDList: [],
42
+ incomeAccountIdList: [],
31
43
  incomeNestedAccountListHeirarchy: [],
32
44
  incomeRecommendations: [],
33
- expenseAccountIDList: [],
45
+ expenseAccountIdList: [],
34
46
  expenseNestedAccountListHeirarchy: [],
35
47
  expenseRecommendations: [],
48
+ billPayNestedAccountListHeirarchy: [],
49
+ billPayRecommendations: [],
50
+ reimbursementsNestedAccountListHeirarchy: [],
51
+ reimbursementsRecommendations: [],
52
+ prepaidExpensesAccountIdList: [],
53
+ prepaidExpensesNestedAccountListHeirarchy: [],
54
+ prepaidExpensesRecommendations: [],
55
+ fixedAssetsAccountIdList: [],
56
+ fixedAssetsNestedAccountListHeirarchy: [],
57
+ fixedAssetsRecommendations: [],
58
+ accruedExpensesAccountIdList: [],
59
+ accruedExpensesNestedAccountListHeirarchy: [],
60
+ accruedExpensesRecommendations: [],
36
61
  };
37
62
  const accountMapping = (0, toolkit_1.createSlice)({
38
63
  name: 'accountMapping',
@@ -65,7 +90,7 @@ const accountMapping = (0, toolkit_1.createSlice)({
65
90
  };
66
91
  },
67
92
  updateAccountListForAccountTypes(draft, action) {
68
- doUpdateAccountListForAccountTypes(draft, action.payload.incomeAccountPayload, action.payload.expenseAccountPayload);
93
+ doUpdateAccountListForAccountTypes(draft, action.payload.accountPayload);
69
94
  },
70
95
  updateAccountListForAccountTypesFailure(draft, action) {
71
96
  const { status } = action.payload;
@@ -107,36 +132,97 @@ const accountMapping = (0, toolkit_1.createSlice)({
107
132
  _a = accountMapping.actions, exports.initializeAccountMappingView = _a.initializeAccountMappingView, exports.fetchRecommendationForAccountMapping = _a.fetchRecommendationForAccountMapping, exports.updateRecommendationForAccountMapping = _a.updateRecommendationForAccountMapping, exports.updateRecommendationForAccountMappingFailure = _a.updateRecommendationForAccountMappingFailure, exports.fetchAccountListForAccountTypes = _a.fetchAccountListForAccountTypes, exports.updateAccountListForAccountTypes = _a.updateAccountListForAccountTypes, exports.updateAccountListForAccountTypesFailure = _a.updateAccountListForAccountTypesFailure, exports.saveAccountMappingLocalData = _a.saveAccountMappingLocalData, exports.clearAccountMappingLocalData = _a.clearAccountMappingLocalData, exports.saveAccountMapping = _a.saveAccountMapping, exports.saveAccountMappingFailure = _a.saveAccountMappingFailure, exports.saveAccountMappingSuccess = _a.saveAccountMappingSuccess, exports.clearAccountMappingView = _a.clearAccountMappingView;
108
133
  exports.default = accountMapping.reducer;
109
134
  const doUpdateRecommendationForAccountMapping = (draft, payload) => {
110
- const { incomeRecommendations, expenseRecommendations } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
135
+ const { incomeRecommendations, expenseRecommendations, billPayRecommendations, reimbursementsRecommendations, prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
111
136
  draft.incomeRecommendations = incomeRecommendations;
112
137
  draft.expenseRecommendations = expenseRecommendations;
138
+ draft.billPayRecommendations = billPayRecommendations;
139
+ draft.reimbursementsRecommendations = reimbursementsRecommendations;
140
+ draft.prepaidExpensesRecommendations = prepaidExpensesRecommendations;
141
+ draft.fixedAssetsRecommendations = fixedAssetsRecommendations;
142
+ draft.accruedExpensesRecommendations = accruedExpensesRecommendations;
113
143
  draft.recommendationFetchState = {
114
144
  error: undefined,
115
145
  fetchState: 'Completed',
116
146
  };
117
147
  };
118
- const doUpdateAccountListForAccountTypes = (draft, incomeAccountList, expenseAccountList) => {
119
- var _a, _b;
120
- draft.expenseAccountIDList = expenseAccountList.map((account) => account.account_id);
121
- draft.incomeAccountIDList = incomeAccountList.map((account) => account.account_id);
122
- const incomeAccountMetadata = (_a = incomeAccountList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc))) !== null && _a !== void 0 ? _a : [];
123
- const incomeAccountIdentified = incomeAccountMetadata.find((account) => account.labels.includes('uncategorized_income'));
148
+ const doUpdateAccountListForAccountTypes = (draft, accountPayloadList) => {
149
+ const incomeList = [];
150
+ const expenseList = [];
151
+ const prepaidExpensesList = [];
152
+ const fixedAssetsList = [];
153
+ const accruedExpensesList = [];
154
+ accountPayloadList.forEach((account) => {
155
+ if (account.account_type === 'income') {
156
+ incomeList.push(account); // list for uncategorized income
157
+ }
158
+ else if (account.account_type === 'expenses') {
159
+ expenseList.push(account); // list for uncategorized expense, bill pay expense, reimbursements expense(mileage)
160
+ }
161
+ else if (account.account_type === 'other_current_assets') {
162
+ prepaidExpensesList.push(account); // list of prepaid expenses
163
+ }
164
+ else if (account.account_type === 'fixed_assets' ||
165
+ account.account_type === 'other_assets') {
166
+ fixedAssetsList.push(account); // list for fixed assets
167
+ }
168
+ else if (account.account_type === 'other_current_liabilities') {
169
+ accruedExpensesList.push(account); // list for accrued expenses
170
+ }
171
+ });
172
+ draft.incomeAccountIdList = incomeList.map((account) => account.account_id);
173
+ draft.expenseAccountIdList = expenseList.map((account) => account.account_id);
174
+ draft.prepaidExpensesAccountIdList = prepaidExpensesList.map((account) => account.account_id);
175
+ draft.fixedAssetsAccountIdList = fixedAssetsList.map((account) => account.account_id);
176
+ draft.accruedExpensesAccountIdList = accruedExpensesList.map((account) => account.account_id);
177
+ const incomeAccountMetadata = incomeList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
178
+ const incomeAccountBase = incomeList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
179
+ const incomeAccountIdentified = incomeAccountBase.find((account) => account.labels.includes('uncategorized_income'));
124
180
  if (incomeAccountIdentified != null) {
125
- draft.data = Object.assign({}, draft.data, {
126
- selectedIncomeAccountId: incomeAccountIdentified.accountId,
127
- previousIncomeAccount: incomeAccountIdentified,
128
- });
181
+ draft.data = Object.assign(Object.assign({}, draft.data), { selectedIncomeAccountId: incomeAccountIdentified.accountId, previousIncomeAccount: incomeAccountIdentified });
129
182
  }
130
183
  draft.incomeNestedAccountListHeirarchy = (0, getNestedAccountIDHeirarchyForReport_1.geNestedAccountIDHierarchyForReport)(incomeAccountMetadata);
131
- const expenseAccountMetadata = (_b = expenseAccountList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc))) !== null && _b !== void 0 ? _b : [];
132
- const expenseAccountIdentified = expenseAccountMetadata.find((account) => account.labels.includes('uncategorized_expense'));
184
+ const expenseAccountMetadata = expenseList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
185
+ const expenseAccountBase = expenseList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
186
+ const expenseAccountIdentified = expenseAccountBase.find((account) => account.labels.includes('uncategorized_expense'));
133
187
  if (expenseAccountIdentified != null) {
134
- draft.data = Object.assign({}, draft.data, {
135
- selectedExpenseAccountId: expenseAccountIdentified.accountId,
136
- previousExpenseAccount: expenseAccountIdentified,
137
- });
188
+ draft.data = Object.assign(Object.assign({}, draft.data), { selectedExpenseAccountId: expenseAccountIdentified.accountId, previousExpenseAccount: expenseAccountIdentified });
138
189
  }
139
190
  draft.expenseNestedAccountListHeirarchy = (0, getNestedAccountIDHeirarchyForReport_1.geNestedAccountIDHierarchyForReport)(expenseAccountMetadata);
191
+ const billPayAccountIdentified = expenseAccountBase.find((account) => account.labels.includes('bank_charges_and_fees'));
192
+ if (billPayAccountIdentified != null) {
193
+ draft.data = Object.assign(Object.assign({}, draft.data), { selectedBillPayAccountId: billPayAccountIdentified.accountId, previousBillPayAccount: billPayAccountIdentified });
194
+ }
195
+ draft.billPayNestedAccountListHeirarchy = (0, getNestedAccountIDHeirarchyForReport_1.geNestedAccountIDHierarchyForReport)(expenseAccountMetadata);
196
+ const reimbursementsAccountIdentified = expenseAccountBase.find((account) => account.labels.includes('mileage'));
197
+ if (reimbursementsAccountIdentified != null) {
198
+ draft.data = Object.assign(Object.assign({}, draft.data), { selectedReimbursementsAccountId: reimbursementsAccountIdentified.accountId, previousReimbursementsAccount: reimbursementsAccountIdentified });
199
+ }
200
+ draft.reimbursementsNestedAccountListHeirarchy =
201
+ (0, getNestedAccountIDHeirarchyForReport_1.geNestedAccountIDHierarchyForReport)(expenseAccountMetadata);
202
+ const prepaidExpensesAccountMetadata = prepaidExpensesList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
203
+ const prepaidExpensesAccountBase = prepaidExpensesList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
204
+ const prepaidExpensesAccountsIdentified = prepaidExpensesAccountBase.filter((account) => account.labels.includes('prepaid_expenses'));
205
+ if (prepaidExpensesAccountsIdentified != null) {
206
+ draft.data = Object.assign(Object.assign({}, draft.data), { selectedPrepaidExpensesAccountIds: prepaidExpensesAccountsIdentified.map((account) => account.accountId), previousPrepaidExpensesAccount: prepaidExpensesAccountsIdentified });
207
+ }
208
+ draft.prepaidExpensesNestedAccountListHeirarchy =
209
+ (0, getNestedAccountIDHeirarchyForReport_1.geNestedAccountIDHierarchyForReport)(prepaidExpensesAccountMetadata);
210
+ const fixedAssetsAccountMetadata = fixedAssetsList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
211
+ const fixedAssetsAccountBase = fixedAssetsList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
212
+ const fixedAssetsAccountsIdentified = fixedAssetsAccountBase.filter((account) => account.labels.includes('fixed_assets'));
213
+ if (fixedAssetsAccountsIdentified != null) {
214
+ draft.data = Object.assign(Object.assign({}, draft.data), { selectedFixedAssetsAccountIds: fixedAssetsAccountsIdentified.map((account) => account.accountId), previousFixedAssetsAccount: fixedAssetsAccountsIdentified });
215
+ }
216
+ draft.fixedAssetsNestedAccountListHeirarchy =
217
+ (0, getNestedAccountIDHeirarchyForReport_1.geNestedAccountIDHierarchyForReport)(fixedAssetsAccountMetadata);
218
+ const accruedExpensesAccountMetadata = accruedExpensesList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
219
+ const accruedExpensesAccountBase = accruedExpensesList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
220
+ const accruedExpensesAccountsIdentified = accruedExpensesAccountBase.filter((account) => account.labels.includes('accrued_expenses'));
221
+ if (accruedExpensesAccountsIdentified != null) {
222
+ draft.data = Object.assign(Object.assign({}, draft.data), { selectedAccruedExpensesAccountIds: accruedExpensesAccountsIdentified.map((account) => account.accountId), previousAccruedExpensesAccount: accruedExpensesAccountsIdentified });
223
+ }
224
+ draft.accruedExpensesNestedAccountListHeirarchy =
225
+ (0, getNestedAccountIDHeirarchyForReport_1.geNestedAccountIDHierarchyForReport)(accruedExpensesAccountMetadata);
140
226
  draft.accountListFetchState = {
141
227
  error: undefined,
142
228
  fetchState: 'Completed',
@@ -5,20 +5,45 @@ import { AccountBase } from '../../entity/account/accountState';
5
5
  export interface AccountMappingLocalData {
6
6
  selectedIncomeAccountId: ID | undefined;
7
7
  selectedExpenseAccountId: ID | undefined;
8
+ selectedBillPayAccountId: ID | undefined;
9
+ selectedReimbursementsAccountId: ID | undefined;
10
+ selectedFixedAssetsAccountIds: ID[];
11
+ selectedPrepaidExpensesAccountIds: ID[];
12
+ selectedAccruedExpensesAccountIds: ID[];
8
13
  isIncomeRecommendationChecked: boolean;
9
14
  isExpenseRecommendationChecked: boolean;
15
+ isBillPayRecommendationChecked: boolean;
16
+ isReimbursementsRecommendationChecked: boolean;
10
17
  previousIncomeAccount: AccountBase | undefined;
11
18
  previousExpenseAccount: AccountBase | undefined;
19
+ previousBillPayAccount: AccountBase | undefined;
20
+ previousReimbursementsAccount: AccountBase | undefined;
21
+ previousPrepaidExpensesAccount: AccountBase[] | undefined;
22
+ previousFixedAssetsAccount: AccountBase[] | undefined;
23
+ previousAccruedExpensesAccount: AccountBase[] | undefined;
12
24
  }
13
25
  export interface AccountMappingState {
14
26
  data: AccountMappingLocalData;
15
27
  accountListFetchState: FetchStateAndError;
16
28
  recommendationFetchState: FetchStateAndError;
17
29
  updateFetchState: FetchStateAndError;
18
- incomeAccountIDList: ID[];
30
+ incomeAccountIdList: ID[];
19
31
  incomeNestedAccountListHeirarchy: NestedAccountHeirarchyForReport[];
20
32
  incomeRecommendations: Recommendation[];
21
- expenseAccountIDList: ID[];
33
+ expenseAccountIdList: ID[];
22
34
  expenseNestedAccountListHeirarchy: NestedAccountHeirarchyForReport[];
23
35
  expenseRecommendations: Recommendation[];
36
+ billPayNestedAccountListHeirarchy: NestedAccountHeirarchyForReport[];
37
+ billPayRecommendations: Recommendation[];
38
+ reimbursementsNestedAccountListHeirarchy: NestedAccountHeirarchyForReport[];
39
+ reimbursementsRecommendations: Recommendation[];
40
+ prepaidExpensesAccountIdList: ID[];
41
+ prepaidExpensesNestedAccountListHeirarchy: NestedAccountHeirarchyForReport[];
42
+ prepaidExpensesRecommendations: Recommendation[];
43
+ fixedAssetsAccountIdList: ID[];
44
+ fixedAssetsNestedAccountListHeirarchy: NestedAccountHeirarchyForReport[];
45
+ fixedAssetsRecommendations: Recommendation[];
46
+ accruedExpensesAccountIdList: ID[];
47
+ accruedExpensesNestedAccountListHeirarchy: NestedAccountHeirarchyForReport[];
48
+ accruedExpensesRecommendations: Recommendation[];
24
49
  }
@@ -8,10 +8,25 @@ import { FetchStateAndError } from '../../commonStateTypes/common';
8
8
  export interface AccountMappingView extends SelectorView {
9
9
  incomeAccountList: AccountBase[];
10
10
  expenseAccountList: AccountBase[];
11
+ billPayAccountList: AccountBase[];
12
+ reimbursementsAccountList: AccountBase[];
13
+ prepaidExpensesAccountList: AccountBase[];
14
+ fixedAssetsAccountList: AccountBase[];
15
+ accruedExpensesAccountList: AccountBase[];
11
16
  incomeRecommendation?: Recommendation;
12
17
  expenseRecommendation?: Recommendation;
18
+ billPayRecommendation?: Recommendation;
19
+ reimbursementsRecommendation?: Recommendation;
20
+ prepaidExpensesRecommendation: Recommendation[];
21
+ fixedAssetsRecommendation: Recommendation[];
22
+ accruedExpensesRecommendation: Recommendation[];
13
23
  incomeAccountHierachy: NestedAccountHeirarchyForReport[];
14
24
  expenseAccountHierarchy: NestedAccountHeirarchyForReport[];
25
+ billPayAccountHierarchy: NestedAccountHeirarchyForReport[];
26
+ reimbursementsAccountHierarchy: NestedAccountHeirarchyForReport[];
27
+ prepaidExpensesAccountHierarchy: NestedAccountHeirarchyForReport[];
28
+ fixedAssetsAccountHierarchy: NestedAccountHeirarchyForReport[];
29
+ accruedExpensesAccountHierarchy: NestedAccountHeirarchyForReport[];
15
30
  accountMappingLocalData?: AccountMappingLocalData;
16
31
  saveState: FetchStateAndError;
17
32
  }
@@ -6,19 +6,54 @@ const accountSelector_1 = require("../../entity/account/accountSelector");
6
6
  const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
7
7
  exports.getAccountMappingView = (0, toolkit_1.createSelector)((state) => state.accountMappingState, (state) => state.accountState, (state) => state.tasksCardState, (accountMappingState, accountState, tasksCardState) => {
8
8
  const incomeAccountList = [];
9
- accountMappingState.incomeAccountIDList.forEach((accountId) => {
9
+ accountMappingState.incomeAccountIdList.forEach((accountId) => {
10
10
  const account = (0, accountSelector_1.getAccountBase)(accountState, accountId, 'account_list_by_type');
11
11
  if (account != null) {
12
12
  incomeAccountList.push(account);
13
13
  }
14
14
  });
15
15
  const expenseAccountList = [];
16
- accountMappingState.expenseAccountIDList.forEach((accountId) => {
16
+ accountMappingState.expenseAccountIdList.forEach((accountId) => {
17
17
  const account = (0, accountSelector_1.getAccountBase)(accountState, accountId, 'account_list_by_type');
18
18
  if (account != null) {
19
19
  expenseAccountList.push(account);
20
20
  }
21
21
  });
22
+ const billPayAccountList = [];
23
+ accountMappingState.expenseAccountIdList.forEach((accountId) => {
24
+ const account = (0, accountSelector_1.getAccountBase)(accountState, accountId, 'account_list_by_type');
25
+ if (account != null) {
26
+ billPayAccountList.push(account);
27
+ }
28
+ });
29
+ const reimbursementsAccountList = [];
30
+ accountMappingState.expenseAccountIdList.forEach((accountId) => {
31
+ const account = (0, accountSelector_1.getAccountBase)(accountState, accountId, 'account_list_by_type');
32
+ if (account != null) {
33
+ reimbursementsAccountList.push(account);
34
+ }
35
+ });
36
+ const prepaidExpensesAccountList = [];
37
+ accountMappingState.prepaidExpensesAccountIdList.forEach((accountId) => {
38
+ const account = (0, accountSelector_1.getAccountBase)(accountState, accountId, 'account_list_by_type');
39
+ if (account != null) {
40
+ prepaidExpensesAccountList.push(account);
41
+ }
42
+ });
43
+ const fixedAssetsAccountList = [];
44
+ accountMappingState.fixedAssetsAccountIdList.forEach((accountId) => {
45
+ const account = (0, accountSelector_1.getAccountBase)(accountState, accountId, 'account_list_by_type');
46
+ if (account != null) {
47
+ fixedAssetsAccountList.push(account);
48
+ }
49
+ });
50
+ const accruedExpensesAccountList = [];
51
+ accountMappingState.accruedExpensesAccountIdList.forEach((accountId) => {
52
+ const account = (0, accountSelector_1.getAccountBase)(accountState, accountId, 'account_list_by_type');
53
+ if (account != null) {
54
+ accruedExpensesAccountList.push(account);
55
+ }
56
+ });
22
57
  const fetchState = (0, reduceFetchState_1.reduceAllFetchState)([
23
58
  accountMappingState.accountListFetchState,
24
59
  accountMappingState.recommendationFetchState,
@@ -27,15 +62,34 @@ exports.getAccountMappingView = (0, toolkit_1.createSelector)((state) => state.a
27
62
  return {
28
63
  incomeAccountList,
29
64
  expenseAccountList,
65
+ billPayAccountList,
66
+ reimbursementsAccountList,
67
+ prepaidExpensesAccountList,
68
+ fixedAssetsAccountList,
69
+ accruedExpensesAccountList,
30
70
  incomeRecommendation: accountMappingState.incomeRecommendations.length > 0
31
71
  ? accountMappingState.incomeRecommendations[0]
32
72
  : undefined,
33
73
  expenseRecommendation: accountMappingState.expenseRecommendations.length > 0
34
74
  ? accountMappingState.expenseRecommendations[0]
35
75
  : undefined,
76
+ billPayRecommendation: accountMappingState.billPayRecommendations.length > 0
77
+ ? accountMappingState.billPayRecommendations[0]
78
+ : undefined,
79
+ reimbursementsRecommendation: accountMappingState.reimbursementsRecommendations.length > 0
80
+ ? accountMappingState.reimbursementsRecommendations[0]
81
+ : undefined,
82
+ prepaidExpensesRecommendation: accountMappingState.prepaidExpensesRecommendations,
83
+ fixedAssetsRecommendation: accountMappingState.fixedAssetsRecommendations,
84
+ accruedExpensesRecommendation: accountMappingState.accruedExpensesRecommendations,
36
85
  accountMappingLocalData: accountMappingState.data,
37
86
  incomeAccountHierachy: accountMappingState.incomeNestedAccountListHeirarchy,
38
87
  expenseAccountHierarchy: accountMappingState.expenseNestedAccountListHeirarchy,
88
+ billPayAccountHierarchy: accountMappingState.billPayNestedAccountListHeirarchy,
89
+ reimbursementsAccountHierarchy: accountMappingState.reimbursementsNestedAccountListHeirarchy,
90
+ prepaidExpensesAccountHierarchy: accountMappingState.prepaidExpensesNestedAccountListHeirarchy,
91
+ fixedAssetsAccountHierarchy: accountMappingState.fixedAssetsNestedAccountListHeirarchy,
92
+ accruedExpensesAccountHierarchy: accountMappingState.accruedExpensesNestedAccountListHeirarchy,
39
93
  fetchState: fetchState.fetchState,
40
94
  saveState,
41
95
  };
@@ -3,10 +3,41 @@ import { RecommendedAccountBasePayload } from '../../../entity/account/accountPa
3
3
  import { AccountLabel } from '../../../entity/account/accountState';
4
4
  import { ZeniAPIResponse } from '../../../responsePayload';
5
5
  export interface AccountTypeRecommendationPayload {
6
- recommendations_by_type: Record<Extract<AccountLabel, 'uncategorized_income' | 'uncategorized_expense'>, RecommendedAccountBasePayload[]>;
6
+ recommendations_by_type: AccountTypeRecommendationOption;
7
+ }
8
+ export interface AccountTypeRecommendationOption {
9
+ transaction_categorization: AccountRecommendationUncategorised;
10
+ bill_pay: AccountRecommendationBillPay;
11
+ reimbursement: AccountRecommendationReimbursements;
12
+ fixed_assets: AccountRecommendationFixedAssets;
13
+ prepaid_expenses: AccountRecommendationPrepaidExpenses;
14
+ accrued_expenses: AccountRecommendationAccruedExpenses;
15
+ }
16
+ export interface AccountRecommendationUncategorised {
17
+ accounts: Record<Extract<AccountLabel, 'uncategorized_income' | 'uncategorized_expense'>, RecommendedAccountBasePayload[]>;
18
+ }
19
+ export interface AccountRecommendationBillPay {
20
+ accounts: Record<Extract<AccountLabel, 'bank_charges_and_fees'>, RecommendedAccountBasePayload[]>;
21
+ }
22
+ export interface AccountRecommendationReimbursements {
23
+ accounts: Record<Extract<AccountLabel, 'mileage'>, RecommendedAccountBasePayload[]>;
24
+ }
25
+ export interface AccountRecommendationPrepaidExpenses {
26
+ accounts: Record<Extract<AccountLabel, 'prepaid_expenses'>, RecommendedAccountBasePayload[]>;
27
+ }
28
+ export interface AccountRecommendationFixedAssets {
29
+ accounts: Record<Extract<AccountLabel, 'fixed_assets'>, RecommendedAccountBasePayload[]>;
30
+ }
31
+ export interface AccountRecommendationAccruedExpenses {
32
+ accounts: Record<Extract<AccountLabel, 'accrued_expenses'>, RecommendedAccountBasePayload[]>;
7
33
  }
8
34
  export declare type AccountTypeRecommendationResponse = ZeniAPIResponse<AccountTypeRecommendationPayload>;
9
35
  export declare const mapAccountTypeRecommendationPayloadToAccountRecommendationByType: (payload: AccountTypeRecommendationPayload) => {
10
36
  incomeRecommendations: Recommendation[];
11
37
  expenseRecommendations: Recommendation[];
38
+ billPayRecommendations: Recommendation[];
39
+ reimbursementsRecommendations: Recommendation[];
40
+ fixedAssetsRecommendations: Recommendation[];
41
+ prepaidExpensesRecommendations: Recommendation[];
42
+ accruedExpensesRecommendations: Recommendation[];
12
43
  };
@@ -4,7 +4,7 @@ exports.mapAccountTypeRecommendationPayloadToAccountRecommendationByType = void
4
4
  const accountPayload_1 = require("../../../entity/account/accountPayload");
5
5
  const mapAccountTypeRecommendationPayloadToAccountRecommendationByType = (payload) => {
6
6
  const incomeRecommendations = [];
7
- payload.recommendations_by_type.uncategorized_income.forEach((recommendedAccount) => {
7
+ payload.recommendations_by_type.transaction_categorization.accounts.uncategorized_income.forEach((recommendedAccount) => {
8
8
  const account = (0, accountPayload_1.mapRecommendedAccountBasePayloadToRecommendedAccountBase)(recommendedAccount);
9
9
  if (account != null) {
10
10
  incomeRecommendations.push({
@@ -13,15 +13,55 @@ const mapAccountTypeRecommendationPayloadToAccountRecommendationByType = (payloa
13
13
  }
14
14
  });
15
15
  const expenseRecommendations = [];
16
- payload.recommendations_by_type.uncategorized_expense.forEach((recommendedAccount) => {
16
+ payload.recommendations_by_type.transaction_categorization.accounts.uncategorized_expense.forEach((recommendedAccount) => {
17
17
  const account = (0, accountPayload_1.mapRecommendedAccountBasePayloadToRecommendedAccountBase)(recommendedAccount);
18
18
  if (account != null) {
19
19
  expenseRecommendations.push({ account });
20
20
  }
21
21
  });
22
+ const billPayRecommendations = [];
23
+ payload.recommendations_by_type.bill_pay.accounts.bank_charges_and_fees.forEach((recommendedAccount) => {
24
+ const account = (0, accountPayload_1.mapRecommendedAccountBasePayloadToRecommendedAccountBase)(recommendedAccount);
25
+ if (account != null) {
26
+ billPayRecommendations.push({ account });
27
+ }
28
+ });
29
+ const reimbursementsRecommendations = [];
30
+ payload.recommendations_by_type.reimbursement.accounts.mileage.forEach((recommendedAccount) => {
31
+ const account = (0, accountPayload_1.mapRecommendedAccountBasePayloadToRecommendedAccountBase)(recommendedAccount);
32
+ if (account != null) {
33
+ reimbursementsRecommendations.push({ account });
34
+ }
35
+ });
36
+ const fixedAssetsRecommendations = [];
37
+ payload.recommendations_by_type.fixed_assets.accounts.fixed_assets.forEach((recommendedAccount) => {
38
+ const account = (0, accountPayload_1.mapRecommendedAccountBasePayloadToRecommendedAccountBase)(recommendedAccount);
39
+ if (account != null) {
40
+ fixedAssetsRecommendations.push({ account });
41
+ }
42
+ });
43
+ const prepaidExpensesRecommendations = [];
44
+ payload.recommendations_by_type.prepaid_expenses.accounts.prepaid_expenses.forEach((recommendedAccount) => {
45
+ const account = (0, accountPayload_1.mapRecommendedAccountBasePayloadToRecommendedAccountBase)(recommendedAccount);
46
+ if (account != null) {
47
+ prepaidExpensesRecommendations.push({ account });
48
+ }
49
+ });
50
+ const accruedExpensesRecommendations = [];
51
+ payload.recommendations_by_type.accrued_expenses.accounts.accrued_expenses.forEach((recommendedAccount) => {
52
+ const account = (0, accountPayload_1.mapRecommendedAccountBasePayloadToRecommendedAccountBase)(recommendedAccount);
53
+ if (account != null) {
54
+ accruedExpensesRecommendations.push({ account });
55
+ }
56
+ });
22
57
  return {
23
58
  incomeRecommendations,
24
59
  expenseRecommendations,
60
+ billPayRecommendations,
61
+ reimbursementsRecommendations,
62
+ fixedAssetsRecommendations,
63
+ prepaidExpensesRecommendations,
64
+ accruedExpensesRecommendations,
25
65
  };
26
66
  };
27
67
  exports.mapAccountTypeRecommendationPayloadToAccountRecommendationByType = mapAccountTypeRecommendationPayloadToAccountRecommendationByType;
@@ -13,20 +13,13 @@ const fetchAccountListForAccountTypesEpic = (actions$, _state$, zeniAPI) => acti
13
13
  var _a;
14
14
  if ((0, responsePayload_1.isSuccessResponse)(response)) {
15
15
  const actions = [];
16
- const incomeList = [];
17
- const expenseList = [];
16
+ const accountListPayload = [];
18
17
  (_a = response.data) === null || _a === void 0 ? void 0 : _a.accounts.forEach((account) => {
19
- if (account.account_type === 'income') {
20
- incomeList.push(account);
21
- }
22
- else if (account.account_type === 'expenses') {
23
- expenseList.push(account);
24
- }
18
+ accountListPayload.push(account);
25
19
  });
26
- actions.push((0, accountReducer_1.updateAccounts)([...incomeList, ...expenseList], 'account_list_by_type'));
20
+ actions.push((0, accountReducer_1.updateAccounts)([...accountListPayload], 'account_list_by_type'));
27
21
  actions.push((0, accountMappingReducer_1.updateAccountListForAccountTypes)({
28
- incomeAccountPayload: incomeList,
29
- expenseAccountPayload: expenseList,
22
+ accountPayload: accountListPayload,
30
23
  }));
31
24
  return (0, rxjs_1.from)(actions);
32
25
  }
@@ -8,9 +8,8 @@ const accountMappingPayload_1 = require("./accountMappingPayload");
8
8
  const responsePayload_1 = require("../../responsePayload");
9
9
  const tasksCardReducer_1 = require("../tasksCard/tasksCardReducer");
10
10
  const saveAccountMappingViewEpic = (actions$, state, zeniAPI) => actions$.pipe((0, operators_1.filter)(accountMappingReducer_1.saveAccountMapping.match), (0, operators_1.mergeMap)(() => {
11
- var _a, _b;
12
11
  const accountMappingState = state.value.accountMappingState;
13
- const payload = (0, accountMappingPayload_1.toSaveAccountMappingPayload)((_a = accountMappingState.data) === null || _a === void 0 ? void 0 : _a.selectedIncomeAccountId, (_b = accountMappingState.data) === null || _b === void 0 ? void 0 : _b.selectedExpenseAccountId);
12
+ const payload = (0, accountMappingPayload_1.toSaveAccountMappingPayload)(accountMappingState.data);
14
13
  if (payload.length === 0) {
15
14
  return (0, rxjs_1.from)([]);
16
15
  }
@@ -21,7 +21,7 @@ export declare const getCardBalance: (state: RootState) => {
21
21
  coaId: string | undefined;
22
22
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
23
23
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
24
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
24
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
25
25
  }[];
26
26
  balance: import("../..").Balance | undefined;
27
27
  firstMonthOfFY: 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
@@ -21,7 +21,7 @@ export declare const getCashBalance: (state: RootState) => {
21
21
  coaId: string | undefined;
22
22
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
23
23
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
24
- labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense")[];
24
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "mileage" | "accrued_expenses")[];
25
25
  }[];
26
26
  balance: import("../..").Balance | undefined;
27
27
  firstMonthOfFY: 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
@@ -1,7 +1,7 @@
1
1
  import { CurrentTenant } from '../../entity/tenant/tenantSelector';
2
2
  import { RoleMap, UserRoleType } from '../../entity/userRole/userRoleType';
3
3
  import { NotificationSettingsData, ReminderNotificationSettingsData, MonthEndInsightsNotificationSettingsData } from './settingsViewState';
4
- export declare const isAccountingTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined) => boolean;
4
+ export declare const isAccountingTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap | undefined) => boolean;
5
5
  export declare const isApprovalRulesTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap | undefined) => boolean;
6
6
  export declare const isBankConnectionsTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap | undefined) => boolean;
7
7
  export declare const isBusinessVerificationTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap | undefined) => boolean;
@@ -2,9 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isNotificationsTabVisible = exports.isMonthEndNotificationsSectionVisibleOnSettingsPage = exports.isRemindersSectionVisibleOnSettingsPage = exports.isMyBankConnectionsTabVisible = exports.isSettingsVisible = exports.isIntegrationsTabVisible = exports.isCompanyDetailsTabVisible = exports.isBusinessVerificationTabVisible = exports.isBankConnectionsTabVisible = exports.isApprovalRulesTabVisible = exports.isAccountingTabVisible = void 0;
4
4
  const userRoleType_1 = require("../../entity/userRole/userRoleType");
5
- const isAccountingTabVisible = (userRole, currentTenant) => {
5
+ const isAccountingTabVisible = (userRole, currentTenant, userRoleMap) => {
6
6
  if ((0, exports.isSettingsVisible)(currentTenant)) {
7
- return (0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole);
7
+ return ((0, userRoleType_1.hasBillPayAccessible)(currentTenant, userRoleMap) ||
8
+ (0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
9
+ (0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole));
8
10
  }
9
11
  else {
10
12
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.9.93",
3
+ "version": "4.9.95",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",