@zeniai/client-epic-state 5.1.98 → 5.2.0

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 (150) hide show
  1. package/lib/commonStateTypes/accountView/nestedAccountID.d.ts +0 -3
  2. package/lib/commonStateTypes/accountView/nestedAccountID.js +1 -4
  3. package/lib/commonStateTypes/coaBalance/coaBalance.d.ts +0 -5
  4. package/lib/commonStateTypes/timePeriod.d.ts +0 -2
  5. package/lib/commonStateTypes/timePeriod.js +1 -6
  6. package/lib/entity/invoicing/invoicingCommonPayload.d.ts +12 -0
  7. package/lib/entity/invoicing/invoicingCommonPayload.js +18 -0
  8. package/lib/entity/invoicing/invoicingTransaction/invoicingTransactionPayload.d.ts +1 -1
  9. package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +0 -1
  10. package/lib/entity/toastNotification/epic/pushToastNotificationEpic.js +0 -1
  11. package/lib/entity/transaction/toSupportedTransaction.d.ts +1 -1
  12. package/lib/entity/transaction/toSupportedTransaction.js +0 -1
  13. package/lib/esm/commonStateTypes/accountView/nestedAccountID.js +0 -3
  14. package/lib/esm/commonStateTypes/timePeriod.js +0 -4
  15. package/lib/esm/entity/invoicing/invoicingCommonPayload.js +16 -0
  16. package/lib/esm/entity/toastNotification/epic/pushToastNotificationEpic.js +0 -1
  17. package/lib/esm/entity/transaction/toSupportedTransaction.js +1 -1
  18. package/lib/esm/index.js +12 -11
  19. package/lib/esm/view/invoicing/auditView/auditViewSelector.js +4 -0
  20. package/lib/esm/view/invoicing/couponView/couponViewSelector.js +18 -8
  21. package/lib/esm/view/invoicing/couponView/couponViewState.js +0 -9
  22. package/lib/esm/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +1 -0
  23. package/lib/esm/view/invoicing/createCreditNote/createCreditNotePayload.js +4 -1
  24. package/lib/esm/view/invoicing/createCreditNote/createCreditNoteSelector.js +4 -2
  25. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +7 -6
  26. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +3 -19
  27. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +10 -5
  28. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +6 -4
  29. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig.js +0 -17
  30. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +5 -0
  31. package/lib/esm/view/invoicing/invoiceList/fetchInvoiceListPageEpic.js +2 -1
  32. package/lib/esm/view/invoicing/invoiceList/invoiceListReducer.js +18 -17
  33. package/lib/esm/view/invoicing/invoiceList/invoiceListSelector.js +12 -4
  34. package/lib/esm/view/invoicing/invoiceList/invoiceListState.js +13 -9
  35. package/lib/esm/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js +5 -1
  36. package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +2 -1
  37. package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +26 -0
  38. package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +9 -0
  39. package/lib/esm/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.js +9 -3
  40. package/lib/esm/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.js +0 -9
  41. package/lib/esm/view/invoicing/invoicingCustomerDetailView/fetchInvoicingCustomerDetailPageEpic.js +2 -2
  42. package/lib/esm/view/invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js +1 -1
  43. package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.js +9 -3
  44. package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +0 -9
  45. package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.js +8 -3
  46. package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +1 -9
  47. package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +11 -3
  48. package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +0 -9
  49. package/lib/esm/view/invoicing/invoicingTabHelper.js +27 -0
  50. package/lib/esm/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionListPageEpic.js +2 -1
  51. package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewReducer.js +5 -5
  52. package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.js +12 -4
  53. package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.js +11 -9
  54. package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteFormConfig.js +1 -8
  55. package/lib/esm/view/invoicing/issueCreditNote/issueCreditNotePayload.js +5 -1
  56. package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +5 -2
  57. package/lib/esm/view/invoicing/recordPayment/recordPaymentFormConfig.js +0 -26
  58. package/lib/esm/view/invoicing/recordPayment/recordPaymentSelector.js +26 -6
  59. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +7 -1
  60. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +2 -1
  61. package/lib/index.d.ts +13 -12
  62. package/lib/index.js +9 -24
  63. package/lib/view/invoicing/auditView/auditViewSelector.d.ts +4 -0
  64. package/lib/view/invoicing/auditView/auditViewSelector.js +4 -0
  65. package/lib/view/invoicing/couponView/couponViewSelector.d.ts +5 -1
  66. package/lib/view/invoicing/couponView/couponViewSelector.js +17 -7
  67. package/lib/view/invoicing/couponView/couponViewState.d.ts +0 -7
  68. package/lib/view/invoicing/couponView/couponViewState.js +1 -10
  69. package/lib/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +1 -0
  70. package/lib/view/invoicing/createCreditNote/createCreditNotePayload.js +4 -1
  71. package/lib/view/invoicing/createCreditNote/createCreditNoteSelector.d.ts +3 -1
  72. package/lib/view/invoicing/createCreditNote/createCreditNoteSelector.js +4 -2
  73. package/lib/view/invoicing/createCreditNote/createCreditNoteState.d.ts +6 -0
  74. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +5 -5
  75. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +6 -5
  76. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.d.ts +3 -6
  77. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +4 -20
  78. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.d.ts +9 -7
  79. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +10 -5
  80. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +4 -3
  81. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +5 -3
  82. package/lib/view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig.d.ts +0 -8
  83. package/lib/view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig.js +1 -18
  84. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +5 -0
  85. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +5 -0
  86. package/lib/view/invoicing/invoiceList/fetchInvoiceListPageEpic.js +2 -1
  87. package/lib/view/invoicing/invoiceList/invoiceListReducer.js +17 -16
  88. package/lib/view/invoicing/invoiceList/invoiceListSelector.d.ts +3 -1
  89. package/lib/view/invoicing/invoiceList/invoiceListSelector.js +11 -3
  90. package/lib/view/invoicing/invoiceList/invoiceListState.d.ts +13 -9
  91. package/lib/view/invoicing/invoiceList/invoiceListState.js +15 -10
  92. package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.d.ts +9 -1
  93. package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js +5 -1
  94. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +3 -1
  95. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +2 -1
  96. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +13 -0
  97. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
  98. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +26 -0
  99. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +19 -1
  100. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +11 -1
  101. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +13 -0
  102. package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.d.ts +8 -1
  103. package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.js +8 -2
  104. package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.d.ts +0 -7
  105. package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.js +1 -10
  106. package/lib/view/invoicing/invoicingCustomerDetailView/fetchInvoicingCustomerDetailPageEpic.js +2 -2
  107. package/lib/view/invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js +1 -1
  108. package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.d.ts +3 -1
  109. package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.js +8 -2
  110. package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.d.ts +0 -7
  111. package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +1 -10
  112. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
  113. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.d.ts +3 -1
  114. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.js +7 -2
  115. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +2 -9
  116. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +2 -10
  117. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts +7 -1
  118. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +10 -2
  119. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +0 -7
  120. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +1 -10
  121. package/lib/view/invoicing/invoicingTabHelper.d.ts +27 -0
  122. package/lib/view/invoicing/invoicingTabHelper.js +30 -0
  123. package/lib/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionListPageEpic.js +2 -1
  124. package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewReducer.d.ts +1 -1
  125. package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewReducer.js +4 -4
  126. package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.d.ts +8 -0
  127. package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.js +11 -3
  128. package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.d.ts +10 -10
  129. package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.js +13 -10
  130. package/lib/view/invoicing/issueCreditNote/issueCreditNoteFormConfig.d.ts +0 -2
  131. package/lib/view/invoicing/issueCreditNote/issueCreditNoteFormConfig.js +2 -9
  132. package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.d.ts +2 -2
  133. package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.js +5 -1
  134. package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +3 -1
  135. package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +4 -1
  136. package/lib/view/invoicing/issueCreditNote/issueCreditNoteState.d.ts +6 -0
  137. package/lib/view/invoicing/recordPayment/recordPaymentFormConfig.d.ts +0 -6
  138. package/lib/view/invoicing/recordPayment/recordPaymentFormConfig.js +1 -27
  139. package/lib/view/invoicing/recordPayment/recordPaymentSelector.d.ts +3 -2
  140. package/lib/view/invoicing/recordPayment/recordPaymentSelector.js +26 -6
  141. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +11 -1
  142. package/lib/view/invoicing/settingsView/settingsViewSelector.js +7 -1
  143. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +2 -1
  144. package/package.json +4 -10
  145. package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.d.ts +0 -0
  146. package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +0 -1
  147. package/lib/entity/invoicing/coupon/couponConstants.d.ts +0 -11
  148. package/lib/entity/invoicing/coupon/couponConstants.js +0 -29
  149. package/lib/esm/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +0 -1
  150. package/lib/esm/entity/invoicing/coupon/couponConstants.js +0 -26
@@ -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,10 +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[];
52
61
  status: string | undefined;
62
+ configError?: ZeniAPIStatus;
53
63
  }
54
64
  /**
55
65
  * The settings hub's composite of everything it derives from the store: whether
@@ -79,11 +79,17 @@ 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,
89
95
  status,
@@ -26,7 +26,8 @@ exports.initialState = {
26
26
  reportId: 'profit_and_loss_by_projects',
27
27
  reportTitle: 'profit_and_loss_by_projects',
28
28
  uiState: {
29
- accountViewMode: 'project',
29
+ // Starts on the accounts view like every other report slice.
30
+ accountViewMode: 'account_group',
30
31
  nodeCollapseState: {},
31
32
  projectsToFilterOut: [],
32
33
  scrollPosition: undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.98",
3
+ "version": "5.2.0",
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",
@@ -54,7 +54,6 @@
54
54
  },
55
55
  "homepage": "https://github.com/zeni-ai/client-epic-state#readme",
56
56
  "devDependencies": {
57
- "@eslint/eslintrc": "^3.3.1",
58
57
  "@eslint/js": "^9.24.0",
59
58
  "@liveblocks/client": "^2.23.0",
60
59
  "@trivago/prettier-plugin-sort-imports": "^5.2.2",
@@ -64,21 +63,17 @@
64
63
  "@types/url-parse": "^1.4.11",
65
64
  "@typescript-eslint/eslint-plugin": "^8.56.0",
66
65
  "@typescript-eslint/parser": "^8.56.0",
67
- "c8": "^10.1.3",
68
66
  "concurrently": "^9.1.2",
69
67
  "eslint": "^9.24.0",
70
68
  "eslint-config-prettier": "^10.0.2",
71
69
  "eslint-plugin-perfectionist": "^4.15.0",
72
- "eslint-plugin-prettier": "^5.2.3",
73
70
  "eslint-plugin-unused-imports": "^4.1.4",
74
71
  "globals": "^16.0.0",
72
+ "knip": "^6.21.0",
75
73
  "madge": "^8.0.0",
76
74
  "prettier": "^3.5.3",
77
- "prettier-plugin-import-sort": "^0.0.7",
78
75
  "rimraf": "^6.0.1",
79
76
  "semver": "^7.7.1",
80
- "ts-prune": "^0.10.3",
81
- "ts-unused-exports": "^11.0.1",
82
77
  "typescript": "^5.7.3",
83
78
  "vite": "^7.3.5",
84
79
  "vitest": "^4.1.8"
@@ -118,8 +113,6 @@
118
113
  "lint:fix-modified-files": "chmod +x ./scripts/lint-modified-files.sh && LINT_FIX=true ./scripts/lint-modified-files.sh",
119
114
  "tsc-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh",
120
115
  "typecheck": "tsc --noEmit",
121
- "find-dead-code": "bash ./scripts/run-find-dead-code.sh",
122
- "find-unused-exports": "ts-unused-exports ./tsconfig.json",
123
116
  "circular-dependency": "madge --circular --extensions ts ./src",
124
117
  "build": "chmod +x ./scripts/run_build.sh && ./scripts/run_build.sh && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
125
118
  "only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
@@ -140,6 +133,7 @@
140
133
  "build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
141
134
  "pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh",
142
135
  "raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh",
143
- "test:file": "scripts/test-file.sh"
136
+ "test:file": "bash ./scripts/test-file.sh",
137
+ "find-unused-code": "knip"
144
138
  }
145
139
  }
@@ -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
- ];
@@ -1,26 +0,0 @@
1
- /**
2
- * Coupon form select options. Single source of truth (CES-owned) for the value
3
- * sets that back the coupon's string-union domain fields; surfaced to the form
4
- * via `getInvoicingCouponFormView` so web-components need not hardcode them.
5
- */
6
- export const INVOICING_DISCOUNT_TYPE_OPTIONS = [
7
- { label: 'Percentage', value: 'percentage' },
8
- { label: 'Fixed amount', value: 'fixed_amount' },
9
- { label: 'Offer quantity', value: 'offer_quantity' },
10
- ];
11
- export const INVOICING_COUPON_DURATION_TYPE_OPTIONS = [
12
- { label: 'One time', value: 'one_time' },
13
- { label: 'Forever', value: 'forever' },
14
- { label: 'Limited period', value: 'limited_period' },
15
- ];
16
- export const INVOICING_COUPON_PERIOD_UNIT_OPTIONS = [
17
- { label: 'Day', value: 'day' },
18
- { label: 'Week', value: 'week' },
19
- { label: 'Month', value: 'month' },
20
- { label: 'Year', value: 'year' },
21
- ];
22
- export const INVOICING_COUPON_APPLY_ON_OPTIONS = [
23
- { label: 'Invoice amount', value: 'invoice_amount' },
24
- { label: 'Each specified item', value: 'each_specified_item' },
25
- { label: 'Specified items total', value: 'specified_items_total' },
26
- ];