@zeniai/client-epic-state 5.2.71 → 5.2.72-beta0ND

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 (129) hide show
  1. package/lib/entity/aiCfo/aiCfoState.d.ts +2 -2
  2. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  3. package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
  4. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  5. package/lib/entity/invoicing/{product/productPayload.d.ts → invoicingCatalog/invoicingCatalogPayload.d.ts} +44 -6
  6. package/lib/entity/invoicing/{product/productPayload.js → invoicingCatalog/invoicingCatalogPayload.js} +50 -6
  7. package/lib/entity/invoicing/invoicingCatalog/invoicingCatalogReducer.d.ts +12 -0
  8. package/lib/entity/invoicing/{plan/planReducer.js → invoicingCatalog/invoicingCatalogReducer.js} +20 -21
  9. package/lib/entity/invoicing/{plan/planSelector.d.ts → invoicingCatalog/invoicingCatalogSelector.d.ts} +5 -6
  10. package/lib/entity/invoicing/{plan/planSelector.js → invoicingCatalog/invoicingCatalogSelector.js} +12 -12
  11. package/lib/entity/invoicing/{product/productState.d.ts → invoicingCatalog/invoicingCatalogState.d.ts} +42 -6
  12. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +4 -4
  13. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  14. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  15. package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +10 -2
  16. package/lib/epic.d.ts +3 -2
  17. package/lib/epic.js +3 -1
  18. package/lib/esm/entity/invoicing/{product/productPayload.js → invoicingCatalog/invoicingCatalogPayload.js} +46 -3
  19. package/lib/esm/entity/invoicing/{plan/planReducer.js → invoicingCatalog/invoicingCatalogReducer.js} +19 -20
  20. package/lib/esm/entity/invoicing/{plan/planSelector.js → invoicingCatalog/invoicingCatalogSelector.js} +8 -8
  21. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  22. package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +10 -2
  23. package/lib/esm/epic.js +3 -1
  24. package/lib/esm/index.js +6 -9
  25. package/lib/esm/reducer.js +4 -7
  26. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -1
  27. package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +9 -1
  28. package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +1 -1
  29. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +5 -3
  30. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.js +2 -2
  31. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.js +2 -2
  32. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
  33. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +3 -7
  34. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
  35. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +5 -1
  36. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +27 -1
  37. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +5 -1
  38. package/lib/esm/view/invoicing/invoiceList/invoiceListReducer.js +8 -1
  39. package/lib/esm/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js +2 -2
  40. package/lib/esm/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js +2 -2
  41. package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +55 -22
  42. package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.js +1 -20
  43. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +33 -13
  44. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +2 -1
  45. package/lib/esm/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +37 -0
  46. package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +21 -1
  47. package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +2 -1
  48. package/lib/index.d.ts +11 -15
  49. package/lib/index.js +39 -45
  50. package/lib/reducer.d.ts +1 -2
  51. package/lib/reducer.js +4 -7
  52. package/lib/rootStateTypes.d.ts +3 -5
  53. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  54. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -1
  55. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  56. package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +3 -2
  57. package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +8 -0
  58. package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +2 -2
  59. package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +2 -2
  60. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +8 -9
  61. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +2 -2
  62. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +5 -3
  63. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.d.ts +2 -2
  64. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/fetchInvoicingCatalogItemDetailEpic.js +2 -2
  65. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper.d.ts +3 -4
  66. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.d.ts +2 -2
  67. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogPlanActionEpic.js +2 -2
  68. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.d.ts +2 -3
  69. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/runInvoicingCatalogProductActionEpic.js +4 -4
  70. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +2 -3
  71. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +3 -7
  72. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +2 -2
  73. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +3 -1
  74. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +6 -2
  75. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +3 -2
  76. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +29 -2
  77. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +3 -1
  78. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +5 -1
  79. package/lib/view/invoicing/invoiceList/invoiceListReducer.d.ts +3 -1
  80. package/lib/view/invoicing/invoiceList/invoiceListReducer.js +9 -2
  81. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogListPageEpic.d.ts +2 -2
  82. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.d.ts +2 -2
  83. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogPlanListEpic.js +2 -2
  84. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.d.ts +2 -2
  85. package/lib/view/invoicing/invoicingCatalogListView/epics/fetchInvoicingCatalogProductListEpic.js +2 -2
  86. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewPayload.d.ts +3 -3
  87. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +33 -15
  88. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +57 -23
  89. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.d.ts +0 -15
  90. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.js +0 -22
  91. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
  92. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +1 -1
  93. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts +1 -1
  94. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +1 -1
  95. package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +33 -13
  96. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +3 -2
  97. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +2 -1
  98. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +4 -0
  99. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  100. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +5 -5
  101. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  102. package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +2 -2
  103. package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.d.ts +8 -0
  104. package/lib/view/spendManagement/commonSetup/epic/setup/resetKycKybEpic.js +41 -0
  105. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +1 -1
  106. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +22 -2
  107. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +1 -0
  108. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -1
  109. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +1 -0
  110. package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +2 -1
  111. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.d.ts +2 -2
  112. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +5 -5
  113. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +2 -2
  114. package/package.json +1 -26
  115. package/lib/entity/invoicing/plan/planPayload.d.ts +0 -40
  116. package/lib/entity/invoicing/plan/planPayload.js +0 -51
  117. package/lib/entity/invoicing/plan/planReducer.d.ts +0 -14
  118. package/lib/entity/invoicing/plan/planState.d.ts +0 -43
  119. package/lib/entity/invoicing/product/productReducer.d.ts +0 -9
  120. package/lib/entity/invoicing/product/productReducer.js +0 -50
  121. package/lib/entity/invoicing/product/productSelector.d.ts +0 -4
  122. package/lib/entity/invoicing/product/productSelector.js +0 -17
  123. package/lib/entity/invoicing/product/productState.js +0 -2
  124. package/lib/esm/entity/invoicing/plan/planPayload.js +0 -47
  125. package/lib/esm/entity/invoicing/product/productReducer.js +0 -43
  126. package/lib/esm/entity/invoicing/product/productSelector.js +0 -10
  127. package/lib/esm/entity/invoicing/product/productState.js +0 -1
  128. /package/lib/entity/invoicing/{plan/planState.js → invoicingCatalog/invoicingCatalogState.js} +0 -0
  129. /package/lib/esm/entity/invoicing/{plan/planState.js → invoicingCatalog/invoicingCatalogState.js} +0 -0
@@ -1,47 +0,0 @@
1
- import { toAmount } from '../../../commonStateTypes/amount';
2
- import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelper';
3
- import { date } from '../../../zeniDayJS';
4
- import { mapInvoicingPlanTierPayloadToState, mapInvoicingProductPayloadToState, } from '../product/productPayload';
5
- // ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
6
- export const mapInvoicingPlanPayloadToState = (payload) => {
7
- const currencyCode = payload.currency_code ?? defaultCustomerCurrency.currencyCode;
8
- const currencySymbol = payload.currency_symbol ?? defaultCustomerCurrency.currencySymbol;
9
- return {
10
- id: payload.id,
11
- applicableItems: payload.applicable_items,
12
- archivedAt: payload.archived_at != null ? date(payload.archived_at) : undefined,
13
- billingCycles: payload.billing_cycles,
14
- createdAt: payload.created_at != null ? date(payload.created_at) : undefined,
15
- currencyCode: payload.currency_code,
16
- description: payload.description,
17
- enabledForCheckout: payload.enabled_for_checkout,
18
- enabledInPortal: payload.enabled_in_portal,
19
- externalId: payload.external_id,
20
- externalName: payload.external_name,
21
- giftClaimRedirectUrl: payload.gift_claim_redirect_url,
22
- includedInMrr: payload.included_in_mrr,
23
- isGiftable: payload.is_giftable,
24
- isShippable: payload.is_shippable,
25
- itemApplicability: payload.item_applicability,
26
- itemFamilyID: payload.item_family_id,
27
- itemType: payload.item_type,
28
- metadata: payload.metadata,
29
- metered: payload.metered,
30
- name: payload.name,
31
- period: payload.period,
32
- periodUnit: payload.period_unit,
33
- productCode: payload.product_code,
34
- price: payload.price != null
35
- ? toAmount(payload.price, currencyCode, currencySymbol)
36
- : undefined,
37
- subFamilies: payload.sub_families?.map(mapInvoicingProductPayloadToState),
38
- status: payload.status,
39
- tiers: payload.tiers?.map((tier) => mapInvoicingPlanTierPayloadToState(tier, currencyCode, currencySymbol)),
40
- trialPeriod: payload.trial_period,
41
- trialPeriodUnit: payload.trial_period_unit,
42
- type: payload.type,
43
- unit: payload.unit,
44
- updatedAt: payload.updated_at != null ? date(payload.updated_at) : undefined,
45
- usageCalculation: payload.usage_calculation,
46
- };
47
- };
@@ -1,43 +0,0 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
- import assignWith from 'lodash/assignWith';
3
- import { clearAll } from '../../../rootActions';
4
- import { mapInvoicingProductPayloadToState, } from './productPayload';
5
- export const initialState = { productByID: {} };
6
- const product = createSlice({
7
- name: 'invoicingProduct',
8
- initialState,
9
- reducers: {
10
- updateInvoicingProducts: {
11
- reducer(draft, action) {
12
- doUpdateInvoicingProducts(draft.productByID, action.payload, action.meta.updateType);
13
- },
14
- prepare(payload, updateType = 'replace') {
15
- return { payload, meta: { updateType } };
16
- },
17
- },
18
- removeInvoicingProduct(draft, action) {
19
- delete draft.productByID[action.payload];
20
- },
21
- },
22
- extraReducers: (builder) => {
23
- builder.addCase(clearAll, (draft) => {
24
- Object.assign(draft, initialState);
25
- });
26
- },
27
- });
28
- export const { updateInvoicingProducts, removeInvoicingProduct } = product.actions;
29
- export default product.reducer;
30
- /**
31
- * Helper functions.
32
- */
33
- function doUpdateInvoicingProducts(draft, payload, updateType) {
34
- payload.forEach((productPayload) => {
35
- const latestProduct = mapInvoicingProductPayloadToState(productPayload);
36
- if (latestProduct.id in draft && updateType === 'merge') {
37
- assignWith(draft[latestProduct.id], latestProduct, (objValue, srcValue) => (srcValue == null ? objValue : srcValue));
38
- }
39
- else {
40
- draft[latestProduct.id] = latestProduct;
41
- }
42
- });
43
- }
@@ -1,10 +0,0 @@
1
- import recordGet from 'lodash/get';
2
- export function getInvoicingProductsByIds(productState, ids) {
3
- const products = ids
4
- .map((id) => getInvoicingProductById(productState, id))
5
- .filter((value) => value != null);
6
- return products;
7
- }
8
- export function getInvoicingProductById(productState, id) {
9
- return recordGet(productState.productByID, id);
10
- }
@@ -1 +0,0 @@
1
- export {};