@zeniai/client-epic-state 5.0.81 → 5.0.82-betaAK1

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 (118) hide show
  1. package/lib/commonStateTypes/amount.d.ts +2 -1
  2. package/lib/commonStateTypes/amount.js +5 -2
  3. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  4. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  5. package/lib/commonStateTypes/workingDayHelper.d.ts +11 -0
  6. package/lib/commonStateTypes/workingDayHelper.js +31 -1
  7. package/lib/entity/account/accountSelector.d.ts +9 -0
  8. package/lib/entity/account/accountSelector.js +14 -1
  9. package/lib/entity/account/accountState.d.ts +1 -1
  10. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  11. package/lib/entity/class/classReducer.d.ts +4 -4
  12. package/lib/entity/class/classState.d.ts +1 -1
  13. package/lib/entity/forecast/forecastState.d.ts +1 -1
  14. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  15. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  16. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  17. package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
  18. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
  19. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  20. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  21. package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
  22. package/lib/entity/tenant/clearAllEpic.js +2 -0
  23. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +4 -0
  24. package/lib/entity/transaction/payloadTypes/transactionPayload.js +18 -10
  25. package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
  26. package/lib/epic.d.ts +7 -1
  27. package/lib/epic.js +7 -1
  28. package/lib/esm/commonStateTypes/amount.js +3 -1
  29. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  30. package/lib/esm/commonStateTypes/workingDayHelper.js +29 -0
  31. package/lib/esm/entity/account/accountSelector.js +11 -0
  32. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  33. package/lib/esm/entity/tenant/clearAllEpic.js +2 -0
  34. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +18 -10
  35. package/lib/esm/epic.js +7 -1
  36. package/lib/esm/index.js +12 -6
  37. package/lib/esm/reducer.js +9 -0
  38. package/lib/esm/view/createTransferEntry/createTransferEntryReducer.js +82 -0
  39. package/lib/esm/view/createTransferEntry/createTransferEntrySelector.js +64 -0
  40. package/lib/esm/view/createTransferEntry/createTransferEntryState.js +17 -0
  41. package/lib/esm/view/createTransferEntry/epics/createTransferEntryEpic.js +130 -0
  42. package/lib/esm/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +36 -0
  43. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +13 -1
  44. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +9 -1
  45. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +24 -0
  46. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +55 -0
  47. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +15 -0
  48. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +45 -0
  49. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +28 -0
  50. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +27 -0
  51. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +37 -0
  52. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +49 -0
  53. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +179 -0
  54. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +5 -0
  55. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +28 -0
  56. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +39 -0
  57. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +6 -1
  58. package/lib/index.d.ts +15 -6
  59. package/lib/index.js +62 -33
  60. package/lib/reducer.d.ts +9 -0
  61. package/lib/reducer.js +9 -0
  62. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  63. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  64. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  65. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  66. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  67. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  68. package/lib/view/createTransferEntry/createTransferEntryReducer.d.ts +32 -0
  69. package/lib/view/createTransferEntry/createTransferEntryReducer.js +86 -0
  70. package/lib/view/createTransferEntry/createTransferEntrySelector.d.ts +39 -0
  71. package/lib/view/createTransferEntry/createTransferEntrySelector.js +69 -0
  72. package/lib/view/createTransferEntry/createTransferEntryState.d.ts +30 -0
  73. package/lib/view/createTransferEntry/createTransferEntryState.js +20 -0
  74. package/lib/view/createTransferEntry/epics/createTransferEntryEpic.d.ts +11 -0
  75. package/lib/view/createTransferEntry/epics/createTransferEntryEpic.js +134 -0
  76. package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.d.ts +14 -0
  77. package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +40 -0
  78. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  79. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  80. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -1
  81. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -2
  82. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +4 -1
  83. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -0
  84. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -2
  85. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  86. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  87. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  88. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  89. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.d.ts +52 -0
  90. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +29 -0
  91. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.d.ts +21 -0
  92. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +59 -0
  93. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.d.ts +16 -0
  94. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +19 -0
  95. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.d.ts +44 -0
  96. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +51 -0
  97. package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.d.ts +16 -0
  98. package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +32 -0
  99. package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.d.ts +14 -0
  100. package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +31 -0
  101. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +32 -0
  102. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +42 -0
  103. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.d.ts +15 -0
  104. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +53 -0
  105. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.d.ts +41 -0
  106. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +184 -0
  107. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.d.ts +71 -0
  108. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +8 -0
  109. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.d.ts +16 -0
  110. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +32 -0
  111. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.d.ts +10 -0
  112. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +43 -0
  113. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  114. package/lib/view/topEx/topExSelector.d.ts +1 -1
  115. package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
  116. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +6 -1
  117. package/lib/view/transactionDetail/transactionDetailSelector.js +6 -1
  118. package/package.json +34 -62
@@ -5,5 +5,6 @@ export interface Currency {
5
5
  export interface Amount extends Currency {
6
6
  amount: number;
7
7
  }
8
- export declare const toAmount: (amount: number, currency_code: string, currency_symbol: string) => Amount;
8
+ export declare const toAmount: (amount: number, currency_code: string, currency_symbol?: string) => Amount;
9
9
  export declare const toAmountWC: (amount: number, currency: Currency) => Amount;
10
+ export declare const zeroAmount: (currencyCode?: string, currencySymbol?: string) => Amount;
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toAmountWC = exports.toAmount = void 0;
3
+ exports.zeroAmount = exports.toAmountWC = exports.toAmount = void 0;
4
+ const CURRENCY_SYMBOL_USD = '$';
4
5
  const toAmount = (amount, currency_code, currency_symbol) => ({
5
6
  amount: amount,
6
7
  currencyCode: currency_code,
7
- currencySymbol: currency_symbol,
8
+ currencySymbol: currency_symbol ?? CURRENCY_SYMBOL_USD,
8
9
  });
9
10
  exports.toAmount = toAmount;
10
11
  /* to amount with currency */
11
12
  const toAmountWC = (amount, currency) => (0, exports.toAmount)(amount, currency.currencyCode, currency.currencySymbol);
12
13
  exports.toAmountWC = toAmountWC;
14
+ const zeroAmount = (currencyCode = 'USD', currencySymbol = '$') => (0, exports.toAmount)(0, currencyCode, currencySymbol);
15
+ exports.zeroAmount = zeroAmount;
@@ -3,8 +3,8 @@ import { FetchStateAndError, ID } from '../common';
3
3
  import { DataAvailable } from '../dataAvailable';
4
4
  import { Status } from '../status';
5
5
  import { Month } from '../timePeriod';
6
- export declare const ALL_REPORT_IDS: readonly ["cash_balance", "card_balance", "expense_automation_card", "operating_expenses", "operating_expenses_by_classes", "revenue", "revenue_by_classes", "net_burn_or_income", "net_burn_or_income_story_card", "net_burn_or_income_by_classes", "cash_position", "top_expenses", "profit_and_loss", "profit_and_loss_by_classes", "profit_and_loss_by_projects", "balance_sheet", "cash_flow", "dashboard", "finance_statement", "transaction_list_of_account", "transaction_list_missing_receipt", "transaction_list_of_account_by_class", "transaction_list_of_account_by_project", "transaction_detail", "cash_in_cash_out", "insights_dashboard", "company_details", "class_list", "account_list", "account_list_by_type", "vendor", "task_card", "bill_pay", "reimbursement", "bill_pay_card", "reimbursement_card", "bill_pay_promo_card", "zeni_accounts", "zeni_accounts_promo_card", "zeni_treasury", "charge_cards", "other_connection", "reimbursement_promo_card", "onboarding", "operating_expenses_by_vendor", "operating_expenses_by_vendor_summary", "vendors_tab", "accounts_payable_aging", "accounts_receivable_aging", "vendor_global_review", "prepaid_expenses", "fixed_assets", "notification", "rewards_card", "billing", "flux_analysis_operating_expense", "account_reconciliation", "zeni_credit_promo_card", "treasury_promo_card", "excluded_account_reconciliation"];
7
- export declare const toReportID: (v: string) => "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
6
+ export declare const ALL_REPORT_IDS: readonly ["cash_balance", "card_balance", "expense_automation_card", "operating_expenses", "operating_expenses_by_classes", "revenue", "revenue_by_classes", "net_burn_or_income", "net_burn_or_income_story_card", "net_burn_or_income_by_classes", "cash_position", "top_expenses", "profit_and_loss", "profit_and_loss_by_classes", "profit_and_loss_by_projects", "balance_sheet", "cash_flow", "dashboard", "finance_statement", "transaction_list_of_account", "transaction_list_missing_receipt", "transaction_list_of_account_by_class", "transaction_list_of_account_by_project", "transaction_detail", "cash_in_cash_out", "insights_dashboard", "company_details", "class_list", "account_list", "account_list_by_type", "vendor", "task_card", "bill_pay", "reimbursement", "bill_pay_card", "reimbursement_card", "bill_pay_promo_card", "zeni_accounts", "zeni_accounts_promo_card", "zeni_treasury", "charge_cards", "other_connection", "reimbursement_promo_card", "onboarding", "operating_expenses_by_vendor", "operating_expenses_by_vendor_summary", "vendors_tab", "accounts_payable_aging", "accounts_receivable_aging", "vendor_global_review", "prepaid_expenses", "fixed_assets", "notification", "rewards_card", "billing", "flux_analysis_operating_expense", "account_reconciliation", "zeni_credit_promo_card", "treasury_promo_card", "excluded_account_reconciliation", "transfer_accounts", "credit_card_transfer_accounts"];
7
+ export declare const toReportID: (v: string) => "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
8
8
  export type ReportID = ReturnType<typeof toReportID>;
9
9
  export type ReportIDPlusForecastID = ReportID | `${ReportID}+${ID}`;
10
10
  /** Any view state should extend this interface */
@@ -63,6 +63,8 @@ exports.ALL_REPORT_IDS = [
63
63
  'zeni_credit_promo_card',
64
64
  'treasury_promo_card',
65
65
  'excluded_account_reconciliation',
66
+ 'transfer_accounts',
67
+ 'credit_card_transfer_accounts',
66
68
  ];
67
69
  const toReportID = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_REPORT_IDS);
68
70
  exports.toReportID = toReportID;
@@ -4,6 +4,17 @@ export declare const startDate = "2000-01-01";
4
4
  export declare const endDate = "2070-12-31";
5
5
  export declare const PAYMENT_BUSINESS_DAYS = 4;
6
6
  export declare const holidaysFormatted: string[];
7
+ /**
8
+ * Returns the next scheduled transfer date for a recurring transfer/sweep,
9
+ * given a frequency cadence. Advances by the cadence and then skips past
10
+ * weekends and US holidays. Used by both:
11
+ * - `<ReviewAutoTransferRuleDrawer>` (web-c) for the display "next transfer"
12
+ * - `saveAutoSweepSettingsEpic` for the `first_transfer_date` PUT payload
13
+ *
14
+ * Unknown frequencies fall through to "today" (subject to the weekend/holiday
15
+ * shift), matching the prior behavior of the web-c helper.
16
+ */
17
+ export declare const getNextTransferDate: (frequency: string | undefined) => ZeniDate;
7
18
  export declare const getNextNthWorkingDay: (date: Date, filterDaysIndex: number[], numberOfWorkingDays: number) => Date;
8
19
  export declare const getPreviousNthWorkingDay: (date: Date, filterDaysIndex: number[], numberOfWorkingDays: number) => Date;
9
20
  export declare const isHolidayToday: (filterDaysIndex: number[]) => boolean;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.isHoliday = exports.getYearsList = exports.filterDays = exports.isHolidayToday = exports.getPreviousNthWorkingDay = exports.getNextNthWorkingDay = exports.holidaysFormatted = exports.PAYMENT_BUSINESS_DAYS = exports.endDate = exports.startDate = exports.standardFormat = void 0;
6
+ exports.isHoliday = exports.getYearsList = exports.filterDays = exports.isHolidayToday = exports.getPreviousNthWorkingDay = exports.getNextNthWorkingDay = exports.getNextTransferDate = exports.holidaysFormatted = exports.PAYMENT_BUSINESS_DAYS = exports.endDate = exports.startDate = exports.standardFormat = void 0;
7
7
  const date_holidays_1 = __importDefault(require("date-holidays"));
8
8
  const zeniDayJS_1 = require("../zeniDayJS");
9
9
  exports.standardFormat = 'MM/DD/YYYY';
@@ -16,6 +16,36 @@ const holidays = dateHolidays
16
16
  .filter((holiday) => holiday.type === 'public' || holiday.type === 'bank')
17
17
  .map((holiday) => (0, zeniDayJS_1.date)(holiday.date).toDate()); // https://www.linkedin.com/pulse/fix-invalid-date-safari-ie-hatem-ahmad/
18
18
  exports.holidaysFormatted = holidays.map((holiday) => (0, zeniDayJS_1.date)(holiday.toDateString()).format(exports.standardFormat));
19
+ /**
20
+ * Returns the next scheduled transfer date for a recurring transfer/sweep,
21
+ * given a frequency cadence. Advances by the cadence and then skips past
22
+ * weekends and US holidays. Used by both:
23
+ * - `<ReviewAutoTransferRuleDrawer>` (web-c) for the display "next transfer"
24
+ * - `saveAutoSweepSettingsEpic` for the `first_transfer_date` PUT payload
25
+ *
26
+ * Unknown frequencies fall through to "today" (subject to the weekend/holiday
27
+ * shift), matching the prior behavior of the web-c helper.
28
+ */
29
+ const getNextTransferDate = (frequency) => {
30
+ const date = new Date();
31
+ if (frequency === 'daily') {
32
+ date.setDate(date.getDate() + 1);
33
+ }
34
+ else if (frequency === 'weekly') {
35
+ date.setDate(date.getDate() + 7);
36
+ }
37
+ else if (frequency === 'biweekly') {
38
+ date.setDate(date.getDate() + 14);
39
+ }
40
+ else if (frequency === 'monthly') {
41
+ date.setMonth(date.getMonth() + 1);
42
+ }
43
+ const isWeekend = date.getDay() === 0 || date.getDay() === 6;
44
+ const isHolidayDate = (0, exports.isHoliday)((0, zeniDayJS_1.date)(date.toDateString()));
45
+ const result = isWeekend || isHolidayDate ? (0, exports.getNextNthWorkingDay)(date, [0, 6], 1) : date;
46
+ return (0, zeniDayJS_1.date)(result.toDateString());
47
+ };
48
+ exports.getNextTransferDate = getNextTransferDate;
19
49
  const getNextNthWorkingDay = (date, filterDaysIndex, numberOfWorkingDays) => {
20
50
  const currentDate = new Date(date.toDateString());
21
51
  const holidaysFormatted = holidays.map((holiday) => (0, zeniDayJS_1.date)(holiday.toDateString()).format(exports.standardFormat));
@@ -8,6 +8,15 @@ import { EntityOrder } from '../../commonStateTypes/selectorTypes/selectorTypes'
8
8
  import { ReportIDPlusForecastID } from '../../commonStateTypes/viewAndReport/viewAndReport';
9
9
  import { Account, AccountBase, AccountState, AccountType } from './accountState';
10
10
  export declare const getAccountBase: (accountState: AccountState, accountId: ID, reportId: ReportIDPlusForecastID) => AccountBase | undefined;
11
+ /**
12
+ * Transfer-account IDs from the API are resolved under `transfer_accounts`; if that
13
+ * slice is not hydrated yet, fall back to `account_list` so dropdowns still populate.
14
+ */
15
+ export declare const getAccountBaseForTransferAccounts: (accountState: AccountState, accountId: ID) => AccountBase | undefined;
16
+ /**
17
+ * Credit-card-only pool from the transfer-flow accounts API; falls back to `account_list`.
18
+ */
19
+ export declare const getAccountBaseForCreditCardTransferAccounts: (accountState: AccountState, accountId: ID) => AccountBase | undefined;
11
20
  export declare function getAccount(accountState: AccountState, id: {
12
21
  accountId: ID;
13
22
  reportId: ReportIDPlusForecastID;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getTransactionFilterAccountOptions = exports.getAllAccounts = exports.getAccountIdsForLabels = exports.getAccountIdsForTypes = exports.getAccountsByType = exports.getAccountsOrdered = exports.getAccountBase = void 0;
6
+ exports.getTransactionFilterAccountOptions = exports.getAllAccounts = exports.getAccountIdsForLabels = exports.getAccountIdsForTypes = exports.getAccountsByType = exports.getAccountsOrdered = exports.getAccountBaseForCreditCardTransferAccounts = exports.getAccountBaseForTransferAccounts = exports.getAccountBase = void 0;
7
7
  exports.getAccount = getAccount;
8
8
  exports.getAccountWithBalance = getAccountWithBalance;
9
9
  const toolkit_1 = require("@reduxjs/toolkit");
@@ -60,6 +60,19 @@ const getAccountBase = (accountState, accountId, reportId) => {
60
60
  };
61
61
  };
62
62
  exports.getAccountBase = getAccountBase;
63
+ /**
64
+ * Transfer-account IDs from the API are resolved under `transfer_accounts`; if that
65
+ * slice is not hydrated yet, fall back to `account_list` so dropdowns still populate.
66
+ */
67
+ const getAccountBaseForTransferAccounts = (accountState, accountId) => (0, exports.getAccountBase)(accountState, accountId, 'transfer_accounts') ??
68
+ (0, exports.getAccountBase)(accountState, accountId, 'account_list');
69
+ exports.getAccountBaseForTransferAccounts = getAccountBaseForTransferAccounts;
70
+ /**
71
+ * Credit-card-only pool from the transfer-flow accounts API; falls back to `account_list`.
72
+ */
73
+ const getAccountBaseForCreditCardTransferAccounts = (accountState, accountId) => (0, exports.getAccountBase)(accountState, accountId, 'credit_card_transfer_accounts') ??
74
+ (0, exports.getAccountBase)(accountState, accountId, 'account_list');
75
+ exports.getAccountBaseForCreditCardTransferAccounts = getAccountBaseForCreditCardTransferAccounts;
63
76
  function getAccount(accountState, id, filter, additionalBalancesOptions) {
64
77
  const key = (0, accountState_1.getAccountKey)(id.reportId, id.accountId, id.classesViewParentId, id.accountsViewParentId, id.projectsViewParentId);
65
78
  const account = accountState.accountsByKey[key];
@@ -20,7 +20,7 @@ export type UncategorizedAccountTypes = 'expense' | 'income';
20
20
  declare const toAccountLabel: (v: string) => "prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses";
21
21
  export type AccountLabel = ReturnType<typeof toAccountLabel>;
22
22
  export declare const toAccountLabelStrict: (v: string | null | undefined) => AccountLabel | undefined;
23
- export declare function getAccountKey(reportIdUniqueKey: ReportIDPlusForecastID, accountId: ID, classesViewParentId?: ClassesViewParentID, accountsViewParentId?: AccountsViewParentID, projectsViewParentId?: ProjectsViewParentID): `${string}-cash_balance` | `${string}-card_balance` | `${string}-expense_automation_card` | `${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}-profit_and_loss_by_projects` | `${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_list_of_account_by_project` | `${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}-zeni_treasury` | `${string}-charge_cards` | `${string}-other_connection` | `${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}-notification` | `${string}-rewards_card` | `${string}-billing` | `${string}-flux_analysis_operating_expense` | `${string}-account_reconciliation` | `${string}-zeni_credit_promo_card` | `${string}-treasury_promo_card` | `${string}-excluded_account_reconciliation` | `${string}-cash_balance+${string}` | `${string}-card_balance+${string}` | `${string}-expense_automation_card+${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}-profit_and_loss_by_projects+${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_list_of_account_by_project+${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}-zeni_treasury+${string}` | `${string}-charge_cards+${string}` | `${string}-other_connection+${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}` | `${string}-notification+${string}` | `${string}-rewards_card+${string}` | `${string}-billing+${string}` | `${string}-flux_analysis_operating_expense+${string}` | `${string}-account_reconciliation+${string}` | `${string}-zeni_credit_promo_card+${string}` | `${string}-treasury_promo_card+${string}` | `${string}-excluded_account_reconciliation+${string}`;
23
+ export declare function getAccountKey(reportIdUniqueKey: ReportIDPlusForecastID, accountId: ID, classesViewParentId?: ClassesViewParentID, accountsViewParentId?: AccountsViewParentID, projectsViewParentId?: ProjectsViewParentID): `${string}-cash_balance` | `${string}-card_balance` | `${string}-expense_automation_card` | `${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}-profit_and_loss_by_projects` | `${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_list_of_account_by_project` | `${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}-zeni_treasury` | `${string}-charge_cards` | `${string}-other_connection` | `${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}-notification` | `${string}-rewards_card` | `${string}-billing` | `${string}-flux_analysis_operating_expense` | `${string}-account_reconciliation` | `${string}-zeni_credit_promo_card` | `${string}-treasury_promo_card` | `${string}-excluded_account_reconciliation` | `${string}-transfer_accounts` | `${string}-credit_card_transfer_accounts` | `${string}-cash_balance+${string}` | `${string}-card_balance+${string}` | `${string}-expense_automation_card+${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}-profit_and_loss_by_projects+${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_list_of_account_by_project+${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}-zeni_treasury+${string}` | `${string}-charge_cards+${string}` | `${string}-other_connection+${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}` | `${string}-notification+${string}` | `${string}-rewards_card+${string}` | `${string}-billing+${string}` | `${string}-flux_analysis_operating_expense+${string}` | `${string}-account_reconciliation+${string}` | `${string}-zeni_credit_promo_card+${string}` | `${string}-treasury_promo_card+${string}` | `${string}-excluded_account_reconciliation+${string}` | `${string}-transfer_accounts+${string}` | `${string}-credit_card_transfer_accounts+${string}`;
24
24
  export type AccountKey = ReturnType<typeof getAccountKey>;
25
25
  export declare const toReconciliationAccountSource: (v: string) => "plaid" | "bank_statement";
26
26
  export type ReconciliationAccountSourceType = ReturnType<typeof toReconciliationAccountSource>;