@zeniai/client-epic-state 5.1.97 → 5.1.99

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 (176) hide show
  1. package/lib/entity/invoicing/invoicingCommonPayload.d.ts +12 -0
  2. package/lib/entity/invoicing/invoicingCommonPayload.js +18 -0
  3. package/lib/entity/invoicing/invoicingTransaction/invoicingTransactionPayload.d.ts +1 -1
  4. package/lib/epic.d.ts +1 -5
  5. package/lib/epic.js +1 -5
  6. package/lib/esm/entity/invoicing/invoicingCommonPayload.js +16 -0
  7. package/lib/esm/epic.js +1 -5
  8. package/lib/esm/index.js +16 -18
  9. package/lib/esm/reducer.js +0 -3
  10. package/lib/esm/view/dashboard/dashboardEpic.js +0 -20
  11. package/lib/esm/view/dashboard/dashboardReducer.js +1 -13
  12. package/lib/esm/view/dashboard/dashboardSelector.js +2 -7
  13. package/lib/esm/view/invoicing/auditView/auditViewSelector.js +4 -0
  14. package/lib/esm/view/invoicing/couponView/couponViewSelector.js +18 -8
  15. package/lib/esm/view/invoicing/couponView/couponViewState.js +0 -9
  16. package/lib/esm/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +1 -0
  17. package/lib/esm/view/invoicing/createCreditNote/createCreditNotePayload.js +4 -1
  18. package/lib/esm/view/invoicing/createCreditNote/createCreditNoteSelector.js +4 -2
  19. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +7 -6
  20. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +3 -19
  21. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +10 -5
  22. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +6 -4
  23. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig.js +0 -17
  24. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +5 -0
  25. package/lib/esm/view/invoicing/invoiceList/fetchInvoiceListPageEpic.js +2 -1
  26. package/lib/esm/view/invoicing/invoiceList/invoiceListReducer.js +18 -17
  27. package/lib/esm/view/invoicing/invoiceList/invoiceListSelector.js +12 -4
  28. package/lib/esm/view/invoicing/invoiceList/invoiceListState.js +13 -9
  29. package/lib/esm/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js +5 -1
  30. package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +2 -1
  31. package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +26 -0
  32. package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +9 -0
  33. package/lib/esm/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.js +9 -3
  34. package/lib/esm/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.js +0 -9
  35. package/lib/esm/view/invoicing/invoicingCustomerDetailView/fetchInvoicingCustomerDetailPageEpic.js +2 -2
  36. package/lib/esm/view/invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js +1 -1
  37. package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.js +9 -3
  38. package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +0 -9
  39. package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.js +8 -3
  40. package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +1 -9
  41. package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +11 -3
  42. package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +0 -9
  43. package/lib/esm/view/invoicing/invoicingTabHelper.js +27 -0
  44. package/lib/esm/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionListPageEpic.js +2 -1
  45. package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewReducer.js +5 -5
  46. package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.js +12 -4
  47. package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.js +11 -9
  48. package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteFormConfig.js +1 -8
  49. package/lib/esm/view/invoicing/issueCreditNote/issueCreditNotePayload.js +5 -1
  50. package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +5 -2
  51. package/lib/esm/view/invoicing/recordPayment/recordPaymentFormConfig.js +0 -26
  52. package/lib/esm/view/invoicing/recordPayment/recordPaymentSelector.js +26 -6
  53. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +8 -1
  54. package/lib/esm/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +1 -67
  55. package/lib/index.d.ts +17 -20
  56. package/lib/index.js +41 -65
  57. package/lib/reducer.d.ts +0 -3
  58. package/lib/reducer.js +0 -3
  59. package/lib/view/dashboard/dashboardEpic.d.ts +1 -3
  60. package/lib/view/dashboard/dashboardEpic.js +0 -20
  61. package/lib/view/dashboard/dashboardReducer.d.ts +1 -1
  62. package/lib/view/dashboard/dashboardReducer.js +2 -14
  63. package/lib/view/dashboard/dashboardSelector.d.ts +0 -1
  64. package/lib/view/dashboard/dashboardSelector.js +2 -7
  65. package/lib/view/dashboard/dashboardState.d.ts +0 -1
  66. package/lib/view/invoicing/auditView/auditViewSelector.d.ts +4 -0
  67. package/lib/view/invoicing/auditView/auditViewSelector.js +4 -0
  68. package/lib/view/invoicing/couponView/couponViewSelector.d.ts +5 -1
  69. package/lib/view/invoicing/couponView/couponViewSelector.js +17 -7
  70. package/lib/view/invoicing/couponView/couponViewState.d.ts +0 -7
  71. package/lib/view/invoicing/couponView/couponViewState.js +1 -10
  72. package/lib/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +1 -0
  73. package/lib/view/invoicing/createCreditNote/createCreditNotePayload.js +4 -1
  74. package/lib/view/invoicing/createCreditNote/createCreditNoteSelector.d.ts +3 -1
  75. package/lib/view/invoicing/createCreditNote/createCreditNoteSelector.js +4 -2
  76. package/lib/view/invoicing/createCreditNote/createCreditNoteState.d.ts +6 -0
  77. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +5 -5
  78. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +6 -5
  79. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.d.ts +3 -6
  80. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +4 -20
  81. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.d.ts +9 -7
  82. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +10 -5
  83. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +4 -3
  84. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +5 -3
  85. package/lib/view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig.d.ts +0 -8
  86. package/lib/view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig.js +1 -18
  87. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +5 -0
  88. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +5 -0
  89. package/lib/view/invoicing/invoiceList/fetchInvoiceListPageEpic.js +2 -1
  90. package/lib/view/invoicing/invoiceList/invoiceListReducer.js +17 -16
  91. package/lib/view/invoicing/invoiceList/invoiceListSelector.d.ts +3 -1
  92. package/lib/view/invoicing/invoiceList/invoiceListSelector.js +11 -3
  93. package/lib/view/invoicing/invoiceList/invoiceListState.d.ts +13 -9
  94. package/lib/view/invoicing/invoiceList/invoiceListState.js +15 -10
  95. package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.d.ts +9 -1
  96. package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js +5 -1
  97. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +3 -1
  98. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +2 -1
  99. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +13 -0
  100. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
  101. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +26 -0
  102. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +19 -1
  103. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +11 -1
  104. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +13 -0
  105. package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.d.ts +8 -1
  106. package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.js +8 -2
  107. package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.d.ts +0 -7
  108. package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.js +1 -10
  109. package/lib/view/invoicing/invoicingCustomerDetailView/fetchInvoicingCustomerDetailPageEpic.js +2 -2
  110. package/lib/view/invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js +1 -1
  111. package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.d.ts +3 -1
  112. package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.js +8 -2
  113. package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.d.ts +0 -7
  114. package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +1 -10
  115. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
  116. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.d.ts +3 -1
  117. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.js +7 -2
  118. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +2 -9
  119. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +2 -10
  120. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts +7 -1
  121. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +10 -2
  122. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +0 -7
  123. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +1 -10
  124. package/lib/view/invoicing/invoicingTabHelper.d.ts +27 -0
  125. package/lib/view/invoicing/invoicingTabHelper.js +30 -0
  126. package/lib/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionListPageEpic.js +2 -1
  127. package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewReducer.d.ts +1 -1
  128. package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewReducer.js +4 -4
  129. package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.d.ts +8 -0
  130. package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.js +11 -3
  131. package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.d.ts +10 -10
  132. package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.js +13 -10
  133. package/lib/view/invoicing/issueCreditNote/issueCreditNoteFormConfig.d.ts +0 -2
  134. package/lib/view/invoicing/issueCreditNote/issueCreditNoteFormConfig.js +2 -9
  135. package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.d.ts +2 -2
  136. package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.js +5 -1
  137. package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +3 -1
  138. package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +4 -1
  139. package/lib/view/invoicing/issueCreditNote/issueCreditNoteState.d.ts +6 -0
  140. package/lib/view/invoicing/recordPayment/recordPaymentFormConfig.d.ts +0 -6
  141. package/lib/view/invoicing/recordPayment/recordPaymentFormConfig.js +1 -27
  142. package/lib/view/invoicing/recordPayment/recordPaymentSelector.d.ts +3 -2
  143. package/lib/view/invoicing/recordPayment/recordPaymentSelector.js +26 -6
  144. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +12 -1
  145. package/lib/view/invoicing/settingsView/settingsViewSelector.js +8 -1
  146. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
  147. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +2 -68
  148. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +0 -3
  149. package/package.json +1 -1
  150. package/lib/entity/invoicing/coupon/couponConstants.d.ts +0 -11
  151. package/lib/entity/invoicing/coupon/couponConstants.js +0 -29
  152. package/lib/esm/entity/invoicing/coupon/couponConstants.js +0 -26
  153. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -18
  154. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -18
  155. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -18
  156. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -16
  157. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -1
  158. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -60
  159. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -12
  160. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -1
  161. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +0 -8
  162. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -22
  163. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +0 -8
  164. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -22
  165. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +0 -8
  166. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -22
  167. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.d.ts +0 -13
  168. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +0 -20
  169. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.d.ts +0 -11
  170. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +0 -2
  171. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.d.ts +0 -7
  172. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +0 -64
  173. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +0 -12
  174. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +0 -15
  175. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.d.ts +0 -9
  176. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +0 -2
@@ -3,14 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getInvoicingTransactionListView = void 0;
4
4
  const toolkit_1 = require("@reduxjs/toolkit");
5
5
  const invoicingTransactionSelector_1 = require("../../../entity/invoicing/invoicingTransaction/invoicingTransactionSelector");
6
+ const invoicingTabHelper_1 = require("../invoicingTabHelper");
6
7
  const invoicingTransactionListViewState_1 = require("./invoicingTransactionListViewState");
7
8
  /**
8
9
  * Memoized so the denormalized `transactions` array (and the wrapping view
9
10
  * object) keep referential identity until the transaction entity slice or the
10
11
  * list-view slice actually change.
11
12
  */
12
- exports.getInvoicingTransactionListView = (0, toolkit_1.createSelector)((state) => state.invoicingTransactionState, (state) => state.invoicingTransactionListViewState, (transactionState, listViewState) => {
13
- const activeTabState = listViewState.byTab[listViewState.activeTab];
13
+ exports.getInvoicingTransactionListView = (0, toolkit_1.createSelector)((state) => state.invoicingTransactionState, (state) => state.invoicingTransactionListViewState, (state) => state.invoicingConfigViewState.transactionTypeOptions, (state) => state.invoicingConfigViewState.transactionStatusOptions, (transactionState, listViewState, typeOptions, statusOptions) => {
14
+ const activeTabState = listViewState.byTab[listViewState.activeTab] ??
15
+ (0, invoicingTransactionListViewState_1.makeInvoicingTransactionTabState)();
14
16
  return {
15
17
  activeTab: listViewState.activeTab,
16
18
  columns: invoicingTransactionListViewState_1.INVOICING_TRANSACTION_COLUMNS,
@@ -19,7 +21,13 @@ exports.getInvoicingTransactionListView = (0, toolkit_1.createSelector)((state)
19
21
  nextCursor: activeTabState.nextCursor,
20
22
  fetchState: activeTabState.fetchState,
21
23
  error: activeTabState.error,
22
- tabIds: invoicingTransactionListViewState_1.INVOICING_TRANSACTION_TABS,
24
+ statusOptions,
25
+ typeOptions,
26
+ // Tabs are types on this list, so the type list drives membership.
27
+ tabIds: (0, invoicingTabHelper_1.invoicingTabIdsFromConfig)({
28
+ allTabIds: invoicingTransactionListViewState_1.ALL_INVOICING_TRANSACTION_TAB_IDS,
29
+ statusOptions: typeOptions,
30
+ }),
23
31
  sort: listViewState.sort,
24
32
  version: 1.0,
25
33
  };
@@ -20,16 +20,9 @@ export interface InvoicingTransactionColumnConfig {
20
20
  sortable: boolean;
21
21
  }
22
22
  export declare const INVOICING_TRANSACTION_COLUMNS: InvoicingTransactionColumnConfig[];
23
- export declare const ALL_INVOICING_TRANSACTION_TAB_IDS: readonly ["all", "payment", "refund", "authorization", "payment_reversal"];
24
- export declare const toInvoicingTransactionTabId: (v: string) => "refund" | "payment" | "all" | "authorization" | "payment_reversal";
23
+ export declare const ALL_INVOICING_TRANSACTION_TAB_IDS: readonly ["all", "payment", "refund", "authorization", "payment_reversal", "excess_transfer"];
24
+ export declare const toInvoicingTransactionTabId: (v: string) => "refund" | "payment" | "all" | "authorization" | "payment_reversal" | "excess_transfer";
25
25
  export type InvoicingTransactionTabId = ReturnType<typeof toInvoicingTransactionTabId>;
26
- /**
27
- * Ordered filter-tab id set owned by CES so the transaction-list tabs live next
28
- * to the model rather than being hardcoded in web-components. Tab labels and the
29
- * per-tab count lookup stay in the view layer; this only carries the id set and
30
- * display order.
31
- */
32
- export declare const INVOICING_TRANSACTION_TABS: InvoicingTransactionTabId[];
33
26
  /**
34
27
  * Per-tab cache slice. Each `type` tab is a separate server query (the backend
35
28
  * filters by `type`), so its loaded ids, pagination cursor and fetch state are
@@ -39,7 +32,12 @@ export interface InvoicingTransactionTabState extends FetchStateAndError {
39
32
  ids: ID[];
40
33
  nextCursor: string | null;
41
34
  }
42
- export type InvoicingTransactionIdsByTab = Record<InvoicingTransactionTabId, InvoicingTransactionTabState>;
35
+ /**
36
+ * Per-tab cache. `Partial` because the tab set comes from `/1.0/config`: a type
37
+ * the backend added that this build's tab-id union does not know still renders a
38
+ * tab, and its entry is created on first use rather than pre-seeded.
39
+ */
40
+ export type InvoicingTransactionIdsByTab = Partial<Record<InvoicingTransactionTabId, InvoicingTransactionTabState>>;
43
41
  export interface InvoicingTransactionListViewState {
44
42
  /** Selected type tab (CES-owned so it persists across page revisits). */
45
43
  activeTab: InvoicingTransactionTabId;
@@ -51,4 +49,6 @@ export interface InvoicingTransactionListViewState {
51
49
  sort?: InvoicingListSort;
52
50
  }
53
51
  export declare const makeInvoicingTransactionTabState: () => InvoicingTransactionTabState;
52
+ /** The cache entry for a tab, created on first use. */
53
+ export declare const invoicingTransactionTabStateFor: (byTab: InvoicingTransactionIdsByTab, tabId: InvoicingTransactionTabId) => InvoicingTransactionTabState;
54
54
  export declare const makeInvoicingTransactionIdsByTab: () => InvoicingTransactionIdsByTab;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeInvoicingTransactionIdsByTab = exports.makeInvoicingTransactionTabState = exports.INVOICING_TRANSACTION_TABS = exports.toInvoicingTransactionTabId = exports.ALL_INVOICING_TRANSACTION_TAB_IDS = exports.INVOICING_TRANSACTION_COLUMNS = exports.toInvoicingTransactionSortKey = exports.ALL_INVOICING_TRANSACTION_SORT_KEYS = void 0;
3
+ exports.makeInvoicingTransactionIdsByTab = exports.invoicingTransactionTabStateFor = exports.makeInvoicingTransactionTabState = exports.toInvoicingTransactionTabId = exports.ALL_INVOICING_TRANSACTION_TAB_IDS = exports.INVOICING_TRANSACTION_COLUMNS = exports.toInvoicingTransactionSortKey = exports.ALL_INVOICING_TRANSACTION_SORT_KEYS = void 0;
4
4
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
5
5
  exports.ALL_INVOICING_TRANSACTION_SORT_KEYS = [
6
6
  'transaction',
@@ -30,18 +30,10 @@ exports.ALL_INVOICING_TRANSACTION_TAB_IDS = [
30
30
  'refund',
31
31
  'authorization',
32
32
  'payment_reversal',
33
+ 'excess_transfer',
33
34
  ];
34
35
  const toInvoicingTransactionTabId = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_INVOICING_TRANSACTION_TAB_IDS);
35
36
  exports.toInvoicingTransactionTabId = toInvoicingTransactionTabId;
36
- /**
37
- * Ordered filter-tab id set owned by CES so the transaction-list tabs live next
38
- * to the model rather than being hardcoded in web-components. Tab labels and the
39
- * per-tab count lookup stay in the view layer; this only carries the id set and
40
- * display order.
41
- */
42
- exports.INVOICING_TRANSACTION_TABS = [
43
- ...exports.ALL_INVOICING_TRANSACTION_TAB_IDS,
44
- ];
45
37
  const makeInvoicingTransactionTabState = () => ({
46
38
  ids: [],
47
39
  nextCursor: null,
@@ -49,6 +41,17 @@ const makeInvoicingTransactionTabState = () => ({
49
41
  error: undefined,
50
42
  });
51
43
  exports.makeInvoicingTransactionTabState = makeInvoicingTransactionTabState;
44
+ /** The cache entry for a tab, created on first use. */
45
+ const invoicingTransactionTabStateFor = (byTab, tabId) => {
46
+ const existing = byTab[tabId];
47
+ if (existing != null) {
48
+ return existing;
49
+ }
50
+ const created = (0, exports.makeInvoicingTransactionTabState)();
51
+ byTab[tabId] = created;
52
+ return created;
53
+ };
54
+ exports.invoicingTransactionTabStateFor = invoicingTransactionTabStateFor;
52
55
  const makeInvoicingTransactionIdsByTab = () => exports.ALL_INVOICING_TRANSACTION_TAB_IDS.reduce((acc, tabId) => {
53
56
  acc[tabId] = (0, exports.makeInvoicingTransactionTabState)();
54
57
  return acc;
@@ -1,4 +1,2 @@
1
1
  import { IssueCreditNoteFormLocalData } from './issueCreditNoteState';
2
- export declare const INVOICING_CREDIT_NOTE_REASON_CODES: readonly ["service_credit", "billing_error", "duplicate_charge", "pricing_correction", "goodwill", "other"];
3
- export type InvoicingCreditNoteReasonCode = (typeof INVOICING_CREDIT_NOTE_REASON_CODES)[number];
4
2
  export declare const initialIssueCreditNoteFormLocalData: (invoiceId?: string) => IssueCreditNoteFormLocalData;
@@ -1,17 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initialIssueCreditNoteFormLocalData = exports.INVOICING_CREDIT_NOTE_REASON_CODES = void 0;
4
- exports.INVOICING_CREDIT_NOTE_REASON_CODES = [
5
- 'service_credit',
6
- 'billing_error',
7
- 'duplicate_charge',
8
- 'pricing_correction',
9
- 'goodwill',
10
- 'other',
11
- ];
3
+ exports.initialIssueCreditNoteFormLocalData = void 0;
12
4
  const initialIssueCreditNoteFormLocalData = (invoiceId = '') => ({
13
5
  invoiceId,
14
6
  lineItems: [],
15
7
  reasonCode: '',
8
+ type: '',
16
9
  });
17
10
  exports.initialIssueCreditNoteFormLocalData = initialIssueCreditNoteFormLocalData;
@@ -13,16 +13,16 @@ export interface IssueCreditNoteLineItemRequest {
13
13
  }
14
14
  export interface IssueCreditNoteRequest {
15
15
  line_items: IssueCreditNoteLineItemRequest[];
16
- type: 'adjustment';
17
16
  reason_code?: string;
17
+ type?: string;
18
18
  }
19
19
  export type IssueCreditNoteResponse = ZeniAPIResponse<InvoicingCreditNotePayload>;
20
20
  export type CreateCreditNoteRequest = {
21
21
  customer_id: string;
22
22
  line_items: IssueCreditNoteLineItemRequest[];
23
- type: 'adjustment';
24
23
  reason_code?: string;
25
24
  reference_invoice_id?: string;
25
+ type?: string;
26
26
  };
27
27
  export type CreateCreditNoteResponse = ZeniAPIResponse<InvoicingCreditNotePayload>;
28
28
  export declare const computeIssueCreditNoteTotal: (lineItems: IssueCreditNoteLineItemDraft[]) => number;
@@ -27,16 +27,20 @@ const localDataToIssueCreditNotePayload = (localData) => {
27
27
  };
28
28
  });
29
29
  const reasonCode = localData.reasonCode.trim();
30
+ // Optional-chained: a draft persisted before this field existed has no
31
+ // `type`, and the draft survives navigation.
32
+ const type = localData.type?.trim() ?? '';
30
33
  return {
31
34
  line_items: lineItems,
32
- type: 'adjustment',
33
35
  ...(reasonCode !== '' ? { reason_code: reasonCode } : {}),
36
+ ...(type !== '' ? { type } : {}),
34
37
  };
35
38
  };
36
39
  exports.localDataToIssueCreditNotePayload = localDataToIssueCreditNotePayload;
37
40
  const initializeIssueCreditNoteDraftFromInvoice = (invoice) => ({
38
41
  invoiceId: invoice.id,
39
42
  reasonCode: '',
43
+ type: '',
40
44
  lineItems: (invoice.lineItems ?? []).map((lineItem) => ({
41
45
  description: lineItem.description,
42
46
  id: lineItem.id,
@@ -1,6 +1,7 @@
1
1
  import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
2
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
3
  import { InvoicingInvoice } from '../../../entity/invoicing/invoice/invoiceState';
4
+ import { InvoicingNamedOption } from '../../../entity/invoicing/invoicingCommonPayload';
4
5
  import { RootState } from '../../../reducer';
5
6
  import { IssueCreditNoteFormLocalData } from './issueCreditNoteState';
6
7
  /**
@@ -16,8 +17,9 @@ export interface IssueCreditNoteView extends SelectorView {
16
17
  */
17
18
  isPageReady: boolean;
18
19
  localData: IssueCreditNoteFormLocalData;
19
- reasonCodeValues: string[];
20
+ reasonCodeOptions: InvoicingNamedOption[];
20
21
  submitState: FetchStateAndError;
22
+ typeOptions: InvoicingNamedOption[];
21
23
  invoice?: InvoicingInvoice;
22
24
  issuedCreditNoteId?: ID;
23
25
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getIssueCreditNoteView = void 0;
4
4
  const invoiceDetailSelector_1 = require("../invoiceDetail/invoiceDetailSelector");
5
+ const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
5
6
  const issueCreditNoteFormConfig_1 = require("./issueCreditNoteFormConfig");
6
7
  /**
7
8
  * The draft is a single global slice, so a draft seeded for a previously opened
@@ -13,6 +14,7 @@ const getIssueCreditNoteView = (state, invoiceId) => {
13
14
  const invoiceView = (0, invoiceDetailSelector_1.getInvoiceDetail)(state, invoiceId);
14
15
  const { draft, error, fetchState, issuedCreditNoteId } = state.invoicingIssueCreditNoteState;
15
16
  const isDraftForInvoice = draft.invoiceId === invoiceId;
17
+ const { creditNoteReasonCodeOptions, creditNoteTypeOptions } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
16
18
  return {
17
19
  invoice: invoiceView.invoice,
18
20
  isPageReady: invoiceView.fetchState === 'Completed' &&
@@ -22,8 +24,9 @@ const getIssueCreditNoteView = (state, invoiceId) => {
22
24
  localData: isDraftForInvoice
23
25
  ? draft
24
26
  : (0, issueCreditNoteFormConfig_1.initialIssueCreditNoteFormLocalData)(invoiceId),
25
- reasonCodeValues: [...issueCreditNoteFormConfig_1.INVOICING_CREDIT_NOTE_REASON_CODES],
27
+ reasonCodeOptions: creditNoteReasonCodeOptions,
26
28
  submitState: { error, fetchState },
29
+ typeOptions: creditNoteTypeOptions,
27
30
  error: invoiceView.error,
28
31
  fetchState: invoiceView.fetchState,
29
32
  version: 1.0,
@@ -13,6 +13,12 @@ export interface IssueCreditNoteFormLocalData {
13
13
  invoiceId: ID;
14
14
  lineItems: IssueCreditNoteLineItemDraft[];
15
15
  reasonCode: string;
16
+ /**
17
+ * Credit-note type code from `credit_note_type_options`. Empty until the user
18
+ * picks one; the payload then omits it and lets the backend default, rather
19
+ * than the client asserting `adjustment` for every credit note as it used to.
20
+ */
21
+ type: string;
16
22
  }
17
23
  export interface IssueCreditNoteState extends FetchedState {
18
24
  draft: IssueCreditNoteFormLocalData;
@@ -1,8 +1,2 @@
1
1
  import { RecordPaymentFormLocalData } from './recordPaymentState';
2
- /**
3
- * Canonical value sets for the Record Payment form. CES owns the values;
4
- * web-components maps each value to a localized label.
5
- */
6
- export declare const INVOICING_PAYMENT_METHOD_VALUES: readonly ["card", "cash", "check", "bank_transfer", "direct_debit", "paypal_express_checkout", "apple_pay", "google_pay", "ach_credit", "sepa_credit", "other"];
7
- export declare const INVOICING_PAYMENT_GATEWAY_VALUES: readonly ["stripe", "chargebee", "braintree", "paypal", "adyen", "razorpay", "other"];
8
2
  export declare const initialRecordPaymentFormLocalData: RecordPaymentFormLocalData;
@@ -1,32 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initialRecordPaymentFormLocalData = exports.INVOICING_PAYMENT_GATEWAY_VALUES = exports.INVOICING_PAYMENT_METHOD_VALUES = void 0;
4
- /**
5
- * Canonical value sets for the Record Payment form. CES owns the values;
6
- * web-components maps each value to a localized label.
7
- */
8
- exports.INVOICING_PAYMENT_METHOD_VALUES = [
9
- 'card',
10
- 'cash',
11
- 'check',
12
- 'bank_transfer',
13
- 'direct_debit',
14
- 'paypal_express_checkout',
15
- 'apple_pay',
16
- 'google_pay',
17
- 'ach_credit',
18
- 'sepa_credit',
19
- 'other',
20
- ];
21
- exports.INVOICING_PAYMENT_GATEWAY_VALUES = [
22
- 'stripe',
23
- 'chargebee',
24
- 'braintree',
25
- 'paypal',
26
- 'adyen',
27
- 'razorpay',
28
- 'other',
29
- ];
3
+ exports.initialRecordPaymentFormLocalData = void 0;
30
4
  exports.initialRecordPaymentFormLocalData = {
31
5
  comment: '',
32
6
  customerId: '',
@@ -1,5 +1,6 @@
1
1
  import { ID } from '../../../commonStateTypes/common';
2
2
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
+ import { InvoicingNamedOption } from '../../../entity/invoicing/invoicingCommonPayload';
3
4
  import { RootState } from '../../../reducer';
4
5
  import { RecordPaymentFormLocalData } from './recordPaymentState';
5
6
  export interface InvoicingRecordPaymentView extends SelectorView {
@@ -16,9 +17,9 @@ export declare const getRecordPaymentView: (state: RootState) => InvoicingRecord
16
17
  * CES-owned payment-method / gateway value sets, and the submit fetch state.
17
18
  */
18
19
  export interface RecordPaymentFormView extends SelectorView {
19
- gatewayValues: string[];
20
+ gatewayOptions: InvoicingNamedOption[];
20
21
  localData: RecordPaymentFormLocalData;
21
- paymentMethodValues: string[];
22
+ paymentMethodOptions: InvoicingNamedOption[];
22
23
  contextInvoiceId?: ID;
23
24
  }
24
25
  export declare const getRecordPaymentFormView: (state: RootState) => RecordPaymentFormView;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRecordPaymentInvoiceOptions = exports.getRecordPaymentFormView = exports.getRecordPaymentView = void 0;
4
+ const invoicingCommonPayload_1 = require("../../../entity/invoicing/invoicingCommonPayload");
4
5
  const invoiceListSelector_1 = require("../invoiceList/invoiceListSelector");
5
- const recordPaymentFormConfig_1 = require("./recordPaymentFormConfig");
6
+ const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
6
7
  /**
7
8
  * Single bundled view for the record-payment submit lifecycle — carries the
8
9
  * submit fetch state/error and the ids produced on success.
@@ -20,22 +21,40 @@ const getRecordPaymentView = (state) => {
20
21
  exports.getRecordPaymentView = getRecordPaymentView;
21
22
  const getRecordPaymentFormView = (state) => {
22
23
  const { contextInvoiceId, error, fetchState, newPaymentDraft } = state.invoicingRecordPaymentState;
24
+ const { manualPaymentMethodOptions, paymentGatewayOptions } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
23
25
  return {
24
26
  contextInvoiceId,
25
- gatewayValues: [...recordPaymentFormConfig_1.INVOICING_PAYMENT_GATEWAY_VALUES],
27
+ gatewayOptions: paymentGatewayOptions,
26
28
  localData: newPaymentDraft,
27
- paymentMethodValues: [...recordPaymentFormConfig_1.INVOICING_PAYMENT_METHOD_VALUES],
29
+ paymentMethodOptions: manualPaymentMethodOptions,
28
30
  fetchState,
29
31
  error,
30
32
  version: 1.0,
31
33
  };
32
34
  };
33
35
  exports.getRecordPaymentFormView = getRecordPaymentFormView;
34
- const UNPAID_INVOICE_STATUSES = new Set([
36
+ /**
37
+ * Statuses that leave nothing to collect. Kept FE-local and expressed as an
38
+ * exclusion so that "unpaid" is derived from the config status list rather than
39
+ * an allowlist: a status the backend adds later counts as collectable and shows
40
+ * up in the picker instead of silently disappearing from it.
41
+ */
42
+ const SETTLED_INVOICE_STATUSES = new Set([
43
+ 'paid',
44
+ 'voided',
45
+ ]);
46
+ /** Fallback while `/1.0/config` has not landed, so the picker is never empty. */
47
+ const FALLBACK_UNPAID_INVOICE_STATUSES = [
35
48
  'not_paid',
36
49
  'partially_paid',
37
50
  'payment_due',
38
- ]);
51
+ ];
52
+ const unpaidInvoiceStatuses = (invoiceStatusOptions) => {
53
+ if (invoiceStatusOptions.length === 0) {
54
+ return new Set(FALLBACK_UNPAID_INVOICE_STATUSES);
55
+ }
56
+ return new Set((0, invoicingCommonPayload_1.invoicingOptionCodes)(invoiceStatusOptions).filter((code) => !SETTLED_INVOICE_STATUSES.has(code)));
57
+ };
39
58
  const getRecordPaymentInvoiceOptions = (state, customerId) => {
40
59
  if (customerId === '') {
41
60
  return [];
@@ -44,8 +63,9 @@ const getRecordPaymentInvoiceOptions = (state, customerId) => {
44
63
  if (listView.filters.customerId !== customerId) {
45
64
  return [];
46
65
  }
66
+ const collectableStatuses = unpaidInvoiceStatuses((0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state).invoiceStatusOptions);
47
67
  return listView.invoices
48
- .filter((invoice) => UNPAID_INVOICE_STATUSES.has(invoice.status))
68
+ .filter((invoice) => collectableStatuses.has(invoice.status))
49
69
  .filter((invoice) => (invoice.amountDue?.amount ?? 0) > 0)
50
70
  .map((invoice) => ({
51
71
  amountDue: invoice.amountDue?.amount ?? 0,
@@ -1,5 +1,5 @@
1
1
  import { FetchState, FetchStateAndError } from '../../../commonStateTypes/common';
2
- import { InvoicingNamedOption, InvoicingQboAccountMappingKindOption, InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
2
+ import { InvoicingDunningActionOption, InvoicingNamedOption, InvoicingQboAccountMappingKindOption, InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
3
3
  import { RootState } from '../../../reducer';
4
4
  import { ZeniAPIStatus } from '../../../responsePayload';
5
5
  import { InvoicingBrandingFormLocalData } from './invoicingBrandingFormConfig';
@@ -46,9 +46,20 @@ export interface InvoicingEnablePrerequisites {
46
46
  export declare function deriveInvoicingEnablePrerequisites(settings: InvoicingSettingsPayload | undefined, isQboConnected: boolean, qboAccountMappingKindOptions: InvoicingQboAccountMappingKindOption[]): InvoicingEnablePrerequisites;
47
47
  export interface InvoicingSettingsHubView {
48
48
  canEnableInvoicing: boolean;
49
+ /**
50
+ * Config-owned lists and fetch state the settings hub renders, folded in so the
51
+ * screen reads this view instead of `getInvoicingConfigView`.
52
+ */
53
+ configFetchState: FetchState;
54
+ dunningScheduleActionOptions: InvoicingDunningActionOption[];
49
55
  isEnablingInvoicing: boolean;
50
56
  isQboConfigured: boolean;
51
57
  isStripeConnected: boolean;
58
+ qboAccountMappingKindOptions: InvoicingQboAccountMappingKindOption[];
59
+ qboCustomerMatchingOptions: InvoicingNamedOption[];
60
+ qboSyncStatusOptions: InvoicingNamedOption[];
61
+ status: string | undefined;
62
+ configError?: ZeniAPIStatus;
52
63
  }
53
64
  /**
54
65
  * The settings hub's composite of everything it derives from the store: whether
@@ -79,13 +79,20 @@ function deriveInvoicingEnablePrerequisites(settings, isQboConnected, qboAccount
79
79
  * and QBO slices read here are only fetched once a settings screen is mounted.
80
80
  */
81
81
  const getInvoicingSettingsHubView = (state) => {
82
- const { enableState, qboAccountMappingKindOptions, status } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
82
+ const { dunningScheduleActionOptions, enableState, error: configError, fetchState: configFetchState, qboAccountMappingKindOptions, qboCustomerMatchingOptions, qboSyncStatusOptions, status, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
83
83
  const { canEnable, isQboConfigured, isStripeConnected } = deriveInvoicingEnablePrerequisites(state.invoicingSettingsViewState.settings, state.invoicingQboViewState.connection?.connected === true, qboAccountMappingKindOptions);
84
84
  return {
85
85
  canEnableInvoicing: status === 'settings' && canEnable,
86
+ configError,
87
+ configFetchState,
88
+ dunningScheduleActionOptions,
86
89
  isEnablingInvoicing: enableState.fetchState === 'In-Progress',
90
+ qboAccountMappingKindOptions,
91
+ qboCustomerMatchingOptions,
92
+ qboSyncStatusOptions,
87
93
  isQboConfigured,
88
94
  isStripeConnected,
95
+ status,
89
96
  };
90
97
  };
91
98
  exports.getInvoicingSettingsHubView = getInvoicingSettingsHubView;
@@ -15,6 +15,6 @@ export declare const fetchTreasuryFunds: import("@reduxjs/toolkit").ActionCreato
15
15
  }, "treasurySetupView/updatePortfolioAllocation", never, never>, updatePortfolioAllocationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdatePortfolioAllocationPayload, "treasurySetupView/updatePortfolioAllocationSuccess">, updatePortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updatePortfolioAllocationFailure", never, never>, fetchPortfolioAllocation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/fetchPortfolioAllocation">, fetchPortfolioAllocationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
16
16
  allocation_percentages: Record<string, number>;
17
17
  custom_corporate_id: string | null;
18
- }, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData">, updateTreasuryPromoIntroClosedByOutsideClick: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryPromoIntroClosedByOutsideClick">, updateTreasuryPromoIntroClosedByOutsideClickFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updateTreasuryPromoIntroClosedByOutsideClickFailure">, updateTreasuryPromoIntroClosedByOutsideClickSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryPromoIntroClosedByOutsideClickSuccess">, updateTreasuryPromoRemindMeLaterClicked: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryPromoRemindMeLaterClicked">, updateTreasuryPromoRemindMeLaterClickedFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updateTreasuryPromoRemindMeLaterClickedFailure">, updateTreasuryPromoRemindMeLaterClickedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryPromoRemindMeLaterClickedSuccess">, updateTreasuryVideoViewed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryVideoViewed">, updateTreasuryVideoViewedFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updateTreasuryVideoViewedFailure">, updateTreasuryVideoViewedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryVideoViewedSuccess">;
18
+ }, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData">;
19
19
  declare const _default: import("redux").Reducer<TreasurySetupViewState>;
20
20
  export default _default;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  var _a;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.updateTreasuryVideoViewedSuccess = exports.updateTreasuryVideoViewedFailure = exports.updateTreasuryVideoViewed = exports.updateTreasuryPromoRemindMeLaterClickedSuccess = exports.updateTreasuryPromoRemindMeLaterClickedFailure = exports.updateTreasuryPromoRemindMeLaterClicked = exports.updateTreasuryPromoIntroClosedByOutsideClickSuccess = exports.updateTreasuryPromoIntroClosedByOutsideClickFailure = exports.updateTreasuryPromoIntroClosedByOutsideClick = exports.updateFundAllocationLocalData = exports.fetchPortfolioAllocationFailure = exports.fetchPortfolioAllocationSuccess = exports.fetchPortfolioAllocation = exports.updatePortfolioAllocationFailure = exports.updatePortfolioAllocationSuccess = exports.updatePortfolioAllocation = exports.updateTreasuryFundsFailure = exports.updateTreasuryFundsSuccess = exports.clearTreasurySetupView = exports.acceptTreasuryTermsFailure = exports.acceptTreasuryTermsSuccess = exports.acceptTreasuryTerms = exports.fetchTreasurySetupViewFailure = exports.fetchTreasurySetupViewSuccess = exports.fetchTreasurySetupView = exports.fetchTreasuryFunds = exports.initialState = void 0;
7
+ exports.updateFundAllocationLocalData = exports.fetchPortfolioAllocationFailure = exports.fetchPortfolioAllocationSuccess = exports.fetchPortfolioAllocation = exports.updatePortfolioAllocationFailure = exports.updatePortfolioAllocationSuccess = exports.updatePortfolioAllocation = exports.updateTreasuryFundsFailure = exports.updateTreasuryFundsSuccess = exports.clearTreasurySetupView = exports.acceptTreasuryTermsFailure = exports.acceptTreasuryTermsSuccess = exports.acceptTreasuryTerms = exports.fetchTreasurySetupViewFailure = exports.fetchTreasurySetupViewSuccess = exports.fetchTreasurySetupView = exports.fetchTreasuryFunds = exports.initialState = void 0;
8
8
  const toolkit_1 = require("@reduxjs/toolkit");
9
9
  const isEqual_1 = __importDefault(require("lodash/isEqual"));
10
10
  const rootActions_1 = require("../../../../rootActions");
@@ -41,18 +41,6 @@ exports.initialState = {
41
41
  fetchState: 'Not-Started',
42
42
  error: undefined,
43
43
  },
44
- updateTreasuryPromoIntroClosedByOutsideClickStatus: {
45
- fetchState: 'Not-Started',
46
- error: undefined,
47
- },
48
- updateTreasuryPromoRemindMeLaterClickedStatus: {
49
- fetchState: 'Not-Started',
50
- error: undefined,
51
- },
52
- updateTreasuryVideoViewedStatus: {
53
- fetchState: 'Not-Started',
54
- error: undefined,
55
- },
56
44
  hasValidState() {
57
45
  return this.fetchState === 'Completed';
58
46
  },
@@ -288,60 +276,6 @@ const treasurySetupView = (0, toolkit_1.createSlice)({
288
276
  updateFundAllocationLocalData(draft, action) {
289
277
  draft.fundAllocationLocalData = action.payload;
290
278
  },
291
- updateTreasuryVideoViewed(draft) {
292
- draft.updateTreasuryVideoViewedStatus = {
293
- fetchState: 'In-Progress',
294
- error: undefined,
295
- };
296
- },
297
- updateTreasuryVideoViewedSuccess(draft) {
298
- draft.updateTreasuryVideoViewedStatus = {
299
- fetchState: 'Completed',
300
- error: undefined,
301
- };
302
- },
303
- updateTreasuryVideoViewedFailure(draft, action) {
304
- draft.updateTreasuryVideoViewedStatus = {
305
- fetchState: 'Error',
306
- error: action.payload,
307
- };
308
- },
309
- updateTreasuryPromoRemindMeLaterClicked(draft) {
310
- draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
311
- fetchState: 'In-Progress',
312
- error: undefined,
313
- };
314
- },
315
- updateTreasuryPromoRemindMeLaterClickedSuccess(draft) {
316
- draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
317
- fetchState: 'Completed',
318
- error: undefined,
319
- };
320
- },
321
- updateTreasuryPromoRemindMeLaterClickedFailure(draft, action) {
322
- draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
323
- fetchState: 'Error',
324
- error: action.payload,
325
- };
326
- },
327
- updateTreasuryPromoIntroClosedByOutsideClick(draft) {
328
- draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
329
- fetchState: 'In-Progress',
330
- error: undefined,
331
- };
332
- },
333
- updateTreasuryPromoIntroClosedByOutsideClickSuccess(draft) {
334
- draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
335
- fetchState: 'Completed',
336
- error: undefined,
337
- };
338
- },
339
- updateTreasuryPromoIntroClosedByOutsideClickFailure(draft, action) {
340
- draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
341
- fetchState: 'Error',
342
- error: action.payload,
343
- };
344
- },
345
279
  clearTreasurySetupView(draft) {
346
280
  Object.assign(draft, exports.initialState);
347
281
  },
@@ -352,7 +286,7 @@ const treasurySetupView = (0, toolkit_1.createSlice)({
352
286
  });
353
287
  },
354
288
  });
355
- _a = treasurySetupView.actions, exports.fetchTreasuryFunds = _a.fetchTreasuryFunds, exports.fetchTreasurySetupView = _a.fetchTreasurySetupView, exports.fetchTreasurySetupViewSuccess = _a.fetchTreasurySetupViewSuccess, exports.fetchTreasurySetupViewFailure = _a.fetchTreasurySetupViewFailure, exports.acceptTreasuryTerms = _a.acceptTreasuryTerms, exports.acceptTreasuryTermsSuccess = _a.acceptTreasuryTermsSuccess, exports.acceptTreasuryTermsFailure = _a.acceptTreasuryTermsFailure, exports.clearTreasurySetupView = _a.clearTreasurySetupView, exports.updateTreasuryFundsSuccess = _a.updateTreasuryFundsSuccess, exports.updateTreasuryFundsFailure = _a.updateTreasuryFundsFailure, exports.updatePortfolioAllocation = _a.updatePortfolioAllocation, exports.updatePortfolioAllocationSuccess = _a.updatePortfolioAllocationSuccess, exports.updatePortfolioAllocationFailure = _a.updatePortfolioAllocationFailure, exports.fetchPortfolioAllocation = _a.fetchPortfolioAllocation, exports.fetchPortfolioAllocationSuccess = _a.fetchPortfolioAllocationSuccess, exports.fetchPortfolioAllocationFailure = _a.fetchPortfolioAllocationFailure, exports.updateFundAllocationLocalData = _a.updateFundAllocationLocalData, exports.updateTreasuryPromoIntroClosedByOutsideClick = _a.updateTreasuryPromoIntroClosedByOutsideClick, exports.updateTreasuryPromoIntroClosedByOutsideClickFailure = _a.updateTreasuryPromoIntroClosedByOutsideClickFailure, exports.updateTreasuryPromoIntroClosedByOutsideClickSuccess = _a.updateTreasuryPromoIntroClosedByOutsideClickSuccess, exports.updateTreasuryPromoRemindMeLaterClicked = _a.updateTreasuryPromoRemindMeLaterClicked, exports.updateTreasuryPromoRemindMeLaterClickedFailure = _a.updateTreasuryPromoRemindMeLaterClickedFailure, exports.updateTreasuryPromoRemindMeLaterClickedSuccess = _a.updateTreasuryPromoRemindMeLaterClickedSuccess, exports.updateTreasuryVideoViewed = _a.updateTreasuryVideoViewed, exports.updateTreasuryVideoViewedFailure = _a.updateTreasuryVideoViewedFailure, exports.updateTreasuryVideoViewedSuccess = _a.updateTreasuryVideoViewedSuccess;
289
+ _a = treasurySetupView.actions, exports.fetchTreasuryFunds = _a.fetchTreasuryFunds, exports.fetchTreasurySetupView = _a.fetchTreasurySetupView, exports.fetchTreasurySetupViewSuccess = _a.fetchTreasurySetupViewSuccess, exports.fetchTreasurySetupViewFailure = _a.fetchTreasurySetupViewFailure, exports.acceptTreasuryTerms = _a.acceptTreasuryTerms, exports.acceptTreasuryTermsSuccess = _a.acceptTreasuryTermsSuccess, exports.acceptTreasuryTermsFailure = _a.acceptTreasuryTermsFailure, exports.clearTreasurySetupView = _a.clearTreasurySetupView, exports.updateTreasuryFundsSuccess = _a.updateTreasuryFundsSuccess, exports.updateTreasuryFundsFailure = _a.updateTreasuryFundsFailure, exports.updatePortfolioAllocation = _a.updatePortfolioAllocation, exports.updatePortfolioAllocationSuccess = _a.updatePortfolioAllocationSuccess, exports.updatePortfolioAllocationFailure = _a.updatePortfolioAllocationFailure, exports.fetchPortfolioAllocation = _a.fetchPortfolioAllocation, exports.fetchPortfolioAllocationSuccess = _a.fetchPortfolioAllocationSuccess, exports.fetchPortfolioAllocationFailure = _a.fetchPortfolioAllocationFailure, exports.updateFundAllocationLocalData = _a.updateFundAllocationLocalData;
356
290
  exports.default = treasurySetupView.reducer;
357
291
  function mapTreasuryFundsPayloadToFundData(fundsPayload) {
358
292
  return fundsPayload.funds.map((fund) => ({
@@ -16,9 +16,6 @@ export interface TreasurySetupViewState extends FetchedState {
16
16
  fundAllocationOptions: FundAllocationOption[];
17
17
  fundsDetails: FundData[];
18
18
  };
19
- updateTreasuryPromoIntroClosedByOutsideClickStatus: FetchStateAndError;
20
- updateTreasuryPromoRemindMeLaterClickedStatus: FetchStateAndError;
21
- updateTreasuryVideoViewedStatus: FetchStateAndError;
22
19
  treasuryTermsDetails?: {
23
20
  fetchStatus: FetchStateAndError;
24
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.97",
3
+ "version": "5.1.99",
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
  "module": "lib/esm/index.js",
@@ -1,11 +0,0 @@
1
- import { InvoicingFormOption } from '../invoicingCommonPayload';
2
- import { InvoicingCouponApplyOn, InvoicingCouponDurationType, InvoicingCouponPeriodUnit, InvoicingDiscountType } from './couponPayload';
3
- /**
4
- * Coupon form select options. Single source of truth (CES-owned) for the value
5
- * sets that back the coupon's string-union domain fields; surfaced to the form
6
- * via `getInvoicingCouponFormView` so web-components need not hardcode them.
7
- */
8
- export declare const INVOICING_DISCOUNT_TYPE_OPTIONS: readonly InvoicingFormOption<InvoicingDiscountType>[];
9
- export declare const INVOICING_COUPON_DURATION_TYPE_OPTIONS: readonly InvoicingFormOption<InvoicingCouponDurationType>[];
10
- export declare const INVOICING_COUPON_PERIOD_UNIT_OPTIONS: readonly InvoicingFormOption<InvoicingCouponPeriodUnit>[];
11
- export declare const INVOICING_COUPON_APPLY_ON_OPTIONS: readonly InvoicingFormOption<InvoicingCouponApplyOn>[];
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INVOICING_COUPON_APPLY_ON_OPTIONS = exports.INVOICING_COUPON_PERIOD_UNIT_OPTIONS = exports.INVOICING_COUPON_DURATION_TYPE_OPTIONS = exports.INVOICING_DISCOUNT_TYPE_OPTIONS = void 0;
4
- /**
5
- * Coupon form select options. Single source of truth (CES-owned) for the value
6
- * sets that back the coupon's string-union domain fields; surfaced to the form
7
- * via `getInvoicingCouponFormView` so web-components need not hardcode them.
8
- */
9
- exports.INVOICING_DISCOUNT_TYPE_OPTIONS = [
10
- { label: 'Percentage', value: 'percentage' },
11
- { label: 'Fixed amount', value: 'fixed_amount' },
12
- { label: 'Offer quantity', value: 'offer_quantity' },
13
- ];
14
- exports.INVOICING_COUPON_DURATION_TYPE_OPTIONS = [
15
- { label: 'One time', value: 'one_time' },
16
- { label: 'Forever', value: 'forever' },
17
- { label: 'Limited period', value: 'limited_period' },
18
- ];
19
- exports.INVOICING_COUPON_PERIOD_UNIT_OPTIONS = [
20
- { label: 'Day', value: 'day' },
21
- { label: 'Week', value: 'week' },
22
- { label: 'Month', value: 'month' },
23
- { label: 'Year', value: 'year' },
24
- ];
25
- exports.INVOICING_COUPON_APPLY_ON_OPTIONS = [
26
- { label: 'Invoice amount', value: 'invoice_amount' },
27
- { label: 'Each specified item', value: 'each_specified_item' },
28
- { label: 'Specified items total', value: 'specified_items_total' },
29
- ];