@zeniai/client-epic-state 5.0.42 → 5.0.43-betaRD1

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/recommendationBase.d.ts +1 -1
  2. package/lib/entity/chargeCardRepayment/chargeCardRepayment.d.ts +1 -1
  3. package/lib/entity/creditAgent/creditAgentPayload.d.ts +41 -0
  4. package/lib/entity/creditAgent/creditAgentPayload.js +40 -0
  5. package/lib/entity/creditAgent/creditAgentReducer.d.ts +9 -0
  6. package/lib/entity/creditAgent/creditAgentReducer.js +37 -0
  7. package/lib/entity/creditAgent/creditAgentSelector.d.ts +3 -0
  8. package/lib/entity/creditAgent/creditAgentSelector.js +10 -0
  9. package/lib/entity/creditAgent/creditAgentState.d.ts +39 -0
  10. package/lib/entity/creditAgent/creditAgentState.js +17 -0
  11. package/lib/entity/project/projectPayload.d.ts +7 -0
  12. package/lib/entity/project/projectPayload.js +15 -1
  13. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  14. package/lib/entity/snackbar/snackbarTypes.js +3 -0
  15. package/lib/entity/task/taskPayload.d.ts +1 -0
  16. package/lib/entity/task/taskPayload.js +5 -0
  17. package/lib/entity/task/taskState.d.ts +5 -0
  18. package/lib/entity/task/taskState.js +6 -1
  19. package/lib/entity/tenant/clearAllEpic.d.ts +6 -3
  20. package/lib/entity/tenant/clearAllEpic.js +8 -2
  21. package/lib/entity/transaction/payloadTypes/transactionLinePayload.d.ts +2 -0
  22. package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +9 -0
  23. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +2 -0
  24. package/lib/epic.d.ts +8 -1
  25. package/lib/epic.js +8 -1
  26. package/lib/esm/entity/creditAgent/creditAgentPayload.js +36 -0
  27. package/lib/esm/entity/creditAgent/creditAgentReducer.js +33 -0
  28. package/lib/esm/entity/creditAgent/creditAgentSelector.js +6 -0
  29. package/lib/esm/entity/creditAgent/creditAgentState.js +13 -0
  30. package/lib/esm/entity/project/projectPayload.js +12 -0
  31. package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
  32. package/lib/esm/entity/task/taskPayload.js +6 -1
  33. package/lib/esm/entity/task/taskState.js +3 -0
  34. package/lib/esm/entity/tenant/clearAllEpic.js +8 -2
  35. package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +9 -0
  36. package/lib/esm/epic.js +8 -1
  37. package/lib/esm/index.js +18 -10
  38. package/lib/esm/reducer.js +12 -3
  39. package/lib/esm/view/common/recurringViewHelper.js +17 -0
  40. package/lib/esm/view/creditAgentView/buildCreditReportCsv.js +44 -0
  41. package/lib/esm/view/creditAgentView/creditAgentViewPayload.js +2 -0
  42. package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +183 -0
  43. package/lib/esm/view/creditAgentView/creditAgentViewSelector.js +85 -0
  44. package/lib/esm/view/creditAgentView/creditAgentViewState.js +20 -0
  45. package/lib/esm/view/creditAgentView/epics/fetchCardProfilesEpic.js +20 -0
  46. package/lib/esm/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +13 -0
  47. package/lib/esm/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +19 -0
  48. package/lib/esm/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +58 -0
  49. package/lib/esm/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.js +39 -0
  50. package/lib/esm/view/creditAgentView/epics/updateCardProfileEpic.js +62 -0
  51. package/lib/esm/view/projectList/fetchProjectListEpic.js +38 -0
  52. package/lib/esm/view/projectList/projectListPayload.js +1 -0
  53. package/lib/esm/view/projectList/projectListReducer.js +39 -0
  54. package/lib/esm/view/projectList/projectListSelector.js +9 -0
  55. package/lib/esm/view/projectList/projectListState.js +1 -0
  56. package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +2 -0
  57. package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +5 -0
  58. package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +1 -0
  59. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +5 -0
  60. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +1 -0
  61. package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +6 -0
  62. package/lib/esm/view/transactionDetail/epics/updateTransactionDetailEpic.js +3 -0
  63. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +14 -2
  64. package/lib/index.d.ts +24 -14
  65. package/lib/index.js +81 -46
  66. package/lib/reducer.d.ts +12 -3
  67. package/lib/reducer.js +12 -3
  68. package/lib/view/common/recurringViewHelper.d.ts +3 -2
  69. package/lib/view/common/recurringViewHelper.js +18 -1
  70. package/lib/view/creditAgentView/buildCreditReportCsv.d.ts +17 -0
  71. package/lib/view/creditAgentView/buildCreditReportCsv.js +47 -0
  72. package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +9 -0
  73. package/lib/view/creditAgentView/creditAgentViewPayload.js +7 -0
  74. package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +41 -0
  75. package/lib/view/creditAgentView/creditAgentViewReducer.js +187 -0
  76. package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +20 -0
  77. package/lib/view/creditAgentView/creditAgentViewSelector.js +93 -0
  78. package/lib/view/creditAgentView/creditAgentViewState.d.ts +34 -0
  79. package/lib/view/creditAgentView/creditAgentViewState.js +22 -0
  80. package/lib/view/creditAgentView/epics/fetchCardProfilesEpic.d.ts +15 -0
  81. package/lib/view/creditAgentView/epics/fetchCardProfilesEpic.js +24 -0
  82. package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.d.ts +11 -0
  83. package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +17 -0
  84. package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.d.ts +15 -0
  85. package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +23 -0
  86. package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.d.ts +29 -0
  87. package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +62 -0
  88. package/lib/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.d.ts +30 -0
  89. package/lib/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.js +43 -0
  90. package/lib/view/creditAgentView/epics/updateCardProfileEpic.d.ts +37 -0
  91. package/lib/view/creditAgentView/epics/updateCardProfileEpic.js +66 -0
  92. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  93. package/lib/view/projectList/fetchProjectListEpic.d.ts +8 -0
  94. package/lib/view/projectList/fetchProjectListEpic.js +42 -0
  95. package/lib/view/projectList/projectListPayload.d.ts +7 -0
  96. package/lib/view/projectList/projectListPayload.js +2 -0
  97. package/lib/view/projectList/projectListReducer.d.ts +9 -0
  98. package/lib/view/projectList/projectListReducer.js +43 -0
  99. package/lib/view/projectList/projectListSelector.d.ts +8 -0
  100. package/lib/view/projectList/projectListSelector.js +13 -0
  101. package/lib/view/projectList/projectListState.d.ts +4 -0
  102. package/lib/view/projectList/projectListState.js +2 -0
  103. package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +2 -0
  104. package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +5 -0
  105. package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +3 -1
  106. package/lib/view/taskManager/taskDetailView/taskDetail.js +1 -0
  107. package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +1 -0
  108. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +5 -0
  109. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +1 -0
  110. package/lib/view/transactionDetail/epics/transactionDetailEpic.d.ts +2 -1
  111. package/lib/view/transactionDetail/epics/transactionDetailEpic.js +6 -0
  112. package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +3 -0
  113. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +3 -0
  114. package/lib/view/transactionDetail/transactionDetailSelector.js +13 -1
  115. package/lib/view/transactionDetail/transactionDetailState.d.ts +2 -0
  116. package/lib/view/transactionDetail/transactionDetailTypes.d.ts +2 -0
  117. package/package.json +1 -1
  118. package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
package/lib/reducer.d.ts CHANGED
@@ -2,6 +2,8 @@ import { AccountState } from './entity/account/accountState';
2
2
  import { AccountGroupState } from './entity/accountGroup/accountGroupState';
3
3
  import { AccountReconState } from './entity/accountRecon/accountReconState';
4
4
  import { AddressState } from './entity/address/addressState';
5
+ import { AiAccountantCustomerState } from './entity/aiAccountantCustomer/aiAccountantCustomerState';
6
+ import { CreditAgentEntityState } from './entity/creditAgent/creditAgentState';
5
7
  import { AiCfoState } from './entity/aiCfo/aiCfoState';
6
8
  import { ApprovalRuleState } from './entity/approvalRule/approvalRuleState';
7
9
  import { BankAccountState } from './entity/bankAccount/bankAccount';
@@ -13,7 +15,6 @@ import { ChargeCardState } from './entity/chargeCard/chargeCard';
13
15
  import { ChargeCardRepaymentState } from './entity/chargeCardRepayment/chargeCardRepayment';
14
16
  import { ChargeCardTransactionState } from './entity/chargeCardTransaction/chargeCardTransaction';
15
17
  import { ClassState } from './entity/class/classState';
16
- import { ProjectState } from './entity/project/projectReducer';
17
18
  import { CompanyState } from './entity/company/companyState';
18
19
  import { CompanyHealthState } from './entity/companyHealthMetric/companyHealthMetricState';
19
20
  import { ConnectedAccountState } from './entity/connectedAccount/connectedAccount';
@@ -38,6 +39,7 @@ import { OnboardingCustomerState } from './entity/onboardingCustomer/onboardingC
38
39
  import { PaymentAccountState } from './entity/paymentAccount/paymentAccountState';
39
40
  import { PaymentInstrumentState } from './entity/paymentInstrument/paymentInstrument';
40
41
  import { AccountingSummaryState } from './entity/portfolio/accountingSummary/accountingSummaryState';
42
+ import { ProjectState } from './entity/project/projectReducer';
41
43
  import { ReimbursementState } from './entity/reimbursement/reimbursementState';
42
44
  import { SectionAccountsViewState } from './entity/sectionAccountsView/sectionAccountsViewState';
43
45
  import { SectionClassesViewStateV2 } from './entity/sectionClassesViewV2/sectionClassesViewState';
@@ -66,10 +68,9 @@ import { VendorExpenseState } from './entity/vendorExpense/vendorExpenseState';
66
68
  import { AccountListState } from './view/accountList/accountListState';
67
69
  import { AccountMappingState } from './view/accountMappingView/accountMappingState';
68
70
  import { AddressViewState } from './view/addressView/addressViewState';
71
+ import { AiAccountantViewState } from './view/aiAccountantView/aiAccountantViewState';
69
72
  import { AggregatedReportViewState } from './view/aiAgentPerformance/aggregatedReportViewReducer';
70
73
  import { AiCfoViewState } from './view/aiCfoView/aiCfoViewState';
71
- import { AiAccountantCustomerState } from './entity/aiAccountantCustomer/aiAccountantCustomerState';
72
- import { AiAccountantViewState } from './view/aiAccountantView/aiAccountantViewState';
73
74
  import { ApAgingDetailState } from './view/apAgingView/apAgingDetail/apAgingDetailState';
74
75
  import { ApAgingState } from './view/apAgingView/apAgingReport/apAgingState';
75
76
  import { ArAgingDetailState } from './view/arAgingView/arAgingDetail/arAgingDetailState';
@@ -96,6 +97,7 @@ import { CompanyHealthMetricView } from './view/companyHealthMetricView/companyH
96
97
  import { CompanyMonthEndReportViewState } from './view/companyMonthEndReportView/companyMonthEndReportViewState';
97
98
  import { CompanyTaskManagerViewState } from './view/companyTaskManagerView/companyTaskManagerViewState';
98
99
  import { CompanyViewState } from './view/companyView/companyViewState';
100
+ import { CreditAgentViewState } from './view/creditAgentView/creditAgentViewState';
99
101
  import { DashboardState } from './view/dashboard/dashboardState';
100
102
  import { DashboardLayoutState } from './view/dashboardLayout/dashboardLayoutState';
101
103
  import { ExpenseAutomationViewState } from './view/expenseAutomationView/expenseAutomationViewState';
@@ -126,6 +128,7 @@ import { PeopleState } from './view/people/peopleState';
126
128
  import { ProfitAndLossWithForecastState } from './view/profitAndLoss/profitAndLossState';
127
129
  import { ProfitAndLossClassesViewState } from './view/profitAndLossClassesView/profitAndLossClassesViewState';
128
130
  import { ProfitAndLossProjectViewState } from './view/profitAndLossProjectView/profitAndLossProjectViewState';
131
+ import { ProjectListState } from './view/projectList/projectListState';
129
132
  import { EntityRecommendationState } from './view/recommendation/recommendationState';
130
133
  import { ReferralViewState } from './view/referralView/referralState';
131
134
  import { ReimbursementCardState } from './view/reimbursementCard/reimbursementCardState';
@@ -338,6 +341,8 @@ type ViewsState = {
338
341
  companyTaskManagerViewState: CompanyTaskManagerViewState;
339
342
  companyViewState: CompanyViewState;
340
343
  countryListState: CountryListState;
344
+ creditAgentEntityState: CreditAgentEntityState;
345
+ creditAgentViewState: CreditAgentViewState;
341
346
  dashboardLayoutState: DashboardLayoutState;
342
347
  dashboardState: DashboardState;
343
348
  depositAccountListState: DepositAccountListState;
@@ -383,6 +388,7 @@ type ViewsState = {
383
388
  profitAndLossClassesViewState: ProfitAndLossClassesViewState;
384
389
  profitAndLossProjectViewState: ProfitAndLossProjectViewState;
385
390
  profitAndLossState: ProfitAndLossWithForecastState;
391
+ projectListState: ProjectListState;
386
392
  realTimeApprovalState: RealTimeApprovalState;
387
393
  referralViewState: ReferralViewState;
388
394
  reimbursementCardState: ReimbursementCardState;
@@ -495,6 +501,8 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
495
501
  companyTaskManagerViewState: CompanyTaskManagerViewState;
496
502
  companyViewState: CompanyViewState;
497
503
  countryListState: CountryListState;
504
+ creditAgentEntityState: CreditAgentEntityState;
505
+ creditAgentViewState: CreditAgentViewState;
498
506
  dashboardState: DashboardState;
499
507
  dashboardLayoutState: DashboardLayoutState;
500
508
  depositAccountListState: DepositAccountListState;
@@ -541,6 +549,7 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
541
549
  profitAndLossClassesViewState: ProfitAndLossClassesViewState;
542
550
  profitAndLossProjectViewState: ProfitAndLossProjectViewState;
543
551
  profitAndLossState: ProfitAndLossWithForecastState;
552
+ projectListState: ProjectListState;
544
553
  realTimeApprovalState: RealTimeApprovalState;
545
554
  referralViewState: ReferralViewState;
546
555
  reimbursementCardState: ReimbursementCardState;
package/lib/reducer.js CHANGED
@@ -42,6 +42,8 @@ const accountReducer_1 = __importStar(require("./entity/account/accountReducer")
42
42
  const accountGroupReducer_1 = __importStar(require("./entity/accountGroup/accountGroupReducer"));
43
43
  const accountReconReducer_1 = __importStar(require("./entity/accountRecon/accountReconReducer"));
44
44
  const addressReducer_1 = __importStar(require("./entity/address/addressReducer"));
45
+ const aiAccountantCustomerReducer_1 = __importStar(require("./entity/aiAccountantCustomer/aiAccountantCustomerReducer"));
46
+ const creditAgentReducer_1 = __importStar(require("./entity/creditAgent/creditAgentReducer"));
45
47
  const aiCfoReducer_1 = __importStar(require("./entity/aiCfo/aiCfoReducer"));
46
48
  const approvalRuleReducer_1 = __importStar(require("./entity/approvalRule/approvalRuleReducer"));
47
49
  const bankAccountReducer_1 = __importStar(require("./entity/bankAccount/bankAccountReducer"));
@@ -53,7 +55,6 @@ const chargeCardReducer_1 = __importStar(require("./entity/chargeCard/chargeCard
53
55
  const chargeCardRepaymentReducer_1 = __importStar(require("./entity/chargeCardRepayment/chargeCardRepaymentReducer"));
54
56
  const chargeCardTransactionReducer_1 = __importStar(require("./entity/chargeCardTransaction/chargeCardTransactionReducer"));
55
57
  const classReducer_1 = __importStar(require("./entity/class/classReducer"));
56
- const projectReducer_1 = __importStar(require("./entity/project/projectReducer"));
57
58
  const companyReducer_1 = __importStar(require("./entity/company/companyReducer"));
58
59
  const companyHealthMetricReducer_1 = __importStar(require("./entity/companyHealthMetric/companyHealthMetricReducer"));
59
60
  const connectedAccountReducer_1 = __importStar(require("./entity/connectedAccount/connectedAccountReducer"));
@@ -78,6 +79,7 @@ const onboardingCustomerReducer_1 = __importStar(require("./entity/onboardingCus
78
79
  const paymentAccountReducer_1 = __importStar(require("./entity/paymentAccount/paymentAccountReducer"));
79
80
  const paymentInstrumentReducer_1 = __importStar(require("./entity/paymentInstrument/paymentInstrumentReducer"));
80
81
  const accountingSummaryReducer_1 = __importStar(require("./entity/portfolio/accountingSummary/accountingSummaryReducer"));
82
+ const projectReducer_1 = __importStar(require("./entity/project/projectReducer"));
81
83
  const reimbursementReducer_1 = __importStar(require("./entity/reimbursement/reimbursementReducer"));
82
84
  const sectionAccountsViewReducer_1 = __importStar(require("./entity/sectionAccountsView/sectionAccountsViewReducer"));
83
85
  const sectionClassesViewReducer_1 = __importStar(require("./entity/sectionClassesViewV2/sectionClassesViewReducer"));
@@ -106,10 +108,9 @@ const vendorExpenseReducer_1 = __importStar(require("./entity/vendorExpense/vend
106
108
  const accountListReducer_1 = __importStar(require("./view/accountList/accountListReducer"));
107
109
  const accountMappingReducer_1 = __importStar(require("./view/accountMappingView/accountMappingReducer"));
108
110
  const addressViewReducer_1 = __importStar(require("./view/addressView/addressViewReducer"));
111
+ const aiAccountantViewReducer_1 = __importStar(require("./view/aiAccountantView/aiAccountantViewReducer"));
109
112
  const aggregatedReportViewReducer_1 = __importStar(require("./view/aiAgentPerformance/aggregatedReportViewReducer"));
110
113
  const aiCfoViewReducer_1 = __importStar(require("./view/aiCfoView/aiCfoViewReducer"));
111
- const aiAccountantCustomerReducer_1 = __importStar(require("./entity/aiAccountantCustomer/aiAccountantCustomerReducer"));
112
- const aiAccountantViewReducer_1 = __importStar(require("./view/aiAccountantView/aiAccountantViewReducer"));
113
114
  const apAgingDetailReducer_1 = __importStar(require("./view/apAgingView/apAgingDetail/apAgingDetailReducer"));
114
115
  const apAgingReducer_1 = __importStar(require("./view/apAgingView/apAgingReport/apAgingReducer"));
115
116
  const arAgingDetailReducer_1 = __importStar(require("./view/arAgingView/arAgingDetail/arAgingDetailReducer"));
@@ -136,6 +137,7 @@ const companyHealthMetricViewReducer_1 = __importStar(require("./view/companyHea
136
137
  const companyMonthEndReportViewReducer_1 = __importStar(require("./view/companyMonthEndReportView/companyMonthEndReportViewReducer"));
137
138
  const companyTaskManagerViewReducer_1 = __importStar(require("./view/companyTaskManagerView/companyTaskManagerViewReducer"));
138
139
  const companyViewReducer_1 = __importStar(require("./view/companyView/companyViewReducer"));
140
+ const creditAgentViewReducer_1 = __importStar(require("./view/creditAgentView/creditAgentViewReducer"));
139
141
  const dashboardReducer_1 = __importStar(require("./view/dashboard/dashboardReducer"));
140
142
  const dashboardLayoutReducer_1 = __importStar(require("./view/dashboardLayout/dashboardLayoutReducer"));
141
143
  const expenseAutomationViewReducer_1 = __importStar(require("./view/expenseAutomationView/expenseAutomationViewReducer"));
@@ -167,6 +169,7 @@ const peopleReducer_1 = __importStar(require("./view/people/peopleReducer"));
167
169
  const profitAndLossReducer_1 = __importStar(require("./view/profitAndLoss/profitAndLossReducer"));
168
170
  const profitAndLossClassesViewReducer_1 = __importStar(require("./view/profitAndLossClassesView/profitAndLossClassesViewReducer"));
169
171
  const profitAndLossProjectViewReducer_1 = __importStar(require("./view/profitAndLossProjectView/profitAndLossProjectViewReducer"));
172
+ const projectListReducer_1 = __importStar(require("./view/projectList/projectListReducer"));
170
173
  const recommendationReducer_1 = __importStar(require("./view/recommendation/recommendationReducer"));
171
174
  const referralReducer_1 = __importStar(require("./view/referralView/referralReducer"));
172
175
  const reimbursementCardReducer_1 = __importStar(require("./view/reimbursementCard/reimbursementCardReducer"));
@@ -380,6 +383,8 @@ const initialViewsState = {
380
383
  companyTaskManagerViewState: companyTaskManagerViewReducer_1.initialState,
381
384
  companyViewState: companyViewReducer_1.initialState,
382
385
  countryListState: countryListReducer_1.initialState,
386
+ creditAgentEntityState: creditAgentReducer_1.initialCreditAgentEntityState,
387
+ creditAgentViewState: creditAgentViewReducer_1.initialState,
383
388
  dashboardLayoutState: dashboardLayoutReducer_1.initialState,
384
389
  dashboardState: dashboardReducer_1.initialState,
385
390
  depositAccountListState: depositAccountListReducer_1.initialState,
@@ -425,6 +430,7 @@ const initialViewsState = {
425
430
  profitAndLossClassesViewState: profitAndLossClassesViewReducer_1.initialState,
426
431
  profitAndLossProjectViewState: profitAndLossProjectViewReducer_1.initialState,
427
432
  profitAndLossState: profitAndLossReducer_1.initialState,
433
+ projectListState: projectListReducer_1.initialState,
428
434
  realTimeApprovalState: realTimeApprovalReducer_1.initialState,
429
435
  referralViewState: referralReducer_1.initialState,
430
436
  reimbursementCardState: reimbursementCardReducer_1.initialState,
@@ -612,6 +618,8 @@ const viewReducers = {
612
618
  companyTaskManagerViewState: companyTaskManagerViewReducer_1.default,
613
619
  companyViewState: companyViewReducer_1.default,
614
620
  countryListState: countryListReducer_1.default,
621
+ creditAgentEntityState: creditAgentReducer_1.default,
622
+ creditAgentViewState: creditAgentViewReducer_1.default,
615
623
  dashboardState: dashboardReducer_1.default,
616
624
  dashboardLayoutState: dashboardLayoutReducer_1.default,
617
625
  depositAccountListState: depositAccountListReducer_1.default,
@@ -658,6 +666,7 @@ const viewReducers = {
658
666
  profitAndLossClassesViewState: profitAndLossClassesViewReducer_1.default,
659
667
  profitAndLossProjectViewState: profitAndLossProjectViewReducer_1.default,
660
668
  profitAndLossState: profitAndLossReducer_1.default,
669
+ projectListState: projectListReducer_1.default,
661
670
  realTimeApprovalState: realTimeApprovalReducer_1.default,
662
671
  referralViewState: referralReducer_1.default,
663
672
  reimbursementCardState: reimbursementCardReducer_1.default,
@@ -1,7 +1,8 @@
1
1
  import { ZeniDate } from '../../zeniDayJS';
2
- export declare const toRecurringFrequency: (v: string) => "weekly" | "biweekly" | "monthly" | "quarterly" | "daily";
3
- export declare const toRecurringFrequencyStrict: (v?: string) => "weekly" | "biweekly" | "monthly" | "quarterly" | "daily" | undefined;
2
+ export declare const toRecurringFrequency: (v: string) => "weekly" | "biweekly" | "monthly" | "quarterly" | "daily" | "semi_weekly";
3
+ export declare const toRecurringFrequencyStrict: (v?: string) => "weekly" | "biweekly" | "monthly" | "quarterly" | "daily" | "semi_weekly" | undefined;
4
4
  export type RecurringFrequencyType = NonNullable<ReturnType<typeof toRecurringFrequency>>;
5
+ export declare const SEMI_WEEKLY_REQUIRED_DAYS_COUNT = 2;
5
6
  declare const toRecurringDatePickerOptions: (v: string) => "date" | "recurringCount";
6
7
  export type RecurringDatePickerOptions = NonNullable<ReturnType<typeof toRecurringDatePickerOptions>>;
7
8
  export declare const getRecurringFrequencyInDays: (frequency: RecurringFrequencyType) => number;
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMinAllowedEndDate = exports.getRecurringEndDateFromCount = exports.getRecurringFrequencyInDays = exports.toRecurringFrequencyStrict = exports.toRecurringFrequency = void 0;
3
+ exports.getMinAllowedEndDate = exports.getRecurringEndDateFromCount = exports.getRecurringFrequencyInDays = exports.SEMI_WEEKLY_REQUIRED_DAYS_COUNT = exports.toRecurringFrequencyStrict = exports.toRecurringFrequency = void 0;
4
4
  const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
5
5
  const ALL_RECURRING_FREQUENCY = [
6
6
  'daily',
7
7
  'weekly',
8
8
  'biweekly',
9
+ 'semi_weekly',
9
10
  'monthly',
10
11
  'quarterly',
11
12
  ];
@@ -13,6 +14,7 @@ const toRecurringFrequency = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_RE
13
14
  exports.toRecurringFrequency = toRecurringFrequency;
14
15
  const toRecurringFrequencyStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v ?? '', ALL_RECURRING_FREQUENCY);
15
16
  exports.toRecurringFrequencyStrict = toRecurringFrequencyStrict;
17
+ exports.SEMI_WEEKLY_REQUIRED_DAYS_COUNT = 2;
16
18
  const ALL_RECURRING_DATE_PICKER_OPTIONS = ['date', 'recurringCount'];
17
19
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
18
20
  const toRecurringDatePickerOptions = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_RECURRING_DATE_PICKER_OPTIONS);
@@ -20,6 +22,8 @@ const getRecurringFrequencyInDays = (frequency) => {
20
22
  switch (frequency) {
21
23
  case 'daily':
22
24
  return 1;
25
+ case 'semi_weekly':
26
+ return 3;
23
27
  case 'weekly':
24
28
  return 7;
25
29
  case 'biweekly':
@@ -41,6 +45,17 @@ const getRecurringEndDateFromCount = (startDate, frequency, recurringCount) => {
41
45
  case 'biweekly':
42
46
  endDate = startDate.add((0, exports.getRecurringFrequencyInDays)(frequency) * (recurringCount - 1), 'day');
43
47
  break;
48
+ case 'semi_weekly': {
49
+ // Two semi-weekly occurrences span exactly 7 days regardless of which
50
+ // two weekdays are picked (since gap1 + gap2 = 7). So odd counts are
51
+ // exact; even counts use the conservative half-week step (4 days).
52
+ const stepsRemaining = recurringCount - 1;
53
+ const fullWeekPairs = Math.floor(stepsRemaining / 2);
54
+ const hasOddTailStep = stepsRemaining % 2 === 1;
55
+ const days = fullWeekPairs * 7 + (hasOddTailStep ? 4 : 0);
56
+ endDate = startDate.add(days, 'day');
57
+ break;
58
+ }
44
59
  case 'monthly':
45
60
  endDate = startDate.add(recurringCount - 1, 'month');
46
61
  break;
@@ -58,6 +73,8 @@ const getMinAllowedEndDate = (frequency, startDate) => {
58
73
  switch (frequency) {
59
74
  case 'daily':
60
75
  return startDate.add(1, 'day');
76
+ case 'semi_weekly':
77
+ return startDate.add(3, 'day');
61
78
  case 'weekly':
62
79
  return startDate.add(7, 'day');
63
80
  case 'biweekly':
@@ -0,0 +1,17 @@
1
+ import { CardTenantProfileRow } from '../../entity/creditAgent/creditAgentState';
2
+ /**
3
+ * Payload shape expected by the web-app-v2 GET /tableDownload endpoint.
4
+ */
5
+ export interface CreditReportDownloadPayload {
6
+ columns: string[];
7
+ file_name: string;
8
+ rows: (string | number | null | undefined)[][];
9
+ sheet_name: string;
10
+ }
11
+ /**
12
+ * Build the payload for the web-app-v2 table download endpoint.
13
+ *
14
+ * The component calls this, then GETs the endpoint with the payload
15
+ * as a query param and handles the blob response as a file download.
16
+ */
17
+ export declare function getCreditReportDownloadPayload(rows: CardTenantProfileRow[]): CreditReportDownloadPayload;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCreditReportDownloadPayload = getCreditReportDownloadPayload;
4
+ const CREDIT_REPORT_COLUMNS = [
5
+ 'Customer Name',
6
+ 'Card Status',
7
+ 'Credit Limit ($)',
8
+ 'Credit Score',
9
+ 'Recommended Amount ($)',
10
+ 'Rationale',
11
+ 'Report Date',
12
+ 'Tenant Email Domain',
13
+ 'Tenant ID',
14
+ 'Company ID',
15
+ 'Updated By',
16
+ 'Updated On',
17
+ ];
18
+ function rowToFields(row) {
19
+ return [
20
+ row.customerName,
21
+ row.cardStatus,
22
+ row.creditLimit,
23
+ row.creditScore,
24
+ row.recommendedAmount,
25
+ row.rationale,
26
+ row.reportDate?.format('YYYY-MM-DD'),
27
+ row.tenantEmailDomain,
28
+ row.tenantId,
29
+ row.companyId,
30
+ row.updatedByName,
31
+ row.updatedOn?.format('YYYY-MM-DD'),
32
+ ];
33
+ }
34
+ /**
35
+ * Build the payload for the web-app-v2 table download endpoint.
36
+ *
37
+ * The component calls this, then GETs the endpoint with the payload
38
+ * as a query param and handles the blob response as a file download.
39
+ */
40
+ function getCreditReportDownloadPayload(rows) {
41
+ return {
42
+ columns: CREDIT_REPORT_COLUMNS,
43
+ rows: rows.map(rowToFields),
44
+ file_name: 'credit-report',
45
+ sheet_name: 'Credit Report',
46
+ };
47
+ }
@@ -0,0 +1,9 @@
1
+ import type { CardTenantProfileUpdatePayload, CardTenantProfilesPayload, MacroPayload } from '../../entity/creditAgent/creditAgentPayload';
2
+ import { ZeniAPIResponse } from '../../responsePayload';
3
+ export { CardTenantProfileRowPayload, CardTenantProfilesPayload, CardTenantProfileUpdatePayload, MacroPayload, toCardTenantProfileRow, toMacro, } from '../../entity/creditAgent/creditAgentPayload';
4
+ export type CardTenantProfilesResponse = ZeniAPIResponse<CardTenantProfilesPayload>;
5
+ export type CreditAgentAccessResponse = ZeniAPIResponse<{
6
+ is_allowed: boolean;
7
+ }>;
8
+ export type CardTenantProfileUpdateResponse = ZeniAPIResponse<CardTenantProfileUpdatePayload>;
9
+ export type MacroResponse = ZeniAPIResponse<MacroPayload>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toMacro = exports.toCardTenantProfileRow = void 0;
4
+ // Re-export entity payload types and mapping functions.
5
+ var creditAgentPayload_1 = require("../../entity/creditAgent/creditAgentPayload");
6
+ Object.defineProperty(exports, "toCardTenantProfileRow", { enumerable: true, get: function () { return creditAgentPayload_1.toCardTenantProfileRow; } });
7
+ Object.defineProperty(exports, "toMacro", { enumerable: true, get: function () { return creditAgentPayload_1.toMacro; } });
@@ -0,0 +1,41 @@
1
+ import { CardTenantProfileRowPayload } from '../../entity/creditAgent/creditAgentPayload';
2
+ import { CardStatus } from '../../entity/creditAgent/creditAgentState';
3
+ import { ZeniAPIStatus } from '../../responsePayload';
4
+ import { CreditAgentUIState, CreditAgentViewState } from './creditAgentViewState';
5
+ export declare const initialCreditAgentViewState: CreditAgentViewState;
6
+ export declare const fetchCreditAgentAccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditAgentView/fetchCreditAgentAccess">, fetchCreditAgentAccessSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "creditAgentView/fetchCreditAgentAccessSuccess">, fetchCreditAgentAccessFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "creditAgentView/fetchCreditAgentAccessFailure">, scheduleTenantCreditScoreCron: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId?: string | undefined], {
7
+ tenantId: string | undefined;
8
+ }, "creditAgentView/scheduleTenantCreditScoreCron", never, never>, scheduleTenantCreditScoreCronSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId?: string | undefined], {
9
+ tenantId: string | undefined;
10
+ }, "creditAgentView/scheduleTenantCreditScoreCronSuccess", never, never>, scheduleTenantCreditScoreCronFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string | undefined, error: ZeniAPIStatus<Record<string, unknown>>], {
11
+ tenantId: string | undefined;
12
+ error: ZeniAPIStatus<Record<string, unknown>>;
13
+ }, "creditAgentView/scheduleTenantCreditScoreCronFailure", never, never>, fetchCreditAgentMacro: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditAgentView/fetchCreditAgentMacro">, fetchCreditAgentMacroSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditAgentView/fetchCreditAgentMacroSuccess">, fetchCreditAgentMacroFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "creditAgentView/fetchCreditAgentMacroFailure">, saveCreditAgentMacro: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[instructions: string], {
14
+ instructions: string;
15
+ }, "creditAgentView/saveCreditAgentMacro", never, never>, saveCreditAgentMacroSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditAgentView/saveCreditAgentMacroSuccess">, saveCreditAgentMacroFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "creditAgentView/saveCreditAgentMacroFailure">, resetSaveMacroState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditAgentView/resetSaveMacroState">, fetchCardProfiles: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditAgentView/fetchCardProfiles">, fetchCardProfilesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<CardTenantProfileRowPayload[], "creditAgentView/fetchCardProfilesSuccess">, fetchCardProfilesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "creditAgentView/fetchCardProfilesFailure">, updateCardProfile: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
16
+ tenantEmailDomain: string;
17
+ tenantId: string;
18
+ update: {
19
+ cardStatus?: CardStatus;
20
+ creditLimit?: number;
21
+ reason?: string;
22
+ updatedByName?: string;
23
+ };
24
+ }], {
25
+ tenantEmailDomain: string;
26
+ tenantId: string;
27
+ update: {
28
+ cardStatus?: CardStatus;
29
+ creditLimit?: number;
30
+ reason?: string;
31
+ updatedByName?: string;
32
+ };
33
+ }, "creditAgentView/updateCardProfile", never, never>, updateCardProfileSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string], {
34
+ tenantId: string;
35
+ }, "creditAgentView/updateCardProfileSuccess", never, never>, updateCardProfileFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, error: ZeniAPIStatus<Record<string, unknown>>], {
36
+ tenantId: string;
37
+ error: ZeniAPIStatus<Record<string, unknown>>;
38
+ }, "creditAgentView/updateCardProfileFailure", never, never>, updateCreditAgentUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<CreditAgentUIState>, "creditAgentView/updateCreditAgentUIState">, clearCreditAgentView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditAgentView/clearCreditAgentView">;
39
+ export { initialCreditAgentViewState as initialState };
40
+ declare const _default: import("redux").Reducer<CreditAgentViewState>;
41
+ export default _default;
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.initialState = exports.clearCreditAgentView = exports.updateCreditAgentUIState = exports.updateCardProfileFailure = exports.updateCardProfileSuccess = exports.updateCardProfile = exports.fetchCardProfilesFailure = exports.fetchCardProfilesSuccess = exports.fetchCardProfiles = exports.resetSaveMacroState = exports.saveCreditAgentMacroFailure = exports.saveCreditAgentMacroSuccess = exports.saveCreditAgentMacro = exports.fetchCreditAgentMacroFailure = exports.fetchCreditAgentMacroSuccess = exports.fetchCreditAgentMacro = exports.scheduleTenantCreditScoreCronFailure = exports.scheduleTenantCreditScoreCronSuccess = exports.scheduleTenantCreditScoreCron = exports.fetchCreditAgentAccessFailure = exports.fetchCreditAgentAccessSuccess = exports.fetchCreditAgentAccess = exports.initialCreditAgentViewState = void 0;
5
+ const toolkit_1 = require("@reduxjs/toolkit");
6
+ const initialTenantView = {
7
+ analyzeStatus: { fetchState: 'Not-Started' },
8
+ updateStatus: { fetchState: 'Not-Started' },
9
+ };
10
+ function getOrCreateTenantView(draft, tenantId) {
11
+ if (draft.tenantViewByTenantId[tenantId] == null) {
12
+ draft.tenantViewByTenantId[tenantId] = {
13
+ ...initialTenantView,
14
+ tenantId,
15
+ };
16
+ }
17
+ return draft.tenantViewByTenantId[tenantId];
18
+ }
19
+ exports.initialCreditAgentViewState = {
20
+ access: {
21
+ fetchStatus: { fetchState: 'Not-Started' },
22
+ isAllowed: false,
23
+ },
24
+ macro: {
25
+ fetchStatus: { fetchState: 'Not-Started' },
26
+ updateStatus: { fetchState: 'Not-Started' },
27
+ },
28
+ profilesFetchStatus: { fetchState: 'Not-Started' },
29
+ tenantViewByTenantId: {},
30
+ uiState: {
31
+ filterText: '',
32
+ focus: 'All',
33
+ minScore: 0,
34
+ sortDir: 'asc',
35
+ sortKey: undefined,
36
+ },
37
+ };
38
+ exports.initialState = exports.initialCreditAgentViewState;
39
+ const creditAgentView = (0, toolkit_1.createSlice)({
40
+ name: 'creditAgentView',
41
+ initialState: exports.initialCreditAgentViewState,
42
+ reducers: {
43
+ // ── Access ──
44
+ fetchCreditAgentAccess(draft) {
45
+ draft.access.fetchStatus = { fetchState: 'In-Progress' };
46
+ },
47
+ fetchCreditAgentAccessSuccess(draft, action) {
48
+ draft.access.fetchStatus = { fetchState: 'Completed' };
49
+ draft.access.isAllowed = action.payload;
50
+ },
51
+ fetchCreditAgentAccessFailure(draft, action) {
52
+ draft.access.fetchStatus = { fetchState: 'Error', error: action.payload };
53
+ },
54
+ // ── Card Profiles (list-level fetch) ──
55
+ fetchCardProfiles(draft) {
56
+ draft.profilesFetchStatus = { fetchState: 'In-Progress' };
57
+ },
58
+ fetchCardProfilesSuccess(draft, action) {
59
+ draft.profilesFetchStatus = { fetchState: 'Completed' };
60
+ // Replace entire tenantViewByTenantId, preserving existing statuses
61
+ // for tenants still present, removing stale ones.
62
+ draft.tenantViewByTenantId = toTenantViewByTenantId(action.payload, draft.tenantViewByTenantId);
63
+ },
64
+ fetchCardProfilesFailure(draft, action) {
65
+ draft.profilesFetchStatus = { fetchState: 'Error', error: action.payload };
66
+ },
67
+ // ── Update Card Profile (per-tenant) ──
68
+ updateCardProfile: {
69
+ reducer(draft, action) {
70
+ const tv = getOrCreateTenantView(draft, action.payload.tenantId);
71
+ tv.updateStatus = { fetchState: 'In-Progress' };
72
+ },
73
+ prepare(payload) {
74
+ return { payload };
75
+ },
76
+ },
77
+ updateCardProfileSuccess: {
78
+ reducer(draft, action) {
79
+ const tv = getOrCreateTenantView(draft, action.payload.tenantId);
80
+ tv.updateStatus = { fetchState: 'Completed' };
81
+ },
82
+ prepare(tenantId) {
83
+ return { payload: { tenantId } };
84
+ },
85
+ },
86
+ updateCardProfileFailure: {
87
+ reducer(draft, action) {
88
+ const tv = getOrCreateTenantView(draft, action.payload.tenantId);
89
+ tv.updateStatus = {
90
+ fetchState: 'Error',
91
+ error: action.payload.error,
92
+ };
93
+ },
94
+ prepare(tenantId, error) {
95
+ return { payload: { tenantId, error } };
96
+ },
97
+ },
98
+ // ── Analyze / Schedule Cron (per-tenant) ──
99
+ scheduleTenantCreditScoreCron: {
100
+ reducer(draft, action) {
101
+ if (action.payload.tenantId != null) {
102
+ const tv = getOrCreateTenantView(draft, action.payload.tenantId);
103
+ tv.analyzeStatus = { fetchState: 'In-Progress' };
104
+ }
105
+ },
106
+ prepare(tenantId) {
107
+ return { payload: { tenantId } };
108
+ },
109
+ },
110
+ scheduleTenantCreditScoreCronSuccess: {
111
+ reducer(draft, action) {
112
+ if (action.payload.tenantId != null) {
113
+ const tv = getOrCreateTenantView(draft, action.payload.tenantId);
114
+ tv.analyzeStatus = { fetchState: 'Completed' };
115
+ }
116
+ },
117
+ prepare(tenantId) {
118
+ return { payload: { tenantId } };
119
+ },
120
+ },
121
+ scheduleTenantCreditScoreCronFailure: {
122
+ reducer(draft, action) {
123
+ if (action.payload.tenantId != null) {
124
+ const tv = getOrCreateTenantView(draft, action.payload.tenantId);
125
+ tv.analyzeStatus = {
126
+ fetchState: 'Error',
127
+ error: action.payload.error,
128
+ };
129
+ }
130
+ },
131
+ prepare(tenantId, error) {
132
+ return { payload: { tenantId, error } };
133
+ },
134
+ },
135
+ // ── Macro ──
136
+ fetchCreditAgentMacro(draft) {
137
+ draft.macro.fetchStatus = { fetchState: 'In-Progress' };
138
+ },
139
+ fetchCreditAgentMacroSuccess(draft) {
140
+ draft.macro.fetchStatus = { fetchState: 'Completed' };
141
+ },
142
+ fetchCreditAgentMacroFailure(draft, action) {
143
+ draft.macro.fetchStatus = { fetchState: 'Error', error: action.payload };
144
+ },
145
+ saveCreditAgentMacro: {
146
+ reducer(draft) {
147
+ draft.macro.updateStatus = { fetchState: 'In-Progress' };
148
+ },
149
+ prepare(instructions) {
150
+ return { payload: { instructions } };
151
+ },
152
+ },
153
+ saveCreditAgentMacroSuccess(draft) {
154
+ draft.macro.updateStatus = { fetchState: 'Completed' };
155
+ },
156
+ saveCreditAgentMacroFailure(draft, action) {
157
+ draft.macro.updateStatus = { fetchState: 'Error', error: action.payload };
158
+ },
159
+ resetSaveMacroState(draft) {
160
+ draft.macro.updateStatus = { fetchState: 'Not-Started' };
161
+ },
162
+ // ── UI State ──
163
+ updateCreditAgentUIState(draft, action) {
164
+ Object.assign(draft.uiState, action.payload);
165
+ },
166
+ // ── Clear ──
167
+ clearCreditAgentView() {
168
+ return exports.initialCreditAgentViewState;
169
+ },
170
+ },
171
+ });
172
+ _a = creditAgentView.actions, exports.fetchCreditAgentAccess = _a.fetchCreditAgentAccess, exports.fetchCreditAgentAccessSuccess = _a.fetchCreditAgentAccessSuccess, exports.fetchCreditAgentAccessFailure = _a.fetchCreditAgentAccessFailure, exports.scheduleTenantCreditScoreCron = _a.scheduleTenantCreditScoreCron, exports.scheduleTenantCreditScoreCronSuccess = _a.scheduleTenantCreditScoreCronSuccess, exports.scheduleTenantCreditScoreCronFailure = _a.scheduleTenantCreditScoreCronFailure, exports.fetchCreditAgentMacro = _a.fetchCreditAgentMacro, exports.fetchCreditAgentMacroSuccess = _a.fetchCreditAgentMacroSuccess, exports.fetchCreditAgentMacroFailure = _a.fetchCreditAgentMacroFailure, exports.saveCreditAgentMacro = _a.saveCreditAgentMacro, exports.saveCreditAgentMacroSuccess = _a.saveCreditAgentMacroSuccess, exports.saveCreditAgentMacroFailure = _a.saveCreditAgentMacroFailure, exports.resetSaveMacroState = _a.resetSaveMacroState, exports.fetchCardProfiles = _a.fetchCardProfiles, exports.fetchCardProfilesSuccess = _a.fetchCardProfilesSuccess, exports.fetchCardProfilesFailure = _a.fetchCardProfilesFailure, exports.updateCardProfile = _a.updateCardProfile, exports.updateCardProfileSuccess = _a.updateCardProfileSuccess, exports.updateCardProfileFailure = _a.updateCardProfileFailure, exports.updateCreditAgentUIState = _a.updateCreditAgentUIState, exports.clearCreditAgentView = _a.clearCreditAgentView;
173
+ exports.default = creditAgentView.reducer;
174
+ // ── Helpers ──
175
+ const toTenantViewByTenantId = (rows, existing) => {
176
+ const result = {};
177
+ for (const row of rows) {
178
+ const tenantId = row.tenant_id;
179
+ const existingState = existing[tenantId];
180
+ result[tenantId] = existingState ?? {
181
+ analyzeStatus: { fetchState: 'Not-Started' },
182
+ tenantId,
183
+ updateStatus: { fetchState: 'Not-Started' },
184
+ };
185
+ }
186
+ return result;
187
+ };
@@ -0,0 +1,20 @@
1
+ import { FetchStateAndError } from '../../commonStateTypes/common';
2
+ import { CardTenantProfileRow, CreditAgentEntityState, CreditAgentMacro } from '../../entity/creditAgent/creditAgentState';
3
+ import { RootState } from '../../reducer';
4
+ import { CreditAgentUIState, CreditAgentViewState } from './creditAgentViewState';
5
+ export declare const getCreditAgentView: (state: RootState) => CreditAgentViewState;
6
+ export declare const getCreditAgentEntity: (state: RootState) => CreditAgentEntityState;
7
+ export declare const getCreditAgentMacro: (state: RootState) => {
8
+ fetchStatus: FetchStateAndError;
9
+ updateStatus: FetchStateAndError;
10
+ data?: CreditAgentMacro;
11
+ };
12
+ export interface CardProfileRowWithStatus extends CardTenantProfileRow {
13
+ analyzeStatus: FetchStateAndError;
14
+ updateStatus: FetchStateAndError;
15
+ }
16
+ export declare const getCardProfilesData: (state: RootState) => {
17
+ fetchStatus: FetchStateAndError;
18
+ rows: CardProfileRowWithStatus[];
19
+ uiState: CreditAgentUIState;
20
+ };