@zeniai/client-epic-state 5.0.81-betaAR3 → 5.0.81-betaAS2

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 (69) hide show
  1. package/lib/entity/approvalRule/approvalRulePayload.d.ts +5 -34
  2. package/lib/entity/approvalRule/approvalRulePayload.js +10 -130
  3. package/lib/entity/approvalRule/approvalRuleSelector.d.ts +1 -25
  4. package/lib/entity/approvalRule/approvalRuleSelector.js +0 -40
  5. package/lib/entity/approvalRule/approvalRuleState.d.ts +7 -59
  6. package/lib/entity/tenant/tenantPayload.d.ts +3 -0
  7. package/lib/entity/tenant/tenantReducer.d.ts +1 -1
  8. package/lib/entity/tenant/tenantReducer.js +23 -3
  9. package/lib/entity/tenant/tenantState.d.ts +3 -0
  10. package/lib/epic.d.ts +3 -1
  11. package/lib/epic.js +3 -1
  12. package/lib/esm/entity/approvalRule/approvalRulePayload.js +10 -130
  13. package/lib/esm/entity/approvalRule/approvalRuleSelector.js +0 -35
  14. package/lib/esm/entity/tenant/tenantReducer.js +22 -2
  15. package/lib/esm/epic.js +3 -1
  16. package/lib/esm/index.js +6 -7
  17. package/lib/esm/view/dashboard/dashboardReducer.js +1 -5
  18. package/lib/esm/view/dashboard/dashboardSelector.js +1 -2
  19. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +11 -29
  20. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +2 -11
  21. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +4 -9
  22. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +7 -11
  23. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +4 -14
  24. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +16 -121
  25. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -7
  26. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +2 -11
  27. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -9
  28. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +7 -11
  29. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +4 -14
  30. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +10 -28
  31. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +18 -0
  32. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +18 -0
  33. package/lib/esm/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +45 -1
  34. package/lib/index.d.ts +7 -8
  35. package/lib/index.js +33 -38
  36. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  37. package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
  38. package/lib/view/dashboard/dashboardReducer.d.ts +1 -1
  39. package/lib/view/dashboard/dashboardReducer.js +2 -6
  40. package/lib/view/dashboard/dashboardSelector.d.ts +0 -1
  41. package/lib/view/dashboard/dashboardSelector.js +1 -2
  42. package/lib/view/dashboard/dashboardState.d.ts +0 -1
  43. package/lib/view/people/peopleTypes.d.ts +1 -1
  44. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.d.ts +3 -7
  45. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +11 -29
  46. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +2 -11
  47. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +4 -9
  48. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +6 -10
  49. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +3 -13
  50. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +1 -48
  51. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +17 -123
  52. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +5 -31
  53. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -7
  54. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  55. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +2 -11
  56. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -9
  57. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +6 -10
  58. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +3 -13
  59. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.d.ts +3 -7
  60. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +10 -28
  61. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +8 -0
  62. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +22 -0
  63. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +8 -0
  64. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +22 -0
  65. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
  66. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +46 -2
  67. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +2 -0
  68. package/lib/view/taskManager/taskListView/taskList.d.ts +3 -3
  69. package/package.json +2 -1
@@ -45,7 +45,7 @@ const tenantSelector = (0, toolkit_1.createSelector)(tenantSelector_1.getTenants
45
45
  exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalanceSelector_1.getCardBalance, cashBalanceSelector_1.getCashBalance, getOperatingExpensesForLast5Periods, getRevenueForLast4Periods, topExSelector_1.getTop6Expenses, getNetBurnOrIncomeForLast4Periods, getNetBurnOrIncomeStoryCard, getCashPositionLast5Periods, getCashInCashOutLast4Periods, insightsCardSelector_1.getInsights, companyPassportViewSelector_1.getCompanyPassportView, tasksCardSelector_1.getTasksCardReport, billPayCardSelector_1.getBillPayCardReport, reimbursementCardSelector_1.getReimbursementCardReport, apAgingSelector, arAgingSelector, zeniAccountsPromoCardSelector_1.getZeniAccountsPromoCard, referralSelector_1.getRewardsPlanCard, dashboardLayoutSelector_1.getDashboardCardsOrdered, (state) => {
46
46
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
47
47
  return (0, monthEndCloseChecksViewSelector_1.getMonthEndCloseChecksViewByTenantId)(state, currentTenant.tenantId);
48
- }, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (_state, _additionalExcludedReports, signedInUser) => signedInUser, (_state, _excluded, _signedInUser, isExpenseAutomationFeatureEnabledV2) => isExpenseAutomationFeatureEnabledV2, (_state, _excluded, _signedInUser, _enabledV2, isExpenseAutomationFeatureEnabled) => isExpenseAutomationFeatureEnabled, (_state, _excluded, _signedInUser, _enabledV2, _enabled, isTreasuryFeatureEnabled) => isTreasuryFeatureEnabled, (state) => state.dashboardState.isTreasuryVideoClosed, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, cards, monthEndCloseChecksView, tenantState, additionalExcludedReports, signedInUser, isExpenseAutomationFeatureEnabledV2, isExpenseAutomationFeatureEnabled, isTreasuryFeatureEnabled, isTreasuryVideoClosed) => {
48
+ }, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (_state, _additionalExcludedReports, signedInUser) => signedInUser, (_state, _excluded, _signedInUser, isExpenseAutomationFeatureEnabledV2) => isExpenseAutomationFeatureEnabledV2, (_state, _excluded, _signedInUser, _enabledV2, isExpenseAutomationFeatureEnabled) => isExpenseAutomationFeatureEnabled, (_state, _excluded, _signedInUser, _enabledV2, _enabled, isTreasuryFeatureEnabled) => isTreasuryFeatureEnabled, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, cards, monthEndCloseChecksView, tenantState, additionalExcludedReports, signedInUser, isExpenseAutomationFeatureEnabledV2, isExpenseAutomationFeatureEnabled, isTreasuryFeatureEnabled) => {
49
49
  const isReimbursementFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
50
50
  .isReimbursementFeatureEnabled;
51
51
  const isBillPayFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
@@ -276,6 +276,5 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
276
276
  ...tenants,
277
277
  reportsInOrder,
278
278
  cardsForDashboardUI: cardsCopy,
279
- isTreasuryVideoClosed,
280
279
  };
281
280
  });
@@ -2,6 +2,5 @@ import { ReportID } from '../../commonStateTypes/viewAndReport/viewAndReport';
2
2
  import { ZeniDate } from '../../zeniDayJS';
3
3
  export type CardType = ReportID | 'information_card' | 'zeni_promo_card' | 'expense_automation_card' | 'rewards_card';
4
4
  export interface DashboardState {
5
- isTreasuryVideoClosed: boolean;
6
5
  lastFetchRequestTime?: ZeniDate;
7
6
  }
@@ -1,3 +1,3 @@
1
- declare const toPeopleSortKeyType: (v: string) => "role" | "manager" | "department" | "name" | "lastSeen";
1
+ declare const toPeopleSortKeyType: (v: string) => "role" | "manager" | "name" | "department" | "lastSeen";
2
2
  export type PeopleViewSortKey = ReturnType<typeof toPeopleSortKeyType>;
3
3
  export {};
@@ -2,10 +2,9 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
2
2
  import { BillPaySetupApproverViewState } from './billPaySetupApproverViewState';
3
3
  import { ApprovalRuleCreateData, ApprovalRuleUpdateData } from './types/commonState';
4
4
  export declare const initialState: BillPaySetupApproverViewState;
5
- export declare const fetchBillPaySetupApproverView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any, includeUserRoles?: any, useV3?: any], {
5
+ export declare const fetchBillPaySetupApproverView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any, includeUserRoles?: any], {
6
6
  cacheOverride: any;
7
7
  includeUserRoles: any;
8
- useV3: any;
9
8
  }, "billPaySetupApproverView/fetchBillPaySetupApproverView", never, never>, fetchBillPaySetupApproverViewSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleIds: string[]], {
10
9
  approvalRuleIds: string[];
11
10
  }, "billPaySetupApproverView/fetchBillPaySetupApproverViewSuccess", never, never>, fetchBillPaySetupApproverViewFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "billPaySetupApproverView/fetchBillPaySetupApproverViewFailure", never, never>, fetchBillPayApproversDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any, includeUserRoles?: any], {
@@ -19,18 +18,15 @@ export declare const fetchBillPaySetupApproverView: import("@reduxjs/toolkit").A
19
18
  attributes: ("manager" | "vendor_owner" | "manager_of_manager")[];
20
19
  }, "billPaySetupApproverView/fetchBillPayApproversListSuccess", never, never>, fetchBillPayApproversListFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>], {
21
20
  status: ZeniAPIStatus<Record<string, unknown>>;
22
- }, "billPaySetupApproverView/fetchBillPayApproversListFailure", never, never>, deleteBillPayApprovalRule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleId: string, useV3?: any], {
21
+ }, "billPaySetupApproverView/fetchBillPayApproversListFailure", never, never>, deleteBillPayApprovalRule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleId: string], {
23
22
  approvalRuleId: string;
24
- useV3: any;
25
23
  }, "billPaySetupApproverView/deleteBillPayApprovalRule", never, never>, deleteBillPayApprovalRuleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[deletedApprovalRuleId: string, approvalRuleIds: string[]], {
26
24
  deletedApprovalRuleId: string;
27
25
  approvalRuleIds: string[];
28
26
  }, "billPaySetupApproverView/deleteBillPayApprovalRuleSuccess", never, never>, deleteBillPayApprovalRuleFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
29
27
  approvalRuleId: string;
30
28
  status: ZeniAPIStatus<Record<string, unknown>>;
31
- }, "billPaySetupApproverView/deleteBillPayApprovalRuleFailure", never, never>, saveBillPaySetupApproverViewUpdates: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[useV3: boolean], {
32
- useV3: boolean;
33
- }, "billPaySetupApproverView/saveBillPaySetupApproverViewUpdates", never, never>, saveBillPaySetupApproverViewUpdatesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleIds: string[], affectedEntityIds?: string[] | undefined, newApprovalRuleId?: string | undefined], {
29
+ }, "billPaySetupApproverView/deleteBillPayApprovalRuleFailure", never, never>, saveBillPaySetupApproverViewUpdates: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"billPaySetupApproverView/saveBillPaySetupApproverViewUpdates">, saveBillPaySetupApproverViewUpdatesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleIds: string[], affectedEntityIds?: string[] | undefined, newApprovalRuleId?: string | undefined], {
34
30
  approvalRuleIds: string[];
35
31
  affectedEntityIds: string[] | undefined;
36
32
  newApprovalRuleId: string | undefined;
@@ -30,11 +30,8 @@ const billPaySetupApproverView = (0, toolkit_1.createSlice)({
30
30
  draft.fetchState = 'In-Progress';
31
31
  draft.error = undefined;
32
32
  },
33
- // Approval Rules 3.0 `useV3` arrives from the screen connector
34
- // (`approval_rule_v3_config` dynamic config) and picks the v1 vs
35
- // v2 endpoint in the fetch epic.
36
- prepare(cacheOverride = false, includeUserRoles = true, useV3 = false) {
37
- return { payload: { cacheOverride, includeUserRoles, useV3 } };
33
+ prepare(cacheOverride = false, includeUserRoles = true) {
34
+ return { payload: { cacheOverride, includeUserRoles } };
38
35
  },
39
36
  },
40
37
  fetchBillPaySetupApproverViewSuccess: {
@@ -119,11 +116,8 @@ const billPaySetupApproverView = (0, toolkit_1.createSlice)({
119
116
  error: undefined,
120
117
  };
121
118
  },
122
- // Approval Rules 3.0 — `useV3` flows from the screen connector
123
- // (`approval_rule_v3_config` dynamic config) so the delete epic
124
- // can pick the v1 vs v2 endpoint.
125
- prepare(approvalRuleId, useV3 = false) {
126
- return { payload: { approvalRuleId, useV3 } };
119
+ prepare(approvalRuleId) {
120
+ return { payload: { approvalRuleId } };
127
121
  },
128
122
  },
129
123
  deleteBillPayApprovalRuleSuccess: {
@@ -155,25 +149,13 @@ const billPaySetupApproverView = (0, toolkit_1.createSlice)({
155
149
  };
156
150
  },
157
151
  },
158
- saveBillPaySetupApproverViewUpdates: {
159
- // Approval Rules 3.0 `useV3` is sourced from the
160
- // `approval_rule_v3_config` dynamic config in the screen
161
- // connector. The reducer doesn't read it (the field only
162
- // matters in the save epic), but it must be declared so the
163
- // action's payload type is correctly inferred for downstream
164
- // consumers.
165
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
166
- reducer(draft, _action) {
167
- if (draft.billPaySetupApproverViewUpdateData != null) {
168
- draft.billPaySetupApproverViewUpdateData.updateStatus = {
169
- fetchState: 'In-Progress',
170
- error: undefined,
171
- };
172
- }
173
- },
174
- prepare(useV3) {
175
- return { payload: { useV3 } };
176
- },
152
+ saveBillPaySetupApproverViewUpdates(draft) {
153
+ if (draft.billPaySetupApproverViewUpdateData != null) {
154
+ draft.billPaySetupApproverViewUpdateData.updateStatus = {
155
+ fetchState: 'In-Progress',
156
+ error: undefined,
157
+ };
158
+ }
177
159
  },
178
160
  saveBillPaySetupApproverViewUpdatesSuccess: {
179
161
  reducer(draft, action) {
@@ -9,18 +9,9 @@ const userReducer_1 = require("../../../../../entity/user/userReducer");
9
9
  const responsePayload_1 = require("../../../../../responsePayload");
10
10
  const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
11
11
  const deleteBillPayApprovalRuleEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.deleteBillPayApprovalRule.match), (0, operators_1.switchMap)((action) => {
12
- const { approvalRuleId, useV3 } = action.payload;
13
- // Approval Rules 3.0 — flag-gated endpoint selection.
14
- // Explicit `=== true` keeps `strict-boolean-expressions` happy
15
- // when RTK's payload type widens to `any` in some configs.
16
- const endpoint = useV3 === true
17
- ? // ? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2`
18
- `https://dev.api.zeni.ai/version/approval/tarun/1.0/bill-pay/approval-rules-v2`
19
- : `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`;
12
+ const { approvalRuleId } = action.payload;
20
13
  return zeniAPI
21
- .deleteAndGetJSON(endpoint, {
22
- approval_rule_id: approvalRuleId,
23
- })
14
+ .deleteAndGetJSON(`${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`, { approval_rule_id: approvalRuleId })
24
15
  .pipe((0, operators_1.mergeMap)((response) => {
25
16
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
26
17
  const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
@@ -9,7 +9,7 @@ const userReducer_1 = require("../../../../../entity/user/userReducer");
9
9
  const responsePayload_1 = require("../../../../../responsePayload");
10
10
  const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
11
11
  const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView.match), (0, operators_1.switchMap)((action) => {
12
- const { cacheOverride, useV3 } = action.payload;
12
+ const { cacheOverride } = action.payload;
13
13
  const { billPaySetupApproverViewState, approvalRuleState } = state$.value;
14
14
  const approvalRules = (0, approvalRuleSelector_1.getApprovalRulesByIds)(approvalRuleState, billPaySetupApproverViewState.approvalRuleIds);
15
15
  if (cacheOverride === true ||
@@ -17,14 +17,9 @@ const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) => actions
17
17
  billPaySetupApproverViewState.approvalRuleIds.length ||
18
18
  (billPaySetupApproverViewState.hasValidState() === false &&
19
19
  billPaySetupApproverViewState.fetchState !== 'In-Progress')) {
20
- // Approval Rules 3.0 — flag-gated endpoint selection.
21
- // Explicit `=== true` keeps `strict-boolean-expressions` happy
22
- // when RTK's payload type widens to `any` in some configs.
23
- const endpoint = useV3 === true
24
- ? // ? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2`
25
- `https://dev.api.zeni.ai/version/approval/tarun/1.0/bill-pay/approval-rules-v2`
26
- : `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`;
27
- return zeniAPI.getJSON(endpoint).pipe((0, operators_1.mergeMap)((response) => {
20
+ return zeniAPI
21
+ .getJSON(`${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`)
22
+ .pipe((0, operators_1.mergeMap)((response) => {
28
23
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
29
24
  const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
30
25
  const actions = [
@@ -11,20 +11,16 @@ const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state$) => a
11
11
  if (approvalRuleId != null) {
12
12
  const approvalRule = (0, approvalRuleSelector_1.getApprovalRuleById)(state$.value.approvalRuleState, approvalRuleId);
13
13
  if (approvalRule != null) {
14
+ const criteria = approvalRule.criteria[0];
15
+ const range = criteria?.range;
14
16
  const billPaySetupApproverViewUpdateData = {
15
17
  approvalRuleId,
16
18
  steps: approvalRule.steps,
17
19
  criteria: {
18
- amount: (0, approvalRuleSelector_1.getAmountCriteria)(approvalRule.criteria),
19
- vendor: (0, approvalRuleSelector_1.getVendorCriteria)(approvalRule.criteria),
20
- department: (0, approvalRuleSelector_1.getDepartmentCriteria)(approvalRule.criteria),
20
+ rangeType: criteria?.rangeType,
21
+ rangeEntity: criteria?.rangeEntity,
22
+ range,
21
23
  },
22
- // Approval Rules 3.0 — seed rule-level fields so the form can
23
- // round-trip them on edit. Each may be undefined on legacy rules.
24
- name: approvalRule.name,
25
- description: approvalRule.description,
26
- separationOfDuties: approvalRule.separationOfDuties,
27
- isFallback: approvalRule.isFallback,
28
24
  };
29
25
  fetchActions.push((0, billPaySetupApproverViewReducer_1.clearBillPaySetupApproverViewUpdateData)(), (0, billPaySetupApproverViewReducer_1.saveBillPaySetupApproverViewUpdateData)(billPaySetupApproverViewUpdateData));
30
26
  }
@@ -32,7 +28,7 @@ const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state$) => a
32
28
  else {
33
29
  const billPaySetupApproverViewCreateData = {
34
30
  steps: [],
35
- criteria: {},
31
+ criteria: undefined,
36
32
  };
37
33
  fetchActions.push((0, billPaySetupApproverViewReducer_1.clearBillPaySetupApproverViewUpdateData)(), (0, billPaySetupApproverViewReducer_1.saveBillPaySetupApproverViewUpdateData)(billPaySetupApproverViewCreateData));
38
34
  }
@@ -9,24 +9,14 @@ const userReducer_1 = require("../../../../../entity/user/userReducer");
9
9
  const responsePayload_1 = require("../../../../../responsePayload");
10
10
  const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
11
11
  const commonPayload_1 = require("../types/commonPayload");
12
- const saveBillPaySetupApproverViewUpdatesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.saveBillPaySetupApproverViewUpdates.match), (0, operators_1.switchMap)((action) => {
12
+ const saveBillPaySetupApproverViewUpdatesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.saveBillPaySetupApproverViewUpdates.match), (0, operators_1.switchMap)(() => {
13
13
  const { billPaySetupApproverViewState } = state$.value;
14
14
  const billPaySetupApproverViewUpdateData = billPaySetupApproverViewState.billPaySetupApproverViewUpdateData;
15
15
  if (billPaySetupApproverViewUpdateData != null &&
16
16
  billPaySetupApproverViewUpdateData.data != null) {
17
- // Approval Rules 3.0 — gate URL + write-side payload mapper on
18
- // the `approval_rule_v3_config` dynamic config. `useV3` arrives
19
- // on the action payload from the screen connector.
20
- const { useV3 } = action.payload;
21
- const payload = useV3
22
- ? (0, commonPayload_1.toApprovalChangableInfoPayload)(billPaySetupApproverViewUpdateData.data)
23
- : (0, commonPayload_1.toApprovalChangableInfoPayloadV1)(billPaySetupApproverViewUpdateData.data);
24
- const endpoint = useV3
25
- ? // ? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2`
26
- `https://dev.api.zeni.ai/version/approval/tarun/1.0/bill-pay/approval-rules-v2`
27
- : `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`;
17
+ const payload = (0, commonPayload_1.toApprovalChangableInfoPayload)(billPaySetupApproverViewUpdateData.data);
28
18
  return zeniAPI
29
- .postAndGetJSON(endpoint, payload)
19
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`, payload)
30
20
  .pipe((0, operators_1.mergeMap)((response) => {
31
21
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
32
22
  const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
@@ -14,56 +14,9 @@ interface ApproverViewStepPayload extends Omit<StepPayload, 'actors'> {
14
14
  }
15
15
  interface ApprovalUpdatableInfoPayload {
16
16
  approval_rule_id: ID;
17
- criteria: CriteriaPayload;
17
+ criteria: CriteriaPayload[];
18
18
  is_applicable_on_pending_approval_entity: boolean;
19
19
  steps: ApproverViewStepPayload[];
20
- description?: string;
21
- is_fallback?: boolean;
22
- /**
23
- * Approval Rules 3.0 — rule-level wire fields. The backend accepts these
24
- * as optional today; once 3.0 ships they become first-class.
25
- */
26
- name?: string;
27
- separation_of_duties?: boolean;
28
- }
29
- /**
30
- * V1 / pre-3.0 wire shape. Kept so the rollback flag (gated by
31
- * `approval_rule_v3_config` dynamic config) can target the original
32
- * `/approval-rules` endpoint with the legacy `{rangeType, rangeEntity, range}`
33
- * criteria. None of the 3.0 rule-level fields are sent.
34
- */
35
- interface ApprovalUpdatableInfoPayloadV1 {
36
- criteria: {
37
- range: {
38
- max: {
39
- amount: number;
40
- currencyCode: string;
41
- currencySymbol: string;
42
- };
43
- min: {
44
- amount: number;
45
- currencyCode: string;
46
- currencySymbol: string;
47
- };
48
- };
49
- rangeEntity: 'currency';
50
- rangeType: 'range';
51
- };
52
- is_applicable_on_pending_approval_entity: boolean;
53
- steps: ApproverViewStepPayload[];
54
- approval_rule_id?: ID;
55
20
  }
56
21
  export declare const toApprovalChangableInfoPayload: (approverViewUpdateData: ApprovalRuleUpdateData | ApprovalRuleCreateData) => Partial<ApprovalUpdatableInfoPayload>;
57
- /**
58
- * V1 wire mapper — used when `approval_rule_v3_config` resolves to OFF
59
- * for the current tenant. Translates the form-side amount criteria into
60
- * the legacy `{rangeType, rangeEntity, range: {min, max}}` shape. The
61
- * V1 backend does not understand vendor / department criteria or the
62
- * rule-level 3.0 fields, so those are dropped on the wire.
63
- *
64
- * The form-side amount slot is always read as a `range`-style criteria
65
- * here: V1 schemas only supported ranges, so an absent `min` or `max`
66
- * falls back to `0` / `Number.MAX_SAFE_INTEGER`.
67
- */
68
- export declare const toApprovalChangableInfoPayloadV1: (approverViewUpdateData: ApprovalRuleUpdateData | ApprovalRuleCreateData) => Partial<ApprovalUpdatableInfoPayloadV1>;
69
22
  export {};
@@ -1,51 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toApprovalChangableInfoPayloadV1 = exports.toApprovalChangableInfoPayload = void 0;
3
+ exports.toApprovalChangableInfoPayload = void 0;
4
4
  const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
5
- // Form-side criteria is a structured object with optional slots for
6
- // amount / vendor / department; flatten it into the wire format's
7
- // `conditions[]` array.
8
- let criteriaPayload;
5
+ let criteriaPayload = [];
9
6
  if (approverViewUpdateData.criteria != null) {
10
- const { amount, vendor, department } = approverViewUpdateData.criteria;
11
- const conditions = [];
12
- if (amount?.min != null) {
13
- conditions.push({
14
- field: 'amount',
15
- type: 'gte',
16
- value: amount.min.amount,
17
- });
18
- }
19
- if (amount?.max != null) {
20
- conditions.push({
21
- field: 'amount',
22
- type: 'lte',
23
- value: amount.max.amount,
24
- });
25
- }
26
- if (vendor != null && vendor.vendorIds.length > 0) {
27
- conditions.push({
28
- field: 'vendor_id',
29
- type: vendor.operator === 'is_not' ? 'not_in' : 'in',
30
- value: vendor.vendorIds,
31
- });
32
- }
33
- if (department != null && department.departmentIds.length > 0) {
34
- conditions.push({
35
- field: 'department_id',
36
- type: department.operator === 'is_not' ? 'not_in' : 'in',
37
- value: department.departmentIds,
38
- });
39
- }
40
- if (conditions.length > 0) {
41
- const currency = amount?.min ?? amount?.max ?? null;
42
- criteriaPayload = {
43
- conditions,
44
- criteria_operator: 'and',
45
- currency_code: currency?.currencyCode ?? 'USD',
46
- currency_symbol: currency?.currencySymbol ?? '$',
47
- };
48
- }
7
+ const criteria = approverViewUpdateData.criteria;
8
+ const { rangeType, rangeEntity, range } = criteria;
9
+ const { min, max } = range;
10
+ const { currencyCode, currencySymbol } = min;
11
+ criteriaPayload = [
12
+ {
13
+ type: rangeType,
14
+ range_entity: rangeEntity,
15
+ min: min.amount,
16
+ max: max?.amount ?? null,
17
+ currency_code: currencyCode,
18
+ currency_symbol: currencySymbol,
19
+ },
20
+ ];
49
21
  }
50
22
  const steps = approverViewUpdateData.steps.map((step) => {
51
23
  return {
@@ -66,91 +38,13 @@ const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
66
38
  });
67
39
  const isUpdate = approverViewUpdateData.approvalRuleId != null;
68
40
  const payload = {
41
+ criteria: criteriaPayload,
69
42
  steps,
70
43
  is_applicable_on_pending_approval_entity: approverViewUpdateData.isApplicableOnPendingApprovalEntity ?? true,
71
44
  };
72
- if (criteriaPayload != null) {
73
- payload.criteria = criteriaPayload;
74
- }
75
- // Approval Rules 3.0 — surface rule-level fields when the form set them.
76
- // Send only what the user actually entered: an undefined value means
77
- // "no opinion" and stays off the wire.
78
- if (approverViewUpdateData.name != null) {
79
- payload.name = approverViewUpdateData.name;
80
- }
81
- if (approverViewUpdateData.description != null) {
82
- payload.description = approverViewUpdateData.description;
83
- }
84
- if (approverViewUpdateData.separationOfDuties != null) {
85
- payload.separation_of_duties = approverViewUpdateData.separationOfDuties;
86
- }
87
- if (approverViewUpdateData.isFallback != null) {
88
- payload.is_fallback = approverViewUpdateData.isFallback;
89
- }
90
45
  if (isUpdate) {
91
46
  payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
92
47
  }
93
48
  return payload;
94
49
  };
95
50
  exports.toApprovalChangableInfoPayload = toApprovalChangableInfoPayload;
96
- /**
97
- * V1 wire mapper — used when `approval_rule_v3_config` resolves to OFF
98
- * for the current tenant. Translates the form-side amount criteria into
99
- * the legacy `{rangeType, rangeEntity, range: {min, max}}` shape. The
100
- * V1 backend does not understand vendor / department criteria or the
101
- * rule-level 3.0 fields, so those are dropped on the wire.
102
- *
103
- * The form-side amount slot is always read as a `range`-style criteria
104
- * here: V1 schemas only supported ranges, so an absent `min` or `max`
105
- * falls back to `0` / `Number.MAX_SAFE_INTEGER`.
106
- */
107
- const toApprovalChangableInfoPayloadV1 = (approverViewUpdateData) => {
108
- const amount = approverViewUpdateData.criteria?.amount;
109
- const minAmount = amount?.min;
110
- const maxAmount = amount?.max;
111
- const currencyCode = minAmount?.currencyCode ?? maxAmount?.currencyCode ?? 'USD';
112
- const currencySymbol = minAmount?.currencySymbol ?? maxAmount?.currencySymbol ?? '$';
113
- const steps = approverViewUpdateData.steps.map((step) => {
114
- return {
115
- action: step.action,
116
- operator: step.operator,
117
- actors: step.actors
118
- .filter((actor) => actor.subType !== 'admin')
119
- .map((actor) => {
120
- return {
121
- type: actor.type,
122
- id: actor.userId ?? null,
123
- sub_type: actor.subType ?? null,
124
- id_type: actor.idType ?? null,
125
- is_implicit_actor: actor.isImplicitActor ?? false,
126
- };
127
- }),
128
- };
129
- });
130
- const isUpdate = approverViewUpdateData.approvalRuleId != null;
131
- const payload = {
132
- steps,
133
- is_applicable_on_pending_approval_entity: approverViewUpdateData.isApplicableOnPendingApprovalEntity ?? true,
134
- criteria: {
135
- rangeType: 'range',
136
- rangeEntity: 'currency',
137
- range: {
138
- min: {
139
- amount: minAmount?.amount ?? 0,
140
- currencyCode,
141
- currencySymbol,
142
- },
143
- max: {
144
- amount: maxAmount?.amount ?? Number.MAX_SAFE_INTEGER,
145
- currencyCode,
146
- currencySymbol,
147
- },
148
- },
149
- },
150
- };
151
- if (isUpdate) {
152
- payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
153
- }
154
- return payload;
155
- };
156
- exports.toApprovalChangableInfoPayloadV1 = toApprovalChangableInfoPayloadV1;
@@ -1,45 +1,19 @@
1
1
  import { FetchStateAndError, ID } from '../../../../../commonStateTypes/common';
2
- import { AmountCriteria, DepartmentCriteria, Step, VendorCriteria } from '../../../../../entity/approvalRule/approvalRuleState';
2
+ import { Criteria, Step } from '../../../../../entity/approvalRule/approvalRuleState';
3
3
  export type ApprovalUpdateActionType = 'approval_create' | 'approval_update';
4
4
  export interface ApproverViewUpdateData {
5
5
  type: ApprovalUpdateActionType;
6
6
  updateStatus: FetchStateAndError;
7
7
  data?: ApprovalRuleUpdateData | ApprovalRuleCreateData;
8
8
  }
9
- /**
10
- * Form-side criteria shape used by the rule create/edit form.
11
- *
12
- * Each condition kind gets its own optional slot, mirroring how the UI
13
- * edits them as distinct rows. At most one of each kind is present; this
14
- * matches the design constraint that each condition type can be added once.
15
- */
16
- export interface ApprovalRuleFormCriteria {
17
- amount?: AmountCriteria;
18
- department?: DepartmentCriteria;
19
- vendor?: VendorCriteria;
20
- }
21
- /**
22
- * Rule-level fields shared by both create and update flows.
23
- *
24
- * These come from the 3.0 design: the form now owns a name, an optional
25
- * description, an optional Separation-of-Duties toggle, and a flag that
26
- * marks the rule as the org-wide fallback rule. They live alongside
27
- * criteria/steps but are not part of either.
28
- */
29
- export interface ApprovalRuleFormBase {
30
- description?: string;
31
- isFallback?: boolean;
32
- name?: string;
33
- separationOfDuties?: boolean;
34
- }
35
- export interface ApprovalRuleUpdateData extends ApprovalRuleFormBase {
9
+ export interface ApprovalRuleUpdateData {
36
10
  approvalRuleId: ID;
37
- criteria: ApprovalRuleFormCriteria;
11
+ criteria: Criteria;
38
12
  steps: Step[];
39
13
  isApplicableOnPendingApprovalEntity?: boolean;
40
14
  }
41
- export interface ApprovalRuleCreateData extends ApprovalRuleFormBase {
42
- criteria: ApprovalRuleFormCriteria;
15
+ export interface ApprovalRuleCreateData {
16
+ criteria: Criteria;
43
17
  steps: Step[];
44
18
  isApplicableOnPendingApprovalEntity?: boolean;
45
19
  }
@@ -9,7 +9,6 @@ exports.getPaymentSection = getPaymentSection;
9
9
  exports.toPaymentToOption = toPaymentToOption;
10
10
  const get_1 = __importDefault(require("lodash/get"));
11
11
  const has_1 = __importDefault(require("lodash/has"));
12
- const approvalRuleSelector_1 = require("../../../../entity/approvalRule/approvalRuleSelector");
13
12
  const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
14
13
  const bankAccountSelector_1 = require("../../../../entity/bankAccount/bankAccountSelector");
15
14
  const contactSelector_1 = require("../../../../entity/billPay/contact/contactSelector");
@@ -699,13 +698,9 @@ exports.getDefaultWithdrawFromAccount = getDefaultWithdrawFromAccount;
699
698
  const checkIfCreatorIsApprover = (billAmount, approvalRules, signedInUser) => {
700
699
  let isCreatorAlsoApprover = false;
701
700
  const approvalRule = approvalRules.find((rule) => {
702
- const amountCriteria = (0, approvalRuleSelector_1.getAmountCriteria)(rule.criteria);
703
- if (amountCriteria?.min == null) {
704
- return false;
705
- }
706
- const { min, max } = amountCriteria;
701
+ const { max, min } = rule.criteria[0].range;
707
702
  return (billAmount > min.amount &&
708
- (max?.amount != null ? billAmount <= max.amount : true));
703
+ (max?.amount != null ? billAmount <= max?.amount : true));
709
704
  });
710
705
  if (approvalRule != null) {
711
706
  const requireApprovalSteps = approvalRule.steps.filter((step) => step.action === 'require_approval');
@@ -61,7 +61,7 @@ export declare const initialCreditAcc: CreditAccount;
61
61
  export declare const initialDebitCardSummaries: DebitCardSummaries;
62
62
  export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
63
63
  export declare const initialCreditAccountRepayment: CreditAccountRepayment;
64
- export declare const toChargeCardSortKeyType: (v: string) => "status" | "department" | "accountType" | "owner" | "cardName" | "limit" | "cardType" | "utilisation";
64
+ export declare const toChargeCardSortKeyType: (v: string) => "status" | "accountType" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
65
65
  export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
66
66
  export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
67
67
  export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
@@ -9,18 +9,9 @@ const userReducer_1 = require("../../../../../entity/user/userReducer");
9
9
  const responsePayload_1 = require("../../../../../responsePayload");
10
10
  const remiSetupApproverViewReducer_1 = require("../remiSetupApproverViewReducer");
11
11
  const deleteRemiApprovalRuleEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiSetupApproverViewReducer_1.deleteRemiApprovalRule.match), (0, operators_1.switchMap)((action) => {
12
- const { approvalRuleId, useV3 } = action.payload;
13
- // Approval Rules 3.0 — flag-gated endpoint selection.
14
- // Explicit `=== true` keeps `strict-boolean-expressions` happy
15
- // when RTK's payload type widens to `any` in some configs.
16
- const endpoint = useV3 === true
17
- ? // ? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules-v2`
18
- `https://dev.api.zeni.ai/version/approval/tarun/1.0/reimbursements/approval-rules-v2`
19
- : `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules`;
12
+ const { approvalRuleId } = action.payload;
20
13
  return zeniAPI
21
- .deleteAndGetJSON(endpoint, {
22
- approval_rule_id: approvalRuleId,
23
- })
14
+ .deleteAndGetJSON(`${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules`, { approval_rule_id: approvalRuleId })
24
15
  .pipe((0, operators_1.mergeMap)((response) => {
25
16
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
26
17
  const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
@@ -9,7 +9,7 @@ const userReducer_1 = require("../../../../../entity/user/userReducer");
9
9
  const responsePayload_1 = require("../../../../../responsePayload");
10
10
  const remiSetupApproverViewReducer_1 = require("../remiSetupApproverViewReducer");
11
11
  const fetchRemiSetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiSetupApproverViewReducer_1.fetchRemiSetupApproverView.match), (0, operators_1.switchMap)((action) => {
12
- const { cacheOverride, resolveAttributeToUser, includeImplicitActors, useV3, } = action.payload;
12
+ const { cacheOverride, resolveAttributeToUser, includeImplicitActors } = action.payload;
13
13
  const { remiSetupApproverViewState, approvalRuleState } = state$.value;
14
14
  const approvalRules = (0, approvalRuleSelector_1.getApprovalRulesByIds)(approvalRuleState, remiSetupApproverViewState.approvalRuleIds);
15
15
  if (cacheOverride === true ||
@@ -17,15 +17,8 @@ const fetchRemiSetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.p
17
17
  remiSetupApproverViewState.approvalRuleIds.length ||
18
18
  (remiSetupApproverViewState.hasValidState() === false &&
19
19
  remiSetupApproverViewState.fetchState !== 'In-Progress')) {
20
- // Approval Rules 3.0 — flag-gated endpoint selection.
21
- // Explicit `=== true` keeps `strict-boolean-expressions` happy
22
- // when RTK's payload type widens to `any` in some configs.
23
- const basePath = useV3 === true
24
- ? // ? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules-v2`
25
- `https://dev.api.zeni.ai/version/approval/tarun/1.0/reimbursements/approval-rules-v2`
26
- : `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules`;
27
20
  return zeniAPI
28
- .getJSON(`${basePath}?query={"is_include_implicit_actors": ${includeImplicitActors}, "is_resolve_attribute_to_user":${resolveAttributeToUser}}`)
21
+ .getJSON(`${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules?query={"is_include_implicit_actors": ${includeImplicitActors}, "is_resolve_attribute_to_user":${resolveAttributeToUser}}`)
29
22
  .pipe((0, operators_1.mergeMap)((response) => {
30
23
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
31
24
  const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);