@zeniai/client-epic-state 5.1.68-beta0GS → 5.1.68-beta0RR

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 (60) hide show
  1. package/lib/commonPayloadTypes/commonPayload.d.ts +25 -4
  2. package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
  3. package/lib/entity/tenant/clearAllEpic.js +0 -2
  4. package/lib/epic.d.ts +1 -3
  5. package/lib/epic.js +1 -3
  6. package/lib/esm/entity/tenant/clearAllEpic.js +0 -2
  7. package/lib/esm/epic.js +1 -3
  8. package/lib/esm/index.js +8 -6
  9. package/lib/esm/reducer.js +0 -3
  10. package/lib/esm/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.js +7 -3
  11. package/lib/esm/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.js +56 -34
  12. package/lib/esm/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.js +2 -7
  13. package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireOnboardingDetailsToLocalData.js +164 -0
  14. package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants.js +45 -0
  15. package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationLocalDataHelpers.js +105 -0
  16. package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.js +55 -8
  17. package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.js +23 -7
  18. package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.js +39 -15
  19. package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSubmitPayload.js +189 -0
  20. package/lib/index.d.ts +10 -9
  21. package/lib/index.js +63 -53
  22. package/lib/reducer.d.ts +0 -3
  23. package/lib/reducer.js +0 -3
  24. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.d.ts +3 -3
  25. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.js +6 -2
  26. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.d.ts +2 -1
  27. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.js +55 -33
  28. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.js +2 -7
  29. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireOnboardingDetailsToLocalData.d.ts +4 -0
  30. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireOnboardingDetailsToLocalData.js +168 -0
  31. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants.d.ts +43 -0
  32. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants.js +48 -0
  33. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationLocalDataHelpers.d.ts +29 -0
  34. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationLocalDataHelpers.js +115 -0
  35. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.d.ts +24 -1
  36. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.js +59 -9
  37. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.js +22 -6
  38. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.js +39 -15
  39. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationState.d.ts +20 -1
  40. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSubmitPayload.d.ts +32 -0
  41. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSubmitPayload.js +194 -0
  42. package/package.json +1 -1
  43. package/lib/esm/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApprovalRulesEpic.js +0 -21
  44. package/lib/esm/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalRulesEpic.js +0 -20
  45. package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesPayload.js +0 -1
  46. package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesReducer.js +0 -76
  47. package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesSelector.js +0 -9
  48. package/lib/esm/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesState.js +0 -1
  49. package/lib/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApprovalRulesEpic.d.ts +0 -7
  50. package/lib/view/settings/jeScheduleApprovalRules/epic/fetchJEScheduleApprovalRulesEpic.js +0 -25
  51. package/lib/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalRulesEpic.d.ts +0 -6
  52. package/lib/view/settings/jeScheduleApprovalRules/epic/saveJEScheduleApprovalRulesEpic.js +0 -24
  53. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesPayload.d.ts +0 -29
  54. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesPayload.js +0 -2
  55. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesReducer.d.ts +0 -16
  56. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesReducer.js +0 -80
  57. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesSelector.d.ts +0 -12
  58. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesSelector.js +0 -12
  59. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesState.d.ts +0 -8
  60. package/lib/view/settings/jeScheduleApprovalRules/jeScheduleApprovalRulesState.js +0 -2
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchJEScheduleApprovalRulesEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../../responsePayload");
7
- const jeScheduleApprovalRulesReducer_1 = require("../jeScheduleApprovalRulesReducer");
8
- const fetchJEScheduleApprovalRulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeScheduleApprovalRulesReducer_1.fetchJEScheduleApprovalRules.match), (0, operators_1.switchMap)((action) => {
9
- const { cacheOverride } = action.payload;
10
- const { jeScheduleApprovalRulesState } = state$.value;
11
- const cachedSettings = jeScheduleApprovalRulesState.settings;
12
- if (cacheOverride !== true &&
13
- jeScheduleApprovalRulesState.hasValidState() === true &&
14
- cachedSettings != null) {
15
- return (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.fetchJEScheduleApprovalRulesSuccess)(cachedSettings));
16
- }
17
- const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/je-schedules/approval-rules`;
18
- return zeniAPI.getJSON(endpoint).pipe((0, operators_1.mergeMap)((response) => {
19
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
20
- return (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.fetchJEScheduleApprovalRulesSuccess)(response.data.settings));
21
- }
22
- return (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.fetchJEScheduleApprovalRulesFailure)(response.status));
23
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.fetchJEScheduleApprovalRulesFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch JE approval rules errored out' + JSON.stringify(error))))));
24
- }));
25
- exports.fetchJEScheduleApprovalRulesEpic = fetchJEScheduleApprovalRulesEpic;
@@ -1,6 +0,0 @@
1
- import { ActionsObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { ZeniAPI } from '../../../../zeniAPI';
4
- import { saveJEScheduleApprovalRules, saveJEScheduleApprovalRulesConflict, saveJEScheduleApprovalRulesFailure, saveJEScheduleApprovalRulesSuccess } from '../jeScheduleApprovalRulesReducer';
5
- export type ActionType = ReturnType<typeof saveJEScheduleApprovalRules> | ReturnType<typeof saveJEScheduleApprovalRulesSuccess> | ReturnType<typeof saveJEScheduleApprovalRulesConflict> | ReturnType<typeof saveJEScheduleApprovalRulesFailure>;
6
- export declare const saveJEScheduleApprovalRulesEpic: (actions$: ActionsObservable<ActionType>, _state$: unknown, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.saveJEScheduleApprovalRulesEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../../responsePayload");
7
- const jeScheduleApprovalRulesReducer_1 = require("../jeScheduleApprovalRulesReducer");
8
- const HTTP_CONFLICT = 409;
9
- const saveJEScheduleApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeScheduleApprovalRulesReducer_1.saveJEScheduleApprovalRules.match), (0, operators_1.mergeMap)((action) => {
10
- const { body } = action.payload;
11
- const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/je-schedules/approval-rules`;
12
- return zeniAPI
13
- .postAndGetJSON(endpoint, body)
14
- .pipe((0, operators_1.mergeMap)((response) => {
15
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
16
- return (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.saveJEScheduleApprovalRulesSuccess)(response.data.settings, response.data.reevaluation_triggered));
17
- }
18
- if (response.status.code === HTTP_CONFLICT) {
19
- return (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.saveJEScheduleApprovalRulesConflict)(response.status));
20
- }
21
- return (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.saveJEScheduleApprovalRulesFailure)(response.status));
22
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, jeScheduleApprovalRulesReducer_1.saveJEScheduleApprovalRulesFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Save JE approval rules errored out' + JSON.stringify(error))))));
23
- }));
24
- exports.saveJEScheduleApprovalRulesEpic = saveJEScheduleApprovalRulesEpic;
@@ -1,29 +0,0 @@
1
- import { ZeniAPIResponse } from '../../../responsePayload';
2
- export type JEScheduleType = 'prepaid_expenses' | 'fixed_assets' | 'accrued_expenses';
3
- export interface JEApprovalThresholdRow {
4
- account_id: string;
5
- account_name: string;
6
- max_auto_post_amount: number | null;
7
- schedule_type: JEScheduleType;
8
- }
9
- export interface JEApprovalSettings {
10
- approver_roles: string[];
11
- reevaluate_ongoing_on_threshold_change: boolean;
12
- thresholds: JEApprovalThresholdRow[];
13
- version: number;
14
- }
15
- export interface JEScheduleApprovalRulesResponseData {
16
- exists: boolean;
17
- settings: JEApprovalSettings;
18
- }
19
- export type JEScheduleApprovalRulesResponse = ZeniAPIResponse<JEScheduleApprovalRulesResponseData>;
20
- export interface SaveJEScheduleApprovalRulesResponseData extends JEScheduleApprovalRulesResponseData {
21
- reevaluation_triggered: boolean;
22
- }
23
- export type SaveJEScheduleApprovalRulesResponse = ZeniAPIResponse<SaveJEScheduleApprovalRulesResponseData>;
24
- export interface SaveJEScheduleApprovalRulesRequestBody extends Record<string, unknown> {
25
- approver_roles: string[];
26
- reevaluate_ongoing_on_threshold_change: boolean;
27
- thresholds: JEApprovalThresholdRow[];
28
- expected_version?: number;
29
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,16 +0,0 @@
1
- import { ZeniAPIStatus } from '../../../responsePayload';
2
- import { JEApprovalSettings, SaveJEScheduleApprovalRulesRequestBody } from './jeScheduleApprovalRulesPayload';
3
- import { JEScheduleApprovalRulesState } from './jeScheduleApprovalRulesState';
4
- export declare const initialState: JEScheduleApprovalRulesState;
5
- export declare const fetchJEScheduleApprovalRules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
6
- cacheOverride: any;
7
- }, "jeScheduleApprovalRules/fetchJEScheduleApprovalRules", never, never>, fetchJEScheduleApprovalRulesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[settings: JEApprovalSettings], {
8
- settings: JEApprovalSettings;
9
- }, "jeScheduleApprovalRules/fetchJEScheduleApprovalRulesSuccess", never, never>, fetchJEScheduleApprovalRulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "jeScheduleApprovalRules/fetchJEScheduleApprovalRulesFailure">, saveJEScheduleApprovalRules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[body: SaveJEScheduleApprovalRulesRequestBody], {
10
- body: SaveJEScheduleApprovalRulesRequestBody;
11
- }, "jeScheduleApprovalRules/saveJEScheduleApprovalRules", never, never>, saveJEScheduleApprovalRulesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[settings: JEApprovalSettings, reevaluationTriggered: boolean], {
12
- settings: JEApprovalSettings;
13
- reevaluationTriggered: boolean;
14
- }, "jeScheduleApprovalRules/saveJEScheduleApprovalRulesSuccess", never, never>, saveJEScheduleApprovalRulesConflict: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "jeScheduleApprovalRules/saveJEScheduleApprovalRulesConflict">, saveJEScheduleApprovalRulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "jeScheduleApprovalRules/saveJEScheduleApprovalRulesFailure">, clearJEScheduleApprovalRules: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"jeScheduleApprovalRules/clearJEScheduleApprovalRules">;
15
- declare const _default: import("redux").Reducer<JEScheduleApprovalRulesState>;
16
- export default _default;
@@ -1,80 +0,0 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearJEScheduleApprovalRules = exports.saveJEScheduleApprovalRulesFailure = exports.saveJEScheduleApprovalRulesConflict = exports.saveJEScheduleApprovalRulesSuccess = exports.saveJEScheduleApprovalRules = exports.fetchJEScheduleApprovalRulesFailure = exports.fetchJEScheduleApprovalRulesSuccess = exports.fetchJEScheduleApprovalRules = exports.initialState = void 0;
5
- const toolkit_1 = require("@reduxjs/toolkit");
6
- exports.initialState = {
7
- fetchState: 'Not-Started',
8
- error: undefined,
9
- saveStatus: { fetchState: 'Not-Started', error: undefined },
10
- settings: undefined,
11
- hadVersionConflict: false,
12
- reevaluationTriggered: false,
13
- hasValidState() {
14
- return this.fetchState === 'Completed';
15
- },
16
- };
17
- const jeScheduleApprovalRules = (0, toolkit_1.createSlice)({
18
- name: 'jeScheduleApprovalRules',
19
- initialState: exports.initialState,
20
- reducers: {
21
- fetchJEScheduleApprovalRules: {
22
- reducer(draft) {
23
- draft.fetchState = 'In-Progress';
24
- draft.error = undefined;
25
- },
26
- prepare(cacheOverride = false) {
27
- return { payload: { cacheOverride } };
28
- },
29
- },
30
- fetchJEScheduleApprovalRulesSuccess: {
31
- reducer(draft, action) {
32
- draft.fetchState = 'Completed';
33
- draft.error = undefined;
34
- draft.settings = action.payload.settings;
35
- },
36
- prepare(settings) {
37
- return { payload: { settings } };
38
- },
39
- },
40
- fetchJEScheduleApprovalRulesFailure(draft, action) {
41
- draft.fetchState = 'Error';
42
- draft.error = action.payload;
43
- },
44
- saveJEScheduleApprovalRules: {
45
- reducer(draft) {
46
- draft.saveStatus = { fetchState: 'In-Progress', error: undefined };
47
- draft.hadVersionConflict = false;
48
- draft.reevaluationTriggered = false;
49
- },
50
- prepare(body) {
51
- return { payload: { body } };
52
- },
53
- },
54
- saveJEScheduleApprovalRulesSuccess: {
55
- reducer(draft, action) {
56
- draft.saveStatus = { fetchState: 'Completed', error: undefined };
57
- draft.settings = action.payload.settings;
58
- draft.reevaluationTriggered = action.payload.reevaluationTriggered;
59
- draft.hadVersionConflict = false;
60
- },
61
- prepare(settings, reevaluationTriggered) {
62
- return { payload: { settings, reevaluationTriggered } };
63
- },
64
- },
65
- // 409 — the stored version moved under us. The screen should re-fetch and
66
- // ask the user to re-apply. Kept distinct from a generic save failure.
67
- saveJEScheduleApprovalRulesConflict(draft, action) {
68
- draft.saveStatus = { fetchState: 'Error', error: action.payload };
69
- draft.hadVersionConflict = true;
70
- },
71
- saveJEScheduleApprovalRulesFailure(draft, action) {
72
- draft.saveStatus = { fetchState: 'Error', error: action.payload };
73
- },
74
- clearJEScheduleApprovalRules() {
75
- return exports.initialState;
76
- },
77
- },
78
- });
79
- _a = jeScheduleApprovalRules.actions, exports.fetchJEScheduleApprovalRules = _a.fetchJEScheduleApprovalRules, exports.fetchJEScheduleApprovalRulesSuccess = _a.fetchJEScheduleApprovalRulesSuccess, exports.fetchJEScheduleApprovalRulesFailure = _a.fetchJEScheduleApprovalRulesFailure, exports.saveJEScheduleApprovalRules = _a.saveJEScheduleApprovalRules, exports.saveJEScheduleApprovalRulesSuccess = _a.saveJEScheduleApprovalRulesSuccess, exports.saveJEScheduleApprovalRulesConflict = _a.saveJEScheduleApprovalRulesConflict, exports.saveJEScheduleApprovalRulesFailure = _a.saveJEScheduleApprovalRulesFailure, exports.clearJEScheduleApprovalRules = _a.clearJEScheduleApprovalRules;
80
- exports.default = jeScheduleApprovalRules.reducer;
@@ -1,12 +0,0 @@
1
- import { FetchState, FetchStateAndError } from '../../../commonStateTypes/common';
2
- import { RootState } from '../../../reducer';
3
- import { JEApprovalSettings } from './jeScheduleApprovalRulesPayload';
4
- export interface JEScheduleApprovalRulesView {
5
- error: FetchStateAndError['error'];
6
- fetchState: FetchState;
7
- hadVersionConflict: boolean;
8
- reevaluationTriggered: boolean;
9
- saveStatus: FetchStateAndError;
10
- settings?: JEApprovalSettings;
11
- }
12
- export declare const getJEScheduleApprovalRulesView: (state: RootState) => JEScheduleApprovalRulesView;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getJEScheduleApprovalRulesView = void 0;
4
- const toolkit_1 = require("@reduxjs/toolkit");
5
- exports.getJEScheduleApprovalRulesView = (0, toolkit_1.createSelector)((state) => state.jeScheduleApprovalRulesState, (jeScheduleApprovalRulesState) => ({
6
- fetchState: jeScheduleApprovalRulesState.fetchState,
7
- error: jeScheduleApprovalRulesState.error,
8
- saveStatus: jeScheduleApprovalRulesState.saveStatus,
9
- settings: jeScheduleApprovalRulesState.settings,
10
- hadVersionConflict: jeScheduleApprovalRulesState.hadVersionConflict ?? false,
11
- reevaluationTriggered: jeScheduleApprovalRulesState.reevaluationTriggered ?? false,
12
- }));
@@ -1,8 +0,0 @@
1
- import { FetchStateAndError, FetchedState } from '../../../commonStateTypes/common';
2
- import { JEApprovalSettings } from './jeScheduleApprovalRulesPayload';
3
- export interface JEScheduleApprovalRulesState extends FetchedState {
4
- saveStatus: FetchStateAndError;
5
- hadVersionConflict?: boolean;
6
- reevaluationTriggered?: boolean;
7
- settings?: JEApprovalSettings;
8
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });