@zeniai/client-epic-state 5.2.29 → 5.2.30-betaRD0

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 (105) hide show
  1. package/lib/entity/aiCfo/aiCfoPayload.d.ts +21 -0
  2. package/lib/entity/aiCfo/aiCfoReducer.js +73 -1
  3. package/lib/entity/aiCfo/aiCfoState.d.ts +24 -0
  4. package/lib/entity/file/fileState.d.ts +3 -3
  5. package/lib/entity/file/fileState.js +2 -0
  6. package/lib/entity/invoicing/creditNote/creditNotePayload.d.ts +0 -1
  7. package/lib/entity/invoicing/creditNote/creditNotePayload.js +0 -1
  8. package/lib/entity/invoicing/creditNote/creditNoteState.d.ts +0 -1
  9. package/lib/entity/invoicing/invoice/invoicePayload.d.ts +0 -1
  10. package/lib/entity/invoicing/invoice/invoicePayload.js +0 -1
  11. package/lib/entity/invoicing/invoice/invoiceState.d.ts +0 -1
  12. package/lib/entity/invoicing/invoicingCommonPayload.d.ts +2 -0
  13. package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.d.ts +0 -1
  14. package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +0 -1
  15. package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerState.d.ts +0 -1
  16. package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.d.ts +1 -2
  17. package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +1 -2
  18. package/lib/entity/invoicing/invoicingSubscription/invoicingSubscriptionState.d.ts +1 -2
  19. package/lib/epic.d.ts +2 -1
  20. package/lib/epic.js +2 -0
  21. package/lib/esm/entity/aiCfo/aiCfoReducer.js +73 -1
  22. package/lib/esm/entity/file/fileState.js +2 -0
  23. package/lib/esm/entity/invoicing/creditNote/creditNotePayload.js +0 -1
  24. package/lib/esm/entity/invoicing/invoice/invoicePayload.js +0 -1
  25. package/lib/esm/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +0 -1
  26. package/lib/esm/entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload.js +1 -2
  27. package/lib/esm/epic.js +2 -0
  28. package/lib/esm/index.js +2 -2
  29. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +5 -0
  30. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +1 -0
  31. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +29 -11
  32. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -2
  33. package/lib/esm/view/invoicing/couponView/couponViewState.js +4 -4
  34. package/lib/esm/view/invoicing/dataImportView/dataImportViewSelector.js +2 -0
  35. package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +1 -0
  36. package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +2 -0
  37. package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +3 -3
  38. package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +4 -4
  39. package/lib/esm/view/invoicing/invoicingOverview/invoicingOverviewPayload.js +0 -1
  40. package/lib/esm/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +2 -1
  41. package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +1 -0
  42. package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +0 -2
  43. package/lib/esm/view/invoicing/settingsView/invoicingBrandingFormConfig.js +5 -0
  44. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +5 -1
  45. package/lib/esm/view/recommendation/recommendationReducer.js +13 -1
  46. package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +52 -0
  47. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +18 -2
  48. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +0 -1
  49. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +0 -3
  50. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +18 -2
  51. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +0 -1
  52. package/lib/index.d.ts +7 -5
  53. package/lib/index.js +24 -23
  54. package/lib/view/aiCfoView/aiCfoViewReducer.js +5 -0
  55. package/lib/view/aiCfoView/aiCfoViewSelector.js +1 -0
  56. package/lib/view/aiCfoView/aiCfoViewState.d.ts +7 -0
  57. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +29 -11
  58. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +5 -3
  59. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +2 -5
  60. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -2
  61. package/lib/view/invoicing/couponView/couponViewState.d.ts +2 -2
  62. package/lib/view/invoicing/couponView/couponViewState.js +4 -4
  63. package/lib/view/invoicing/dataImportView/dataImportViewSelector.d.ts +2 -0
  64. package/lib/view/invoicing/dataImportView/dataImportViewSelector.js +2 -0
  65. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +1 -0
  66. package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +1 -0
  67. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +1 -0
  68. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
  69. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +2 -0
  70. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +1 -0
  71. package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.d.ts +2 -2
  72. package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +3 -3
  73. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +2 -2
  74. package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +4 -4
  75. package/lib/view/invoicing/invoicingOverview/invoicingOverviewPayload.d.ts +0 -1
  76. package/lib/view/invoicing/invoicingOverview/invoicingOverviewPayload.js +0 -1
  77. package/lib/view/invoicing/invoicingOverview/invoicingOverviewState.d.ts +0 -1
  78. package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.d.ts +3 -1
  79. package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +1 -0
  80. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts +2 -0
  81. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +1 -0
  82. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +2 -2
  83. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +0 -2
  84. package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.d.ts +0 -1
  85. package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.d.ts +1 -0
  86. package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.js +5 -0
  87. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +5 -1
  88. package/lib/view/invoicing/settingsView/settingsViewSelector.js +4 -0
  89. package/lib/view/invoicing/subscriptionAction/subscriptionActionRequestPayload.d.ts +8 -0
  90. package/lib/view/recommendation/recommendationPayload.d.ts +34 -0
  91. package/lib/view/recommendation/recommendationReducer.d.ts +2 -1
  92. package/lib/view/recommendation/recommendationReducer.js +14 -2
  93. package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +7 -0
  94. package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +56 -0
  95. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.d.ts +2 -1
  96. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +18 -2
  97. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +0 -1
  98. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +0 -1
  99. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +0 -3
  100. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +0 -1
  101. package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +1 -1
  102. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.d.ts +2 -1
  103. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +18 -2
  104. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +0 -1
  105. package/package.json +1 -1
@@ -12,6 +12,18 @@ const rootActions_1 = require("../../../../rootActions");
12
12
  const zeniDayJS_1 = require("../../../../zeniDayJS");
13
13
  const jeSchedulesPayload_1 = require("../../payload/jeSchedulesPayload");
14
14
  const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
15
+ /**
16
+ * How far back to look for accrued schedules, matching the Vendors page
17
+ * (`getDefaultSelectedTimeframeForScheduleType`, 'accrued_expenses'), which queries the same
18
+ * start_date filter through /1.0/schedules.
19
+ */
20
+ const ACCRUED_LOOKBACK_MONTHS = 24;
21
+ /**
22
+ * One-time accruals keep their own, narrower lookback. Unlike an accrued schedule they belong to
23
+ * exactly one service month and never span months, so the reason the accrued window has to reach
24
+ * back does not apply to them -- widening it would only add older history to the Existing tab.
25
+ */
26
+ const ONE_TIME_ACCRUAL_LOOKBACK_MONTHS = 12;
15
27
  const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedules.match), (0, operators_1.mergeMap)((action) => {
16
28
  const state = state$.value;
17
29
  const { expenseAutomationViewState: { selectedPeriodByTenantId }, } = state;
@@ -33,15 +45,21 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
33
45
  const endDate = isClosePeriodTab || existingEndDate == null
34
46
  ? (0, timePeriod_2.toString)(period.end)
35
47
  : (0, timePeriod_2.toString)(existingEndDate);
36
- // Accrued rows are windowed on the schedule's own start_date rather than a transaction date,
37
- // so they get their own bounds. Review wants the month being closed; Existing wants the year
38
- // up to endDate, snapped to the 1st — the same window the server used to compute for itself.
39
- const accruedStartDate = isClosePeriodTab
40
- ? (0, timePeriod_2.toString)(period.start)
41
- : (0, zeniDayJS_1.date)(endDate)
42
- .subtract(1, 'year')
43
- .startOf('month')
44
- .format(timePeriod_1.DEFAULT_DATE_FORMAT);
48
+ // Accrued rows are windowed on the schedule's own start_date -- its FIRST posting date --
49
+ // rather than a transaction date, so the lower bound has to reach back past the start of
50
+ // every accrual still running in this period, not just the ones that began in it. Review
51
+ // used to send the close month itself, which returned only accruals whose first posting fell
52
+ // in that month and hid every longer-running one.
53
+ const parsedEndDate = (0, zeniDayJS_1.date)(endDate);
54
+ const accruedStartDate = parsedEndDate
55
+ .subtract(ACCRUED_LOOKBACK_MONTHS, 'month')
56
+ .startOf('month')
57
+ .format(timePeriod_1.DEFAULT_DATE_FORMAT);
58
+ // Formatted as a service month, not a date: that is the only thing it is sent as.
59
+ const oneTimeAccrualServiceMonthStart = parsedEndDate
60
+ .subtract(ONE_TIME_ACCRUAL_LOOKBACK_MONTHS, 'month')
61
+ .startOf('month')
62
+ .format(jeSchedulesPayload_1.SERVICE_MONTH_FORMAT);
45
63
  const queryParam = {
46
64
  base_transaction_end_date: endDate,
47
65
  end_date: endDate,
@@ -62,8 +80,8 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
62
80
  filter_failed_je_postings_by_date: true,
63
81
  }
64
82
  : {
65
- one_time_accrual_service_month_start: (0, zeniDayJS_1.date)(accruedStartDate).format(jeSchedulesPayload_1.SERVICE_MONTH_FORMAT),
66
- one_time_accrual_service_month_end: (0, zeniDayJS_1.date)(endDate).format(jeSchedulesPayload_1.SERVICE_MONTH_FORMAT),
83
+ one_time_accrual_service_month_start: oneTimeAccrualServiceMonthStart,
84
+ one_time_accrual_service_month_end: parsedEndDate.format(jeSchedulesPayload_1.SERVICE_MONTH_FORMAT),
67
85
  // Existing lists what actually reached the books.
68
86
  one_time_accrual_statuses: ['posted'],
69
87
  // A failed posting from an earlier month still needs to surface here, so this list
@@ -1,17 +1,19 @@
1
- import { Amount } from '../../../commonStateTypes/amount';
2
1
  import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
2
+ import { Amount } from '../../../commonStateTypes/amount';
3
3
  import { NestedClassHierarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID';
4
4
  import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonStateTypes/common';
5
5
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
6
6
  import { AccountBase } from '../../../entity/account/accountState';
7
7
  import { ClassBase } from '../../../entity/class/classState';
8
+ import { JEAccruedSchedule, JEOneTimeAccrual, JEScheduledTransaction } from '../../../entity/jeSchedules/jeSchedulesSelector';
8
9
  import { JEScheduleKey, JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
9
10
  import { UncategorizedAccounts } from '../../accountList/accountListSelector';
10
11
  import { JEAccountSettingsView } from '../selectorTypes/jeAccountSettingsViewSelectorTypes';
11
- import { JEScheduledTransactionWithFailedEntries } from '../selectors/jeScheduledTransactionWithFailedEntries';
12
12
  import { NewScheduleView } from '../selectorTypes/jeNewScheduleViewSelectorTypes';
13
- import { JEScheduleRow } from '../selectors/jeSchedulesViewSelector';
13
+ import { JEScheduledTransactionWithFailedEntries } from '../selectors/jeScheduledTransactionWithFailedEntries';
14
14
  import { JEPageTab, JEScheduleLocalData, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
15
+ export type JEScheduleRow = JEAccruedSchedule | JEOneTimeAccrual | JEScheduledTransaction | JEScheduledTransactionWithFailedEntries;
16
+ export type JEScheduleRowWithoutOneTimeAccrual = Exclude<JEScheduleRow, JEOneTimeAccrual>;
15
17
  /**
16
18
  * Amount rather than a bare number: the KPI strip formats these for display, and a number carries
17
19
  * no currency, which is what made the tiles print a hardcoded dollar sign.
@@ -1,10 +1,9 @@
1
1
  import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
- import { JEAccruedSchedule, JEOneTimeAccrual, JEScheduledTransaction } from '../../../entity/jeSchedules/jeSchedulesSelector';
2
+ import { JEAccruedSchedule, JEOneTimeAccrual } from '../../../entity/jeSchedules/jeSchedulesSelector';
3
3
  import { OneTimeAccrualEdits } from '../../../entity/jeSchedules/jeSchedulesState';
4
4
  import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
5
5
  import { RootState } from '../../../rootStateTypes';
6
- import { ExpenseAutomationJESchedulesViewSelector } from '../selectorTypes/jeSchedulesSelectorTypes';
7
- import { JEScheduledTransactionWithFailedEntries } from './jeScheduledTransactionWithFailedEntries';
6
+ import { ExpenseAutomationJESchedulesViewSelector, JEScheduleRow } from '../selectorTypes/jeSchedulesSelectorTypes';
8
7
  /**
9
8
  * `posting_blocked` is written by the posting Cron when a JE fails to post. It is an internal
10
9
  * failure state with no human action attached, so it is dropped here rather than hidden at render
@@ -20,8 +19,6 @@ export declare const isAiAccountantSchedule: (schedule: JEScheduleRow) => boolea
20
19
  export declare function isAccruedScheduleRow(schedule: JEScheduleRow): schedule is JEAccruedSchedule;
21
20
  export declare function isOneTimeAccrualRow(schedule: JEScheduleRow): schedule is JEOneTimeAccrual;
22
21
  export declare function getExpenseAutomationJESchedulesView(state: RootState): ExpenseAutomationJESchedulesViewSelector;
23
- export type JEScheduleRow = JEAccruedSchedule | JEOneTimeAccrual | JEScheduledTransaction | JEScheduledTransactionWithFailedEntries;
24
- export type JEScheduleRowWithoutOneTimeAccrual = Exclude<JEScheduleRow, JEOneTimeAccrual>;
25
22
  export interface ExpenseAutomationJEOneTimeAccrualDetailView {
26
23
  actionFetchState: FetchStateAndError;
27
24
  detailFetchState: FetchStateAndError;
@@ -26,8 +26,8 @@ const classListSelector_1 = require("../../classList/classListSelector");
26
26
  const scheduleDetailLocalDataHelper_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper");
27
27
  const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailSelector");
28
28
  const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
29
- const getAllStepsHelper_1 = require("./getAllStepsHelper");
30
29
  const jeSchedulesViewState_1 = require("../types/jeSchedulesViewState");
30
+ const getAllStepsHelper_1 = require("./getAllStepsHelper");
31
31
  const jeAccountSettingsViewSelector_1 = require("./jeAccountSettingsViewSelector");
32
32
  const jeNewScheduleViewSelector_1 = require("./jeNewScheduleViewSelector");
33
33
  // Matches the AI-automation user addresses webc's schedule list row already
@@ -345,7 +345,9 @@ function getExpenseAutomationJESchedulesView(state) {
345
345
  */
346
346
  const sumToAmount = (schedules) => {
347
347
  const first = schedules[0];
348
- const currency = first != null ? getScheduleAmountObject(first) : allScheduleAmountFallback;
348
+ const currency = first != null
349
+ ? getScheduleAmountObject(first)
350
+ : allScheduleAmountFallback;
349
351
  return {
350
352
  ...currency,
351
353
  amount: sumAmount(schedules),
@@ -4,8 +4,8 @@ import { InvoicingListSort } from '../invoicingApiHelper';
4
4
  export interface InvoicingCouponFilters {
5
5
  search?: string;
6
6
  }
7
- export declare const ALL_INVOICING_COUPON_SORT_KEYS: readonly ["coupon_id", "name", "discount", "duration", "created", "valid_till", "apply_on", "status", "redemptions"];
8
- export declare const toInvoicingCouponSortKey: (v: string) => "status" | "name" | "discount" | "coupon_id" | "duration" | "created" | "valid_till" | "apply_on" | "redemptions";
7
+ export declare const ALL_INVOICING_COUPON_SORT_KEYS: readonly ["code", "coupon", "discount", "duration", "created", "valid_till", "apply_on", "status", "redemptions"];
8
+ export declare const toInvoicingCouponSortKey: (v: string) => "code" | "status" | "discount" | "coupon" | "duration" | "created" | "valid_till" | "apply_on" | "redemptions";
9
9
  export type InvoicingCouponSortKey = ReturnType<typeof toInvoicingCouponSortKey>;
10
10
  /**
11
11
  * Structural column descriptor owned by CES so the discounts-list column set,
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toInvoicingCouponTabId = exports.ALL_INVOICING_COUPON_TAB_IDS = exports.INVOICING_COUPON_COLUMNS = exports.toInvoicingCouponSortKey = exports.ALL_INVOICING_COUPON_SORT_KEYS = void 0;
4
4
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
5
5
  exports.ALL_INVOICING_COUPON_SORT_KEYS = [
6
- 'coupon_id',
7
- 'name',
6
+ 'code',
7
+ 'coupon',
8
8
  'discount',
9
9
  'duration',
10
10
  'created',
@@ -16,8 +16,8 @@ exports.ALL_INVOICING_COUPON_SORT_KEYS = [
16
16
  const toInvoicingCouponSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_INVOICING_COUPON_SORT_KEYS);
17
17
  exports.toInvoicingCouponSortKey = toInvoicingCouponSortKey;
18
18
  exports.INVOICING_COUPON_COLUMNS = [
19
- { key: 'coupon_id', sortable: true },
20
- { key: 'name', sortable: true },
19
+ { key: 'code', sortable: true },
20
+ { key: 'coupon', sortable: true },
21
21
  { key: 'discount', sortable: false },
22
22
  { key: 'duration', sortable: true },
23
23
  { key: 'created', sortable: true },
@@ -1,10 +1,12 @@
1
1
  import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
+ import { InvoicingFieldHelpByCode } from '../../../entity/invoicing/invoicingCommonPayload';
2
3
  import { RootState } from '../../../rootStateTypes';
3
4
  import { InvoicingDataImportStatusRow, InvoicingMigrationSession } from './dataImportViewPayload';
4
5
  import { InvoicingMigrationDiagnosticsState } from './dataImportViewState';
5
6
  export interface InvoicingDataImportView {
6
7
  activeMigrationSessionId: ID | null;
7
8
  diagnosticsBySession: Record<ID, InvoicingMigrationDiagnosticsState>;
9
+ fieldHelp: InvoicingFieldHelpByCode;
8
10
  sessionDetail: Record<ID, InvoicingMigrationSession>;
9
11
  sessionDetailFetch: FetchStateAndError;
10
12
  sessions: InvoicingMigrationSession[];
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getInvoicingDataImportView = void 0;
4
+ const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
4
5
  /**
5
6
  * Single bundled view for the invoicing data-import surfaces — consumers read
6
7
  * only this. Carries the migration `sessions` list + `sessionsFetch`, the
@@ -10,6 +11,7 @@ exports.getInvoicingDataImportView = void 0;
10
11
  const getInvoicingDataImportView = (state) => {
11
12
  const dataImportState = state.invoicingDataImportViewState;
12
13
  return {
14
+ fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'data_import'),
13
15
  activeMigrationSessionId: dataImportState.activeDetailId,
14
16
  sessionDetail: dataImportState.sessionDetail,
15
17
  sessionDetailFetch: dataImportState.sessionDetailFetch,
@@ -19,6 +19,7 @@ export interface InvoicingCatalogListView extends SelectorView {
19
19
  productFilters: InvoicingCatalogProductFilters;
20
20
  productNextCursor: string | null;
21
21
  products: InvoicingPlan[];
22
+ planSort?: InvoicingListSort;
22
23
  productSort?: InvoicingListSort;
23
24
  }
24
25
  export declare const getInvoicingCatalogPrices: (items: InvoicingPlan[]) => InvoicingProduct[];
@@ -22,6 +22,7 @@ exports.getInvoicingCatalogPrices = getInvoicingCatalogPrices;
22
22
  exports.getInvoicingCatalogListView = (0, toolkit_1.createSelector)((state) => state.invoicingPlanState, (state) => state.invoicingCatalogListViewState, (state) => state.invoicingConfigViewState.catalogItemLifecycleActionOptions, (planState, listViewState, catalogItemLifecycleActionOptions) => ({
23
23
  catalogItemLifecycleActionOptions,
24
24
  plans: (0, planSelector_1.getInvoicingPlansByIds)(planState, listViewState.planIds),
25
+ planSort: listViewState.planSort,
25
26
  productColumns: invoicingCatalogListViewState_1.INVOICING_PRODUCT_COLUMNS,
26
27
  products: (0, planSelector_1.getInvoicingPlansByIds)(planState, listViewState.productIds),
27
28
  productSort: listViewState.productSort,
@@ -54,6 +54,7 @@ export interface InvoicingConfigPayload {
54
54
  qbo_account_mapping_kind_options?: InvoicingQboAccountMappingKindOptionWire[];
55
55
  qbo_customer_matching_options?: InvoicingNamedOptionWire[];
56
56
  qbo_sync_status_options?: InvoicingNamedOptionWire[];
57
+ subscription_cancel_reason_code_options?: InvoicingNamedOptionWire[];
57
58
  subscription_status_options?: InvoicingNamedOptionWire[];
58
59
  taxability_options?: InvoicingNamedOptionWire[];
59
60
  transaction_status_options?: InvoicingNamedOptionWire[];
@@ -2,7 +2,7 @@ import { ZeniAPIStatus } from '../../../responsePayload';
2
2
  import { InvoicingConfigPayload } from './invoicingConfigViewPayload';
3
3
  import { InvoicingConfigViewState } from './invoicingConfigViewState';
4
4
  export declare const initialState: InvoicingConfigViewState;
5
- export declare function mapInvoicingConfigPayloadToState(payload: InvoicingConfigPayload): Pick<InvoicingConfigViewState, 'auditLogEntityRouteOptions' | 'auditLogListSortFieldOptions' | 'auditLogSourceLabels' | 'autoCollectionOptions' | 'billingPeriodUnitOptions' | 'catalogTierTypeOptionsByPricingModel' | 'catalogTrialEndActionOptions' | 'catalogTrialUnitOptions' | 'customerTypeOptions' | 'dateFormatOptions' | 'fieldHelp' | 'discountApplyOnOptions' | 'discountDurationTypeOptions' | 'discountTypeOptions' | 'manualPaymentMethodOptions' | 'netTermDayOptions' | 'paymentGatewayOptions' | 'taxabilityOptions' | 'cardStatusOptions' | 'catalogItemStatusOptions' | 'catalogItemTypeOptions' | 'creditNoteReasonCodeOptions' | 'creditNoteStatusOptions' | 'creditNoteTypeOptions' | 'customerStatusOptions' | 'discountStatusOptions' | 'dunningCaseStatusOptions' | 'invoiceStatusOptions' | 'subscriptionStatusOptions' | 'transactionStatusOptions' | 'transactionTypeOptions' | 'createdAt' | 'updatedAt' | 'dunningScheduleActionOptions' | 'subscriptionLifecycleActionOptions' | 'subscriptionCommercialEditAllowedFromStatuses' | 'subscriptionMetadataEditAllowedFromStatuses' | 'subscriptionEditFieldOptions' | 'subscriptionCancelTimingOptions' | 'subscriptionChangeOptionOptions' | 'catalogItemLifecycleActionOptions' | 'catalogProductLifecycleActionOptions' | 'discountLifecycleActionOptions' | 'qboAccountMappingKindOptions' | 'qboCustomerMatchingOptions' | 'qboSyncStatusOptions' | 'isInvoicingEnabled' | 'isInvoicingTosAccepted' | 'invoicingTosAcceptanceIp' | 'invoicingTosAcceptanceTime' | 'invoicingTosAcceptanceUserAgent' | 'invoicingTosAcceptanceUserId' | 'isInvoicingSettingsSeeded'>;
5
+ export declare function mapInvoicingConfigPayloadToState(payload: InvoicingConfigPayload): Pick<InvoicingConfigViewState, 'auditLogEntityRouteOptions' | 'auditLogListSortFieldOptions' | 'auditLogSourceLabels' | 'autoCollectionOptions' | 'billingPeriodUnitOptions' | 'catalogTierTypeOptionsByPricingModel' | 'catalogTrialEndActionOptions' | 'catalogTrialUnitOptions' | 'customerTypeOptions' | 'dateFormatOptions' | 'fieldHelp' | 'discountApplyOnOptions' | 'discountDurationTypeOptions' | 'discountTypeOptions' | 'manualPaymentMethodOptions' | 'netTermDayOptions' | 'paymentGatewayOptions' | 'taxabilityOptions' | 'cardStatusOptions' | 'catalogItemStatusOptions' | 'catalogItemTypeOptions' | 'creditNoteReasonCodeOptions' | 'creditNoteStatusOptions' | 'creditNoteTypeOptions' | 'customerStatusOptions' | 'discountStatusOptions' | 'dunningCaseStatusOptions' | 'invoiceStatusOptions' | 'subscriptionCancelReasonCodeOptions' | 'subscriptionStatusOptions' | 'transactionStatusOptions' | 'transactionTypeOptions' | 'createdAt' | 'updatedAt' | 'dunningScheduleActionOptions' | 'subscriptionLifecycleActionOptions' | 'subscriptionCommercialEditAllowedFromStatuses' | 'subscriptionMetadataEditAllowedFromStatuses' | 'subscriptionEditFieldOptions' | 'subscriptionCancelTimingOptions' | 'subscriptionChangeOptionOptions' | 'catalogItemLifecycleActionOptions' | 'catalogProductLifecycleActionOptions' | 'discountLifecycleActionOptions' | 'qboAccountMappingKindOptions' | 'qboCustomerMatchingOptions' | 'qboSyncStatusOptions' | 'isInvoicingEnabled' | 'isInvoicingTosAccepted' | 'invoicingTosAcceptanceIp' | 'invoicingTosAcceptanceTime' | 'invoicingTosAcceptanceUserAgent' | 'invoicingTosAcceptanceUserId' | 'isInvoicingSettingsSeeded'>;
6
6
  export declare const fetchInvoicingConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload?: {
7
7
  cacheOverride?: boolean;
8
8
  } | undefined], {
@@ -39,6 +39,7 @@ exports.initialState = {
39
39
  discountStatusOptions: [],
40
40
  dunningCaseStatusOptions: [],
41
41
  invoiceStatusOptions: [],
42
+ subscriptionCancelReasonCodeOptions: [],
42
43
  subscriptionStatusOptions: [],
43
44
  transactionStatusOptions: [],
44
45
  transactionTypeOptions: [],
@@ -108,6 +109,7 @@ function mapInvoicingConfigPayloadToState(payload) {
108
109
  discountStatusOptions: (payload.discount_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
109
110
  dunningCaseStatusOptions: (payload.dunning_case_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
110
111
  invoiceStatusOptions: (payload.invoice_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
112
+ subscriptionCancelReasonCodeOptions: (payload.subscription_cancel_reason_code_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
111
113
  subscriptionStatusOptions: (payload.subscription_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
112
114
  transactionStatusOptions: (payload.transaction_status_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
113
115
  transactionTypeOptions: (payload.transaction_type_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
@@ -38,6 +38,7 @@ export interface InvoicingConfigViewState extends FetchedState {
38
38
  qboAccountMappingKindOptions: InvoicingQboAccountMappingKindOption[];
39
39
  qboCustomerMatchingOptions: InvoicingNamedOption[];
40
40
  qboSyncStatusOptions: InvoicingNamedOption[];
41
+ subscriptionCancelReasonCodeOptions: InvoicingNamedOption[];
41
42
  subscriptionCancelTimingOptions: InvoicingNamedOption[];
42
43
  subscriptionChangeOptionOptions: InvoicingNamedOption[];
43
44
  subscriptionCommercialEditAllowedFromStatuses: string[];
@@ -4,8 +4,8 @@ import { InvoicingListSort } from '../invoicingApiHelper';
4
4
  export interface InvoicingCustomerFilters {
5
5
  search?: string;
6
6
  }
7
- export declare const ALL_INVOICING_CUSTOMER_SORT_KEYS: readonly ["name", "email", "billingAddress", "cardStatus", "autoCollect", "status"];
8
- export declare const toInvoicingCustomerSortKey: (v: string) => "status" | "name" | "email" | "billingAddress" | "cardStatus" | "autoCollect";
7
+ export declare const ALL_INVOICING_CUSTOMER_SORT_KEYS: readonly ["name", "email", "billingAddress", "card", "autoCollect", "status"];
8
+ export declare const toInvoicingCustomerSortKey: (v: string) => "status" | "name" | "card" | "email" | "billingAddress" | "autoCollect";
9
9
  export type InvoicingCustomerSortKey = ReturnType<typeof toInvoicingCustomerSortKey>;
10
10
  /**
11
11
  * Structural column descriptor owned by CES so the customer-list column set,
@@ -6,17 +6,17 @@ exports.ALL_INVOICING_CUSTOMER_SORT_KEYS = [
6
6
  'name',
7
7
  'email',
8
8
  'billingAddress',
9
- 'cardStatus',
9
+ 'card',
10
10
  'autoCollect',
11
11
  'status',
12
12
  ];
13
13
  const toInvoicingCustomerSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_INVOICING_CUSTOMER_SORT_KEYS);
14
14
  exports.toInvoicingCustomerSortKey = toInvoicingCustomerSortKey;
15
15
  exports.INVOICING_CUSTOMER_COLUMNS = [
16
- { key: 'name', sortable: true },
16
+ { key: 'name', sortable: false },
17
17
  { key: 'email', sortable: true },
18
18
  { key: 'billingAddress', sortable: false },
19
- { key: 'cardStatus', sortable: true },
19
+ { key: 'card', sortable: true },
20
20
  { key: 'autoCollect', sortable: true },
21
21
  { key: 'status', sortable: true },
22
22
  ];
@@ -4,8 +4,8 @@ import { InvoicingListSort } from '../invoicingApiHelper';
4
4
  export interface InvoicingDunningCaseFilters {
5
5
  search?: string;
6
6
  }
7
- export declare const ALL_INVOICING_DUNNING_CASE_SORT_KEYS: readonly ["customer", "invoice", "attempts", "nextRetry", "daysPastDue", "failureReason", "status", "amount"];
8
- export declare const toInvoicingDunningCaseSortKey: (v: string) => "status" | "invoice" | "amount" | "customer" | "daysPastDue" | "attempts" | "nextRetry" | "failureReason";
7
+ export declare const ALL_INVOICING_DUNNING_CASE_SORT_KEYS: readonly ["customer", "invoice", "attempts", "next_retry", "days_past_due", "failureReason", "status", "amount"];
8
+ export declare const toInvoicingDunningCaseSortKey: (v: string) => "status" | "invoice" | "amount" | "customer" | "attempts" | "next_retry" | "days_past_due" | "failureReason";
9
9
  export type InvoicingDunningCaseSortKey = ReturnType<typeof toInvoicingDunningCaseSortKey>;
10
10
  /**
11
11
  * Structural column descriptor owned by CES so the dunning-list column set,
@@ -6,8 +6,8 @@ exports.ALL_INVOICING_DUNNING_CASE_SORT_KEYS = [
6
6
  'customer',
7
7
  'invoice',
8
8
  'attempts',
9
- 'nextRetry',
10
- 'daysPastDue',
9
+ 'next_retry',
10
+ 'days_past_due',
11
11
  'failureReason',
12
12
  'status',
13
13
  'amount',
@@ -18,8 +18,8 @@ exports.INVOICING_DUNNING_CASE_COLUMNS = [
18
18
  { key: 'customer', sortable: true },
19
19
  { key: 'invoice', sortable: true },
20
20
  { key: 'attempts', sortable: true },
21
- { key: 'nextRetry', sortable: true },
22
- { key: 'daysPastDue', sortable: true },
21
+ { key: 'next_retry', sortable: true },
22
+ { key: 'days_past_due', sortable: true },
23
23
  { key: 'failureReason', sortable: false },
24
24
  { key: 'status', sortable: true },
25
25
  { key: 'amount', sortable: true },
@@ -35,7 +35,6 @@ export interface InvoicingPlanRevenuePointPayload {
35
35
  mrr: number;
36
36
  pct: number;
37
37
  plan: string;
38
- product_code?: string;
39
38
  }
40
39
  export interface InvoicingDashboardSummaryPayload {
41
40
  customer_movement: {
@@ -44,7 +44,6 @@ const mapInvoicingPlanRevenuePointPayloadToState = (payload) => ({
44
44
  mrr: (0, amount_1.toAmount)(payload.mrr, 'USD', '$'),
45
45
  pct: payload.pct,
46
46
  planID: payload.plan,
47
- productCode: payload.product_code,
48
47
  });
49
48
  exports.mapInvoicingPlanRevenuePointPayloadToState = mapInvoicingPlanRevenuePointPayloadToState;
50
49
  const mapInvoicingDashboardSummaryPayloadToState = (payload) => ({
@@ -39,7 +39,6 @@ export interface InvoicingPlanRevenuePoint {
39
39
  mrr: Amount;
40
40
  pct: number;
41
41
  planID: ID;
42
- productCode?: string;
43
42
  }
44
43
  export interface InvoicingDashboardSummary {
45
44
  customerMovement: {
@@ -1,6 +1,6 @@
1
1
  import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
2
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
- import type { InvoicingFieldHelpByCode } from '../../../entity/invoicing/invoicingCommonPayload';
3
+ import type { InvoicingFieldHelpByCode, InvoicingNamedOption } from '../../../entity/invoicing/invoicingCommonPayload';
4
4
  import { InvoicingSubscription } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionState';
5
5
  import { RootState } from '../../../rootStateTypes';
6
6
  /**
@@ -10,6 +10,8 @@ import { RootState } from '../../../rootStateTypes';
10
10
  */
11
11
  export interface InvoicingSubscriptionDetailView extends SelectorView {
12
12
  actionState: FetchStateAndError;
13
+ /** Cancel reasons from `/1.0/config`, so the dialog hardcodes nothing. */
14
+ cancelReasonCodeOptions: InvoicingNamedOption[];
13
15
  /**
14
16
  * Backend help copy for this screen's field group, keyed by field code.
15
17
  * Folded in here so the screen never reaches for the config view itself.
@@ -10,6 +10,7 @@ const getInvoicingSubscriptionDetail = (state, invoicingSubscriptionID) => {
10
10
  const { error, fetchState } = state.invoicingSubscriptionDetailViewState;
11
11
  return {
12
12
  fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'subscription'),
13
+ cancelReasonCodeOptions: (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state).subscriptionCancelReasonCodeOptions,
13
14
  actionState: (0, subscriptionActionSelector_1.getInvoicingSubscriptionActionState)(invoicingSubscriptionID)(state),
14
15
  subscription: (0, exports.getInvoicingSubscriptionById)(state, invoicingSubscriptionID),
15
16
  fetchState,
@@ -7,6 +7,8 @@ import { InvoicingListSort } from '../invoicingApiHelper';
7
7
  import { InvoicingSubscriptionColumnConfig, InvoicingSubscriptionFilters, InvoicingSubscriptionTabId } from './invoicingSubscriptionListViewState';
8
8
  export interface InvoicingSubscriptionListView extends SelectorView {
9
9
  activeTab: InvoicingSubscriptionTabId;
10
+ /** Cancel reasons from `/1.0/config`, so the dialog hardcodes nothing. */
11
+ cancelReasonCodeOptions: InvoicingNamedOption[];
10
12
  columns: InvoicingSubscriptionColumnConfig[];
11
13
  count: InvoicingListCounts;
12
14
  countsFetchState: FetchStateAndError;
@@ -31,6 +31,7 @@ exports.getInvoicingSubscriptionListView = (0, toolkit_1.createSelector)((state)
31
31
  count: listViewState.counts,
32
32
  countsFetchState: listViewState.countsFetchState,
33
33
  subscriptionCommercialEditAllowedFromStatuses: configState.subscriptionCommercialEditAllowedFromStatuses,
34
+ cancelReasonCodeOptions: configState.subscriptionCancelReasonCodeOptions,
34
35
  subscriptionLifecycleActionOptions: configState.subscriptionLifecycleActionOptions,
35
36
  subscriptionMetadataEditAllowedFromStatuses: configState.subscriptionMetadataEditAllowedFromStatuses,
36
37
  statusOptions,
@@ -7,8 +7,8 @@ export interface InvoicingSubscriptionFilters {
7
7
  startedFrom?: string;
8
8
  startedTo?: string;
9
9
  }
10
- export declare const ALL_INVOICING_SUBSCRIPTION_SORT_KEYS: readonly ["subscription", "customer", "plan", "product_code", "term_end", "next_billing", "auto_collect", "status", "mrr"];
11
- export declare const toInvoicingSubscriptionSortKey: (v: string) => "status" | "customer" | "subscription" | "plan" | "product_code" | "term_end" | "next_billing" | "auto_collect" | "mrr";
10
+ export declare const ALL_INVOICING_SUBSCRIPTION_SORT_KEYS: readonly ["subscription", "customer", "plan", "term_end", "next_billing", "auto_collect", "status", "mrr"];
11
+ export declare const toInvoicingSubscriptionSortKey: (v: string) => "status" | "customer" | "subscription" | "plan" | "term_end" | "next_billing" | "auto_collect" | "mrr";
12
12
  export type InvoicingSubscriptionSortKey = ReturnType<typeof toInvoicingSubscriptionSortKey>;
13
13
  /**
14
14
  * Structural column descriptor owned by CES so the subscription-list column set,
@@ -6,7 +6,6 @@ exports.ALL_INVOICING_SUBSCRIPTION_SORT_KEYS = [
6
6
  'subscription',
7
7
  'customer',
8
8
  'plan',
9
- 'product_code',
10
9
  'term_end',
11
10
  'next_billing',
12
11
  'auto_collect',
@@ -19,7 +18,6 @@ exports.INVOICING_SUBSCRIPTION_COLUMNS = [
19
18
  { key: 'subscription', sortable: true },
20
19
  { key: 'customer', sortable: false },
21
20
  { key: 'plan', sortable: true },
22
- { key: 'product_code', sortable: true },
23
21
  { key: 'term_end', sortable: true },
24
22
  { key: 'next_billing', sortable: true },
25
23
  { key: 'auto_collect', sortable: true },
@@ -9,7 +9,6 @@ export interface IssueCreditNoteLineItemRequest {
9
9
  amount?: number;
10
10
  entity_type?: string;
11
11
  id?: string;
12
- product_code?: string;
13
12
  }
14
13
  export interface IssueCreditNoteRequest {
15
14
  line_items: IssueCreditNoteLineItemRequest[];
@@ -14,6 +14,7 @@ export interface InvoicingBrandingFormLocalData {
14
14
  dateFormat: string;
15
15
  defaultMemo: string;
16
16
  email: string;
17
+ invoiceFooterText: string;
17
18
  invoicePrefix: string;
18
19
  logoFileId: string;
19
20
  phone: string;
@@ -10,6 +10,7 @@ exports.initialInvoicingBrandingFormLocalData = {
10
10
  dateFormat: '',
11
11
  defaultMemo: '',
12
12
  email: '',
13
+ invoiceFooterText: '',
13
14
  invoicePrefix: '',
14
15
  logoFileId: '',
15
16
  phone: '',
@@ -22,6 +23,7 @@ const entityToInvoicingBrandingFormLocalData = (settings) => ({
22
23
  dateFormat: settings?.date_format ?? '',
23
24
  defaultMemo: settings?.default_memo ?? '',
24
25
  email: settings?.email ?? '',
26
+ invoiceFooterText: settings?.invoice_footer_text ?? '',
25
27
  invoicePrefix: settings?.invoice_prefix ?? '',
26
28
  logoFileId: settings?.logo_file_id ?? '',
27
29
  phone: settings?.phone ?? '',
@@ -43,6 +45,9 @@ const brandingLocalDataToSettingsPayload = (localData, address) => ({
43
45
  date_format: trimOrUndefined(localData.dateFormat),
44
46
  default_memo: trimOrUndefined(localData.defaultMemo),
45
47
  email: trimOrUndefined(localData.email),
48
+ // Sent even when blank: "" is how the API is told to hide the footer line,
49
+ // so this one must not collapse to `undefined` like the fields above.
50
+ invoice_footer_text: localData.invoiceFooterText.trim(),
46
51
  invoice_prefix: trimOrUndefined(localData.invoicePrefix),
47
52
  logo_file_id: localData.logoFileId,
48
53
  phone: trimOrUndefined(localData.phone),
@@ -1,6 +1,6 @@
1
1
  import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
2
2
  import { FetchState, FetchStateAndError } from '../../../commonStateTypes/common';
3
- import { InvoicingDunningActionOption, InvoicingNamedOption, InvoicingQboAccountMappingKindOption, InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
3
+ import { InvoicingDunningActionOption, InvoicingFieldHelpByCode, InvoicingNamedOption, InvoicingQboAccountMappingKindOption, InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
4
4
  import { ZeniAPIStatus } from '../../../responsePayload';
5
5
  import { RootState } from '../../../rootStateTypes';
6
6
  import { InvoicingQboConnection, InvoicingQboSyncHealth } from '../invoicingQboView/invoicingQboViewPayload';
@@ -20,6 +20,7 @@ export declare const getInvoicingSettings: (state: RootState) => InvoicingSettin
20
20
  export declare const getInvoicingSettingsFetchState: (state: RootState) => FetchStateAndError;
21
21
  export interface InvoicingSettingsView {
22
22
  fetchState: FetchState;
23
+ fieldHelp: InvoicingFieldHelpByCode;
23
24
  saveState: FetchStateAndError;
24
25
  stripeConnectState: FetchStateAndError;
25
26
  error?: ZeniAPIStatus;
@@ -56,6 +57,7 @@ export interface InvoicingSettingsHubView {
56
57
  */
57
58
  configFetchState: FetchState;
58
59
  dunningScheduleActionOptions: InvoicingDunningActionOption[];
60
+ fieldHelp: InvoicingFieldHelpByCode;
59
61
  isEnablingInvoicing: boolean;
60
62
  /**
61
63
  * Whether the tenant has already enabled invoicing. The enable footer is for
@@ -95,6 +97,7 @@ export interface InvoicingQboSettingsFormView {
95
97
  /** So the screen can fetch only what is missing, without reading the slices. */
96
98
  configFetchState: FetchState;
97
99
  customerMatchingOptions: InvoicingNamedOption[];
100
+ fieldHelp: InvoicingFieldHelpByCode;
98
101
  isLoading: boolean;
99
102
  /** The persisted sync toggle — the backfill guard checks that, not the draft. */
100
103
  isSyncEnabledSaved: boolean;
@@ -120,6 +123,7 @@ export interface InvoicingQboSettingsFormView {
120
123
  export declare const getInvoicingQboSettingsFormView: (state: RootState) => InvoicingQboSettingsFormView;
121
124
  export interface InvoicingBrandingFormView {
122
125
  dateFormatOptions: InvoicingNamedOption[];
126
+ fieldHelp: InvoicingFieldHelpByCode;
123
127
  localData: InvoicingBrandingFormLocalData;
124
128
  saveState: FetchStateAndError;
125
129
  addressLabel?: string;
@@ -32,6 +32,7 @@ exports.getInvoicingSettingsFetchState = getInvoicingSettingsFetchState;
32
32
  const getInvoicingSettingsView = (state) => {
33
33
  const { error, fetchState, saveFetchState, settings, stripeFetchState } = state.invoicingSettingsViewState;
34
34
  return {
35
+ fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
35
36
  error,
36
37
  fetchState,
37
38
  saveState: saveFetchState,
@@ -85,6 +86,7 @@ const getInvoicingSettingsHubView = (state) => {
85
86
  const { dunningScheduleActionOptions, enableState, error: configError, fetchState: configFetchState, qboAccountMappingKindOptions, qboCustomerMatchingOptions, qboSyncStatusOptions, status, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
86
87
  const { canEnable, isQboConfigured, isStripeConnected } = deriveInvoicingEnablePrerequisites(state.invoicingSettingsViewState.settings, state.invoicingQboViewState.connection?.connected === true, qboAccountMappingKindOptions);
87
88
  return {
89
+ fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
88
90
  // Keeps the onboarding step in the gate: a tenant that has not accepted the
89
91
  // terms cannot enable invoicing, whatever the integrations say.
90
92
  canEnableInvoicing: status === 'settings' && canEnable,
@@ -116,6 +118,7 @@ const getInvoicingQboSettingsFormView = (state) => {
116
118
  const { fetchState: configFetchState, qboAccountMappingKindOptions, qboCustomerMatchingOptions, qboSyncStatusOptions, } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
117
119
  const qboView = (0, invoicingQboViewSelector_1.getInvoicingQboView)(state);
118
120
  return {
121
+ fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
119
122
  accountMappingKindOptions: qboAccountMappingKindOptions,
120
123
  accounts: qboView.accounts,
121
124
  backfillState: qboView.backfillState,
@@ -156,6 +159,7 @@ const getInvoicingBrandingFormView = (state) => {
156
159
  ? (0, addressViewSelector_1.getFormattedAddress)(newAddress.addressToCreate)
157
160
  : undefined;
158
161
  return {
162
+ fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
159
163
  addressLabel,
160
164
  dateFormatOptions: (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state).dateFormatOptions,
161
165
  localData: brandingDraft ?? (0, invoicingBrandingFormConfig_1.entityToInvoicingBrandingFormLocalData)(settings),
@@ -18,6 +18,14 @@ export type PauseSubscriptionBody = {
18
18
  pause_reason?: string;
19
19
  resume_date?: string;
20
20
  };
21
+ /**
22
+ * What the cancel dialog collects. Form values, not the request body: the screen
23
+ * turns these into {@link CancelSubscriptionBody}.
24
+ */
25
+ export type InvoicingCancelSubscriptionValues = {
26
+ cancelReasonCode: string;
27
+ cancelReason?: string;
28
+ };
21
29
  export type CancelSubscriptionBody = {
22
30
  cancel_reason?: string;
23
31
  cancel_reason_code?: string;
@@ -12,4 +12,38 @@ interface FetchRecommendationPayloadWithCOT {
12
12
  recommendations: RecommendationPayloadWithCOT[];
13
13
  }
14
14
  export type FetchRecommendationResponseWithCOT = ZeniAPIResponse<FetchRecommendationPayloadWithCOT>;
15
+ export type RecommendationFeedbackDimension = 'vendor' | 'category' | 'class';
16
+ export type RecommendationFeedbackSource = 'primary' | 'alternate' | 'shadow' | 'qbo';
17
+ export type RecommendationFeedbackOutcome = 'accepted' | 'override_ranked' | 'override_outside' | 'retracted';
18
+ export interface RecommendationFeedbackValue {
19
+ name: string;
20
+ id?: string | null;
21
+ integrationId?: string | null;
22
+ }
23
+ export interface ShownRecommendationForFeedback {
24
+ rank: number;
25
+ source: RecommendationFeedbackSource;
26
+ value: RecommendationFeedbackValue;
27
+ confidence?: number | null;
28
+ cot?: string[];
29
+ reasoning?: string | null;
30
+ }
31
+ export interface SubmitRecommendationFeedbackPayload {
32
+ dimension: RecommendationFeedbackDimension;
33
+ outcome: RecommendationFeedbackOutcome;
34
+ selected: RecommendationFeedbackValue & {
35
+ isNewEntity?: boolean;
36
+ };
37
+ transactionId: string;
38
+ features?: Record<string, unknown> | null;
39
+ lineId?: string | null;
40
+ matchedRank?: number | null;
41
+ matchedSource?: RecommendationFeedbackSource | null;
42
+ reasonText?: string | null;
43
+ recommendationSetId?: string | null;
44
+ retractsFeedbackId?: string | null;
45
+ shownRecommendations?: ShownRecommendationForFeedback[];
46
+ skipped?: boolean;
47
+ topPickSource?: RecommendationFeedbackSource | null;
48
+ }
15
49
  export {};