@zeniai/client-epic-state 5.0.90-betaAR4 → 5.0.90-betaAR5

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 (15) hide show
  1. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +14 -7
  2. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +29 -9
  3. package/lib/esm/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +8 -2
  4. package/lib/esm/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +5 -1
  5. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +14 -2
  6. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +11 -7
  7. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.d.ts +6 -6
  8. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +14 -7
  9. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +29 -9
  10. package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +8 -2
  11. package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +5 -1
  12. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +14 -2
  13. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.d.ts +6 -6
  14. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +11 -7
  15. package/package.json +1 -1
@@ -28,9 +28,11 @@ const billPaySetupApproverView = createSlice({
28
28
  draft.error = undefined;
29
29
  },
30
30
  // Approval Rules 3.0 — `useV3` arrives from the screen connector
31
- // (`approval_rule_v3_config` dynamic config) and picks the v1 vs
32
- // v2 endpoint in the fetch epic.
33
- prepare(cacheOverride = false, includeUserRoles = true, useV3 = false) {
31
+ // ('approval_rule_v3_config' dynamic config) and picks the v1
32
+ // vs v2 endpoint in the fetch epic. Required (no default) so a
33
+ // missing screen-connector wire surfaces at compile time rather
34
+ // than silently falling back to v1 on a v3 tenant.
35
+ prepare(cacheOverride = false, includeUserRoles = true, useV3) {
34
36
  return { payload: { cacheOverride, includeUserRoles, useV3 } };
35
37
  },
36
38
  },
@@ -117,9 +119,10 @@ const billPaySetupApproverView = createSlice({
117
119
  };
118
120
  },
119
121
  // Approval Rules 3.0 — `useV3` flows from the screen connector
120
- // (`approval_rule_v3_config` dynamic config) so the delete epic
121
- // can pick the v1 vs v2 endpoint.
122
- prepare(approvalRuleId, useV3 = false) {
122
+ // ('approval_rule_v3_config' dynamic config) so the delete epic
123
+ // can pick the v1 vs v2 endpoint. Required (no default) so a
124
+ // missing connector wire surfaces at compile time.
125
+ prepare(approvalRuleId, useV3) {
123
126
  return { payload: { approvalRuleId, useV3 } };
124
127
  },
125
128
  },
@@ -187,7 +190,11 @@ const billPaySetupApproverView = createSlice({
187
190
  // reconciles any drift.
188
191
  draft.approvalRuleIds = approvalRuleIds;
189
192
  },
190
- prepare(approvalRuleIds, useV3 = false) {
193
+ // Approval Rules 3.0 — `useV3` required so a missing wire
194
+ // surfaces at compile time. The reorder epic always hits the
195
+ // v2 endpoint (v1 has no reorder route), but the payload still
196
+ // carries the flag for the failure-path refetch which needs it.
197
+ prepare(approvalRuleIds, useV3) {
191
198
  return { payload: { approvalRuleIds, useV3 } };
192
199
  },
193
200
  },
@@ -130,18 +130,38 @@ export const toApprovalChangableInfoPayloadV1 = (approverViewUpdateData) => {
130
130
  };
131
131
  });
132
132
  const isUpdate = approverViewUpdateData.approvalRuleId != null;
133
- const criteriaEntry = {
134
- type: 'range',
135
- range_entity: 'currency',
136
- min: minAmount?.amount ?? null,
137
- max: maxAmount?.amount ?? null,
138
- currency_code: currencyCode,
139
- currency_symbol: currencySymbol,
140
- };
133
+ const minValue = minAmount?.amount ?? null;
134
+ const maxValue = maxAmount?.amount ?? null;
135
+ // Approval Rules 3.0 — guard against the both-null case. The form
136
+ // is expected to always set at least one bound, but if drift ever
137
+ // hands us a rule with no min and no max we'd otherwise emit
138
+ // '[{type: range, min: null, max: null, ...}]' — a payload that
139
+ // (a) the read-side 'legacyAmountRangeToCriteria' decodes back to
140
+ // '[]' (asymmetric round-trip), and (b) the V1 backend will
141
+ // reject anyway. Emit 'criteria: []' instead so the save fails
142
+ // cleanly on the server side and we leave a breadcrumb in the
143
+ // console for diagnosis rather than persisting mis-shaped data.
144
+ const criteria = [];
145
+ if (minValue == null && maxValue == null) {
146
+ console.warn('[approvalRules][V1] toApprovalChangableInfoPayloadV1: rule has ' +
147
+ 'no amount bounds; emitting empty criteria array. The V1 backend ' +
148
+ 'will reject this save — caller should ensure at least one bound ' +
149
+ 'is set on the form.');
150
+ }
151
+ else {
152
+ criteria.push({
153
+ type: 'range',
154
+ range_entity: 'currency',
155
+ min: minValue,
156
+ max: maxValue,
157
+ currency_code: currencyCode,
158
+ currency_symbol: currencySymbol,
159
+ });
160
+ }
141
161
  const payload = {
142
162
  steps,
143
163
  is_applicable_on_pending_approval_entity: approverViewUpdateData.isApplicableOnPendingApprovalEntity ?? true,
144
- criteria: [criteriaEntry],
164
+ criteria,
145
165
  };
146
166
  if (isUpdate) {
147
167
  payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
@@ -38,7 +38,10 @@ export const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe(f
38
38
  else {
39
39
  billDetailActions.push(updateShowAutofill(true));
40
40
  }
41
- billDetailActions.push(fetchBillPaySetupApproverView(true));
41
+ // Side-fetch from the edit-bill page bootstrap. The triggering
42
+ // action doesn't carry the V3 flag, so we explicitly target v1
43
+ // here; tenants on v3 re-fetch through their own screen connector.
44
+ billDetailActions.push(fetchBillPaySetupApproverView(true, true, false));
42
45
  }
43
46
  else {
44
47
  if (state.ownerListState.fetchState !== 'In-Progress' &&
@@ -81,7 +84,10 @@ export const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe(f
81
84
  // While opening New Bill Refresh Approval Rules and Payment Accounts
82
85
  if (approvalViewFetchState !== 'In-Progress' &&
83
86
  approvalViewFetchState !== 'Completed') {
84
- billDetailActions.push(fetchBillPaySetupApproverView(true));
87
+ // Side-fetch from the edit-bill page bootstrap. The triggering
88
+ // action doesn't carry the V3 flag, so we explicitly target v1
89
+ // here; tenants on v3 re-fetch through their own screen connector.
90
+ billDetailActions.push(fetchBillPaySetupApproverView(true, true, false));
85
91
  }
86
92
  }
87
93
  return concat(from(billDetailActions));
@@ -63,7 +63,11 @@ export const fetchEditRemiDetailPageEpic = (actions$, state$) => actions$.pipe(f
63
63
  const approvalRules = state.remiSetupApproverViewState;
64
64
  if (approvalRules.fetchState !== 'Completed' &&
65
65
  approvalRules.fetchState !== 'In-Progress') {
66
- remiDetailActions.push(fetchRemiSetupApproverView(true));
66
+ // Side-fetch from the edit-reim page bootstrap. The
67
+ // triggering action doesn't carry the V3 flag, so we
68
+ // explicitly target v1; v3 tenants re-fetch via their
69
+ // own screen connector.
70
+ remiDetailActions.push(fetchRemiSetupApproverView(true, false, false, false));
67
71
  }
68
72
  }
69
73
  }
@@ -33,7 +33,13 @@ export const reorderRemiApprovalRulesEpic = (actions$, _state$, zeniAPI) => acti
33
33
  messageText: 'failed',
34
34
  type: 'error',
35
35
  }),
36
- fetchRemiSetupApproverView(true, true, useV3),
36
+ // Failure-recovery refetch — match the screen connector
37
+ // convention '(cacheOverride, resolveAttributeToUser,
38
+ // includeImplicitActors, useV3)' rather than copying BillPay's
39
+ // 3-arg shape. With the previous useV3-as-default-false the
40
+ // V3 flag was being smuggled in as 'includeImplicitActors',
41
+ // which silently broke V3 recovery refetches.
42
+ fetchRemiSetupApproverView(true, false, false, useV3),
37
43
  ]);
38
44
  }
39
45
  }), catchError((error) => from([
@@ -44,6 +50,12 @@ export const reorderRemiApprovalRulesEpic = (actions$, _state$, zeniAPI) => acti
44
50
  messageText: 'failed',
45
51
  type: 'error',
46
52
  }),
47
- fetchRemiSetupApproverView(true, true, useV3),
53
+ // Failure-recovery refetch — match the screen connector
54
+ // convention '(cacheOverride, resolveAttributeToUser,
55
+ // includeImplicitActors, useV3)' rather than copying BillPay's
56
+ // 3-arg shape. With the previous useV3-as-default-false the
57
+ // V3 flag was being smuggled in as 'includeImplicitActors',
58
+ // which silently broke V3 recovery refetches.
59
+ fetchRemiSetupApproverView(true, false, false, useV3),
48
60
  ])));
49
61
  }));
@@ -28,9 +28,10 @@ const remiSetupApproverView = createSlice({
28
28
  draft.error = undefined;
29
29
  },
30
30
  // Approval Rules 3.0 — `useV3` arrives from the screen connector
31
- // (`approval_rule_v3_config` dynamic config) and picks v1 vs v2
32
- // endpoint in the fetch epic.
33
- prepare(cacheOverride = false, resolveAttributeToUser = false, includeImplicitActors = false, useV3 = false) {
31
+ // ('approval_rule_v3_config' dynamic config) and picks v1 vs v2
32
+ // endpoint in the fetch epic. Required (no default) so a missing
33
+ // connector wire surfaces at compile time.
34
+ prepare(cacheOverride = false, resolveAttributeToUser = false, includeImplicitActors = false, useV3) {
34
35
  return {
35
36
  payload: {
36
37
  cacheOverride,
@@ -140,9 +141,10 @@ const remiSetupApproverView = createSlice({
140
141
  };
141
142
  },
142
143
  // Approval Rules 3.0 — `useV3` flows from the screen connector
143
- // (`approval_rule_v3_config` dynamic config) so the delete epic
144
- // can pick the v1 vs v2 endpoint.
145
- prepare(approvalRuleId, useV3 = false) {
144
+ // ('approval_rule_v3_config' dynamic config) so the delete epic
145
+ // can pick the v1 vs v2 endpoint. Required (no default) so a
146
+ // missing connector wire surfaces at compile time.
147
+ prepare(approvalRuleId, useV3) {
146
148
  return { payload: { approvalRuleId, useV3 } };
147
149
  },
148
150
  },
@@ -193,7 +195,9 @@ const remiSetupApproverView = createSlice({
193
195
  }
194
196
  draft.approvalRuleIds = approvalRuleIds;
195
197
  },
196
- prepare(approvalRuleIds, useV3 = false) {
198
+ // Approval Rules 3.0 — `useV3` required so a missing wire
199
+ // surfaces at compile time. Mirror of BillPay's reorder.prepare.
200
+ prepare(approvalRuleIds, useV3) {
197
201
  return { payload: { approvalRuleIds, useV3 } };
198
202
  },
199
203
  },
@@ -2,10 +2,10 @@ 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, useV3: boolean], {
6
6
  cacheOverride: any;
7
7
  includeUserRoles: any;
8
- useV3: any;
8
+ useV3: boolean;
9
9
  }, "billPaySetupApproverView/fetchBillPaySetupApproverView", never, never>, fetchBillPaySetupApproverViewSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleIds: string[]], {
10
10
  approvalRuleIds: string[];
11
11
  }, "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 +19,18 @@ export declare const fetchBillPaySetupApproverView: import("@reduxjs/toolkit").A
19
19
  attributes: ("manager" | "vendor_owner" | "manager_of_manager")[];
20
20
  }, "billPaySetupApproverView/fetchBillPayApproversListSuccess", never, never>, fetchBillPayApproversListFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>], {
21
21
  status: ZeniAPIStatus<Record<string, unknown>>;
22
- }, "billPaySetupApproverView/fetchBillPayApproversListFailure", never, never>, deleteBillPayApprovalRule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleId: string, useV3?: any], {
22
+ }, "billPaySetupApproverView/fetchBillPayApproversListFailure", never, never>, deleteBillPayApprovalRule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleId: string, useV3: boolean], {
23
23
  approvalRuleId: string;
24
- useV3: any;
24
+ useV3: boolean;
25
25
  }, "billPaySetupApproverView/deleteBillPayApprovalRule", never, never>, deleteBillPayApprovalRuleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[deletedApprovalRuleId: string, approvalRuleIds: string[]], {
26
26
  deletedApprovalRuleId: string;
27
27
  approvalRuleIds: string[];
28
28
  }, "billPaySetupApproverView/deleteBillPayApprovalRuleSuccess", never, never>, deleteBillPayApprovalRuleFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
29
29
  approvalRuleId: string;
30
30
  status: ZeniAPIStatus<Record<string, unknown>>;
31
- }, "billPaySetupApproverView/deleteBillPayApprovalRuleFailure", never, never>, reorderBillPayApprovalRules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleIds: string[], useV3?: any], {
31
+ }, "billPaySetupApproverView/deleteBillPayApprovalRuleFailure", never, never>, reorderBillPayApprovalRules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleIds: string[], useV3: boolean], {
32
32
  approvalRuleIds: string[];
33
- useV3: any;
33
+ useV3: boolean;
34
34
  }, "billPaySetupApproverView/reorderBillPayApprovalRules", never, never>, reorderBillPayApprovalRulesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleIds: string[]], {
35
35
  approvalRuleIds: string[];
36
36
  }, "billPaySetupApproverView/reorderBillPayApprovalRulesSuccess", never, never>, reorderBillPayApprovalRulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>], {
@@ -32,9 +32,11 @@ const billPaySetupApproverView = (0, toolkit_1.createSlice)({
32
32
  draft.error = undefined;
33
33
  },
34
34
  // Approval Rules 3.0 — `useV3` arrives from the screen connector
35
- // (`approval_rule_v3_config` dynamic config) and picks the v1 vs
36
- // v2 endpoint in the fetch epic.
37
- prepare(cacheOverride = false, includeUserRoles = true, useV3 = false) {
35
+ // ('approval_rule_v3_config' dynamic config) and picks the v1
36
+ // vs v2 endpoint in the fetch epic. Required (no default) so a
37
+ // missing screen-connector wire surfaces at compile time rather
38
+ // than silently falling back to v1 on a v3 tenant.
39
+ prepare(cacheOverride = false, includeUserRoles = true, useV3) {
38
40
  return { payload: { cacheOverride, includeUserRoles, useV3 } };
39
41
  },
40
42
  },
@@ -121,9 +123,10 @@ const billPaySetupApproverView = (0, toolkit_1.createSlice)({
121
123
  };
122
124
  },
123
125
  // Approval Rules 3.0 — `useV3` flows from the screen connector
124
- // (`approval_rule_v3_config` dynamic config) so the delete epic
125
- // can pick the v1 vs v2 endpoint.
126
- prepare(approvalRuleId, useV3 = false) {
126
+ // ('approval_rule_v3_config' dynamic config) so the delete epic
127
+ // can pick the v1 vs v2 endpoint. Required (no default) so a
128
+ // missing connector wire surfaces at compile time.
129
+ prepare(approvalRuleId, useV3) {
127
130
  return { payload: { approvalRuleId, useV3 } };
128
131
  },
129
132
  },
@@ -191,7 +194,11 @@ const billPaySetupApproverView = (0, toolkit_1.createSlice)({
191
194
  // reconciles any drift.
192
195
  draft.approvalRuleIds = approvalRuleIds;
193
196
  },
194
- prepare(approvalRuleIds, useV3 = false) {
197
+ // Approval Rules 3.0 — `useV3` required so a missing wire
198
+ // surfaces at compile time. The reorder epic always hits the
199
+ // v2 endpoint (v1 has no reorder route), but the payload still
200
+ // carries the flag for the failure-path refetch which needs it.
201
+ prepare(approvalRuleIds, useV3) {
195
202
  return { payload: { approvalRuleIds, useV3 } };
196
203
  },
197
204
  },
@@ -134,18 +134,38 @@ const toApprovalChangableInfoPayloadV1 = (approverViewUpdateData) => {
134
134
  };
135
135
  });
136
136
  const isUpdate = approverViewUpdateData.approvalRuleId != null;
137
- const criteriaEntry = {
138
- type: 'range',
139
- range_entity: 'currency',
140
- min: minAmount?.amount ?? null,
141
- max: maxAmount?.amount ?? null,
142
- currency_code: currencyCode,
143
- currency_symbol: currencySymbol,
144
- };
137
+ const minValue = minAmount?.amount ?? null;
138
+ const maxValue = maxAmount?.amount ?? null;
139
+ // Approval Rules 3.0 — guard against the both-null case. The form
140
+ // is expected to always set at least one bound, but if drift ever
141
+ // hands us a rule with no min and no max we'd otherwise emit
142
+ // '[{type: range, min: null, max: null, ...}]' — a payload that
143
+ // (a) the read-side 'legacyAmountRangeToCriteria' decodes back to
144
+ // '[]' (asymmetric round-trip), and (b) the V1 backend will
145
+ // reject anyway. Emit 'criteria: []' instead so the save fails
146
+ // cleanly on the server side and we leave a breadcrumb in the
147
+ // console for diagnosis rather than persisting mis-shaped data.
148
+ const criteria = [];
149
+ if (minValue == null && maxValue == null) {
150
+ console.warn('[approvalRules][V1] toApprovalChangableInfoPayloadV1: rule has ' +
151
+ 'no amount bounds; emitting empty criteria array. The V1 backend ' +
152
+ 'will reject this save — caller should ensure at least one bound ' +
153
+ 'is set on the form.');
154
+ }
155
+ else {
156
+ criteria.push({
157
+ type: 'range',
158
+ range_entity: 'currency',
159
+ min: minValue,
160
+ max: maxValue,
161
+ currency_code: currencyCode,
162
+ currency_symbol: currencySymbol,
163
+ });
164
+ }
145
165
  const payload = {
146
166
  steps,
147
167
  is_applicable_on_pending_approval_entity: approverViewUpdateData.isApplicableOnPendingApprovalEntity ?? true,
148
- criteria: [criteriaEntry],
168
+ criteria,
149
169
  };
150
170
  if (isUpdate) {
151
171
  payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
@@ -41,7 +41,10 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
41
41
  else {
42
42
  billDetailActions.push((0, editBillViewReducer_1.updateShowAutofill)(true));
43
43
  }
44
- billDetailActions.push((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true));
44
+ // Side-fetch from the edit-bill page bootstrap. The triggering
45
+ // action doesn't carry the V3 flag, so we explicitly target v1
46
+ // here; tenants on v3 re-fetch through their own screen connector.
47
+ billDetailActions.push((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, false));
45
48
  }
46
49
  else {
47
50
  if (state.ownerListState.fetchState !== 'In-Progress' &&
@@ -84,7 +87,10 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
84
87
  // While opening New Bill Refresh Approval Rules and Payment Accounts
85
88
  if (approvalViewFetchState !== 'In-Progress' &&
86
89
  approvalViewFetchState !== 'Completed') {
87
- billDetailActions.push((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true));
90
+ // Side-fetch from the edit-bill page bootstrap. The triggering
91
+ // action doesn't carry the V3 flag, so we explicitly target v1
92
+ // here; tenants on v3 re-fetch through their own screen connector.
93
+ billDetailActions.push((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, false));
88
94
  }
89
95
  }
90
96
  return (0, rxjs_1.concat)((0, rxjs_1.from)(billDetailActions));
@@ -66,7 +66,11 @@ const fetchEditRemiDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
66
66
  const approvalRules = state.remiSetupApproverViewState;
67
67
  if (approvalRules.fetchState !== 'Completed' &&
68
68
  approvalRules.fetchState !== 'In-Progress') {
69
- remiDetailActions.push((0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverView)(true));
69
+ // Side-fetch from the edit-reim page bootstrap. The
70
+ // triggering action doesn't carry the V3 flag, so we
71
+ // explicitly target v1; v3 tenants re-fetch via their
72
+ // own screen connector.
73
+ remiDetailActions.push((0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverView)(true, false, false, false));
70
74
  }
71
75
  }
72
76
  }
@@ -36,7 +36,13 @@ const reorderRemiApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pi
36
36
  messageText: 'failed',
37
37
  type: 'error',
38
38
  }),
39
- (0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverView)(true, true, useV3),
39
+ // Failure-recovery refetch — match the screen connector
40
+ // convention '(cacheOverride, resolveAttributeToUser,
41
+ // includeImplicitActors, useV3)' rather than copying BillPay's
42
+ // 3-arg shape. With the previous useV3-as-default-false the
43
+ // V3 flag was being smuggled in as 'includeImplicitActors',
44
+ // which silently broke V3 recovery refetches.
45
+ (0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverView)(true, false, false, useV3),
40
46
  ]);
41
47
  }
42
48
  }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
@@ -47,7 +53,13 @@ const reorderRemiApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pi
47
53
  messageText: 'failed',
48
54
  type: 'error',
49
55
  }),
50
- (0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverView)(true, true, useV3),
56
+ // Failure-recovery refetch — match the screen connector
57
+ // convention '(cacheOverride, resolveAttributeToUser,
58
+ // includeImplicitActors, useV3)' rather than copying BillPay's
59
+ // 3-arg shape. With the previous useV3-as-default-false the
60
+ // V3 flag was being smuggled in as 'includeImplicitActors',
61
+ // which silently broke V3 recovery refetches.
62
+ (0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverView)(true, false, false, useV3),
51
63
  ])));
52
64
  }));
53
65
  exports.reorderRemiApprovalRulesEpic = reorderRemiApprovalRulesEpic;
@@ -2,11 +2,11 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
2
2
  import { ApprovalRuleCreateData, ApprovalRuleUpdateData } from '../../billPay/billPaySetupApproverView/types/commonState';
3
3
  import { RemiSetupApproverViewState } from './remiSetupApproverViewState';
4
4
  export declare const initialState: RemiSetupApproverViewState;
5
- export declare const fetchRemiSetupApproverView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any, resolveAttributeToUser?: any, includeImplicitActors?: any, useV3?: any], {
5
+ export declare const fetchRemiSetupApproverView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: any, resolveAttributeToUser: any, includeImplicitActors: any, useV3: boolean], {
6
6
  cacheOverride: any;
7
7
  resolveAttributeToUser: any;
8
8
  includeImplicitActors: any;
9
- useV3: any;
9
+ useV3: boolean;
10
10
  }, "remiSetupApproverView/fetchRemiSetupApproverView", never, never>, fetchRemiSetupApproverViewSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleIds: string[]], {
11
11
  approvalRuleIds: string[];
12
12
  }, "remiSetupApproverView/fetchRemiSetupApproverViewSuccess", never, never>, fetchRemiSetupApproverViewFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "remiSetupApproverView/fetchRemiSetupApproverViewFailure", never, never>, fetchRemiApproversDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any, includeUserRoles?: any, includeAttributesUserIds?: any, lastUpdatedByUserId?: any], {
@@ -25,18 +25,18 @@ export declare const fetchRemiSetupApproverView: import("@reduxjs/toolkit").Acti
25
25
  attributeSubTypeToUserIdMapping: Record<"manager" | "vendor_owner" | "manager_of_manager", string> | undefined;
26
26
  }, "remiSetupApproverView/fetchRemiApproversListSuccess", never, never>, fetchRemiApproversListFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>], {
27
27
  status: ZeniAPIStatus<Record<string, unknown>>;
28
- }, "remiSetupApproverView/fetchRemiApproversListFailure", never, never>, deleteRemiApprovalRule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleId: string, useV3?: any], {
28
+ }, "remiSetupApproverView/fetchRemiApproversListFailure", never, never>, deleteRemiApprovalRule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleId: string, useV3: boolean], {
29
29
  approvalRuleId: string;
30
- useV3: any;
30
+ useV3: boolean;
31
31
  }, "remiSetupApproverView/deleteRemiApprovalRule", never, never>, deleteRemiApprovalRuleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[deletedApprovalRuleId: string, approvalRuleIds: string[]], {
32
32
  deletedApprovalRuleId: string;
33
33
  approvalRuleIds: string[];
34
34
  }, "remiSetupApproverView/deleteRemiApprovalRuleSuccess", never, never>, deleteRemiApprovalRuleFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
35
35
  approvalRuleId: string;
36
36
  status: ZeniAPIStatus<Record<string, unknown>>;
37
- }, "remiSetupApproverView/deleteRemiApprovalRuleFailure", never, never>, reorderRemiApprovalRules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleIds: string[], useV3?: any], {
37
+ }, "remiSetupApproverView/deleteRemiApprovalRuleFailure", never, never>, reorderRemiApprovalRules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleIds: string[], useV3: boolean], {
38
38
  approvalRuleIds: string[];
39
- useV3: any;
39
+ useV3: boolean;
40
40
  }, "remiSetupApproverView/reorderRemiApprovalRules", never, never>, reorderRemiApprovalRulesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[approvalRuleIds: string[]], {
41
41
  approvalRuleIds: string[];
42
42
  }, "remiSetupApproverView/reorderRemiApprovalRulesSuccess", never, never>, reorderRemiApprovalRulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>], {
@@ -32,9 +32,10 @@ const remiSetupApproverView = (0, toolkit_1.createSlice)({
32
32
  draft.error = undefined;
33
33
  },
34
34
  // Approval Rules 3.0 — `useV3` arrives from the screen connector
35
- // (`approval_rule_v3_config` dynamic config) and picks v1 vs v2
36
- // endpoint in the fetch epic.
37
- prepare(cacheOverride = false, resolveAttributeToUser = false, includeImplicitActors = false, useV3 = false) {
35
+ // ('approval_rule_v3_config' dynamic config) and picks v1 vs v2
36
+ // endpoint in the fetch epic. Required (no default) so a missing
37
+ // connector wire surfaces at compile time.
38
+ prepare(cacheOverride = false, resolveAttributeToUser = false, includeImplicitActors = false, useV3) {
38
39
  return {
39
40
  payload: {
40
41
  cacheOverride,
@@ -144,9 +145,10 @@ const remiSetupApproverView = (0, toolkit_1.createSlice)({
144
145
  };
145
146
  },
146
147
  // Approval Rules 3.0 — `useV3` flows from the screen connector
147
- // (`approval_rule_v3_config` dynamic config) so the delete epic
148
- // can pick the v1 vs v2 endpoint.
149
- prepare(approvalRuleId, useV3 = false) {
148
+ // ('approval_rule_v3_config' dynamic config) so the delete epic
149
+ // can pick the v1 vs v2 endpoint. Required (no default) so a
150
+ // missing connector wire surfaces at compile time.
151
+ prepare(approvalRuleId, useV3) {
150
152
  return { payload: { approvalRuleId, useV3 } };
151
153
  },
152
154
  },
@@ -197,7 +199,9 @@ const remiSetupApproverView = (0, toolkit_1.createSlice)({
197
199
  }
198
200
  draft.approvalRuleIds = approvalRuleIds;
199
201
  },
200
- prepare(approvalRuleIds, useV3 = false) {
202
+ // Approval Rules 3.0 — `useV3` required so a missing wire
203
+ // surfaces at compile time. Mirror of BillPay's reorder.prepare.
204
+ prepare(approvalRuleIds, useV3) {
201
205
  return { payload: { approvalRuleIds, useV3 } };
202
206
  },
203
207
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.0.90-betaAR4",
3
+ "version": "5.0.90-betaAR5",
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",