@zeniai/client-epic-state 5.0.39 → 5.0.41

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 (83) hide show
  1. package/lib/entity/chargeCardRepayment/chargeCardRepayment.d.ts +1 -1
  2. package/lib/entity/creditAgent/creditAgentPayload.d.ts +41 -0
  3. package/lib/entity/creditAgent/creditAgentPayload.js +40 -0
  4. package/lib/entity/creditAgent/creditAgentReducer.d.ts +9 -0
  5. package/lib/entity/creditAgent/creditAgentReducer.js +37 -0
  6. package/lib/entity/creditAgent/creditAgentSelector.d.ts +3 -0
  7. package/lib/entity/creditAgent/creditAgentSelector.js +10 -0
  8. package/lib/entity/creditAgent/creditAgentState.d.ts +39 -0
  9. package/lib/entity/creditAgent/creditAgentState.js +17 -0
  10. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  11. package/lib/entity/snackbar/snackbarTypes.js +3 -0
  12. package/lib/entity/task/taskPayload.d.ts +1 -0
  13. package/lib/entity/task/taskPayload.js +5 -0
  14. package/lib/entity/task/taskState.d.ts +5 -0
  15. package/lib/entity/task/taskState.js +6 -1
  16. package/lib/entity/tenant/clearAllEpic.d.ts +5 -3
  17. package/lib/entity/tenant/clearAllEpic.js +6 -2
  18. package/lib/epic.d.ts +7 -1
  19. package/lib/epic.js +7 -1
  20. package/lib/esm/entity/creditAgent/creditAgentPayload.js +36 -0
  21. package/lib/esm/entity/creditAgent/creditAgentReducer.js +33 -0
  22. package/lib/esm/entity/creditAgent/creditAgentSelector.js +6 -0
  23. package/lib/esm/entity/creditAgent/creditAgentState.js +13 -0
  24. package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
  25. package/lib/esm/entity/task/taskPayload.js +6 -1
  26. package/lib/esm/entity/task/taskState.js +3 -0
  27. package/lib/esm/entity/tenant/clearAllEpic.js +6 -2
  28. package/lib/esm/epic.js +7 -1
  29. package/lib/esm/index.js +15 -9
  30. package/lib/esm/reducer.js +9 -3
  31. package/lib/esm/view/common/recurringViewHelper.js +17 -0
  32. package/lib/esm/view/creditAgentView/buildCreditReportCsv.js +44 -0
  33. package/lib/esm/view/creditAgentView/creditAgentViewPayload.js +2 -0
  34. package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +183 -0
  35. package/lib/esm/view/creditAgentView/creditAgentViewSelector.js +85 -0
  36. package/lib/esm/view/creditAgentView/creditAgentViewState.js +20 -0
  37. package/lib/esm/view/creditAgentView/epics/fetchCardProfilesEpic.js +20 -0
  38. package/lib/esm/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +13 -0
  39. package/lib/esm/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +19 -0
  40. package/lib/esm/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +58 -0
  41. package/lib/esm/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.js +39 -0
  42. package/lib/esm/view/creditAgentView/epics/updateCardProfileEpic.js +62 -0
  43. package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +2 -0
  44. package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +5 -0
  45. package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +1 -0
  46. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +5 -0
  47. package/lib/index.d.ts +21 -13
  48. package/lib/index.js +77 -46
  49. package/lib/reducer.d.ts +9 -3
  50. package/lib/reducer.js +9 -3
  51. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  52. package/lib/view/common/recurringViewHelper.d.ts +3 -2
  53. package/lib/view/common/recurringViewHelper.js +18 -1
  54. package/lib/view/creditAgentView/buildCreditReportCsv.d.ts +17 -0
  55. package/lib/view/creditAgentView/buildCreditReportCsv.js +47 -0
  56. package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +9 -0
  57. package/lib/view/creditAgentView/creditAgentViewPayload.js +7 -0
  58. package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +41 -0
  59. package/lib/view/creditAgentView/creditAgentViewReducer.js +187 -0
  60. package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +20 -0
  61. package/lib/view/creditAgentView/creditAgentViewSelector.js +93 -0
  62. package/lib/view/creditAgentView/creditAgentViewState.d.ts +34 -0
  63. package/lib/view/creditAgentView/creditAgentViewState.js +22 -0
  64. package/lib/view/creditAgentView/epics/fetchCardProfilesEpic.d.ts +15 -0
  65. package/lib/view/creditAgentView/epics/fetchCardProfilesEpic.js +24 -0
  66. package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.d.ts +11 -0
  67. package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +17 -0
  68. package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.d.ts +15 -0
  69. package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +23 -0
  70. package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.d.ts +29 -0
  71. package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +62 -0
  72. package/lib/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.d.ts +30 -0
  73. package/lib/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.js +43 -0
  74. package/lib/view/creditAgentView/epics/updateCardProfileEpic.d.ts +37 -0
  75. package/lib/view/creditAgentView/epics/updateCardProfileEpic.js +66 -0
  76. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  77. package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +2 -0
  78. package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +5 -0
  79. package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +3 -1
  80. package/lib/view/taskManager/taskDetailView/taskDetail.js +1 -0
  81. package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +1 -0
  82. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +5 -0
  83. package/package.json +1 -1
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchCreditAgentMacroEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const creditAgentReducer_1 = require("../../../entity/creditAgent/creditAgentReducer");
7
+ const responsePayload_1 = require("../../../responsePayload");
8
+ const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
9
+ const fetchCreditAgentMacroEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.fetchCreditAgentMacro.match), (0, operators_1.switchMap)(() => {
10
+ const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/macros/credit-agent`;
11
+ return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
12
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
13
+ return (0, rxjs_1.from)([
14
+ (0, creditAgentReducer_1.updateCreditAgentMacro)(response.data),
15
+ (0, creditAgentViewReducer_1.fetchCreditAgentMacroSuccess)(),
16
+ ]);
17
+ }
18
+ else {
19
+ return (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCreditAgentMacroFailure)(response.status));
20
+ }
21
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCreditAgentMacroFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
22
+ }));
23
+ exports.fetchCreditAgentMacroEpic = fetchCreditAgentMacroEpic;
@@ -0,0 +1,29 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { updateCreditAgentMacro } from '../../../entity/creditAgent/creditAgentReducer';
3
+ import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
4
+ import { RootState } from '../../../reducer';
5
+ import { ZeniAPI } from '../../../zeniAPI';
6
+ import { saveCreditAgentMacro, saveCreditAgentMacroFailure, saveCreditAgentMacroSuccess } from '../creditAgentViewReducer';
7
+ export type ActionType = ReturnType<typeof saveCreditAgentMacro> | ReturnType<typeof saveCreditAgentMacroSuccess> | ReturnType<typeof saveCreditAgentMacroFailure> | ReturnType<typeof updateCreditAgentMacro> | ReturnType<typeof openSnackbar>;
8
+ export declare const saveCreditAgentMacroEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
9
+ payload: {
10
+ messageSection: import("../../..").SnackbarMessageSections;
11
+ messageText: import("../../..").SnackbarMessageSectionTexts;
12
+ type: import("../../..").SnackbarMessageType;
13
+ showStatusIcon?: boolean;
14
+ variables?: {
15
+ variableName: string;
16
+ variableValue: string;
17
+ }[];
18
+ };
19
+ type: "snackbar/openSnackbar";
20
+ } | {
21
+ payload: import("../creditAgentViewPayload").MacroPayload;
22
+ type: "creditAgent/updateCreditAgentMacro";
23
+ } | {
24
+ payload: undefined;
25
+ type: "creditAgentView/saveCreditAgentMacroSuccess";
26
+ } | {
27
+ payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
28
+ type: "creditAgentView/saveCreditAgentMacroFailure";
29
+ }>;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.saveCreditAgentMacroEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const creditAgentReducer_1 = require("../../../entity/creditAgent/creditAgentReducer");
7
+ const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
8
+ const responsePayload_1 = require("../../../responsePayload");
9
+ const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
10
+ const saveCreditAgentMacroEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.saveCreditAgentMacro.match), (0, operators_1.switchMap)((action) => {
11
+ const { instructions } = action.payload;
12
+ const existingMacro = state$.value.creditAgentEntityState.macro;
13
+ // Fail fast if macro has not been loaded yet — avoids overwriting server-side
14
+ // name/description fields with empty defaults.
15
+ if (existingMacro == null) {
16
+ return (0, rxjs_1.from)([
17
+ (0, creditAgentViewReducer_1.saveCreditAgentMacroFailure)((0, responsePayload_1.createZeniAPIStatus)('Save failed', 'Cannot save macro: macro data has not been loaded yet.')),
18
+ (0, snackbarReducer_1.openSnackbar)({
19
+ messageSection: 'credit_agent_save_macro',
20
+ messageText: 'failed',
21
+ type: 'error',
22
+ }),
23
+ ]);
24
+ }
25
+ const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/macros/credit-agent`;
26
+ const body = {
27
+ instructions,
28
+ name: existingMacro.name,
29
+ description: existingMacro.description,
30
+ };
31
+ return zeniAPI.putAndGetJSON(url, body).pipe((0, operators_1.mergeMap)((response) => {
32
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
33
+ return (0, rxjs_1.from)([
34
+ (0, creditAgentReducer_1.updateCreditAgentMacro)(response.data),
35
+ (0, creditAgentViewReducer_1.saveCreditAgentMacroSuccess)(),
36
+ (0, snackbarReducer_1.openSnackbar)({
37
+ messageSection: 'credit_agent_save_macro',
38
+ messageText: 'success',
39
+ type: 'success',
40
+ }),
41
+ ]);
42
+ }
43
+ else {
44
+ return (0, rxjs_1.from)([
45
+ (0, creditAgentViewReducer_1.saveCreditAgentMacroFailure)(response.status),
46
+ (0, snackbarReducer_1.openSnackbar)({
47
+ messageSection: 'credit_agent_save_macro',
48
+ messageText: 'failed',
49
+ type: 'error',
50
+ }),
51
+ ]);
52
+ }
53
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
54
+ (0, creditAgentViewReducer_1.saveCreditAgentMacroFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))),
55
+ (0, snackbarReducer_1.openSnackbar)({
56
+ messageSection: 'credit_agent_save_macro',
57
+ messageText: 'failed',
58
+ type: 'error',
59
+ }),
60
+ ])));
61
+ }));
62
+ exports.saveCreditAgentMacroEpic = saveCreditAgentMacroEpic;
@@ -0,0 +1,30 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
3
+ import { RootState } from '../../../reducer';
4
+ import { ZeniAPI } from '../../../zeniAPI';
5
+ import { scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronFailure, scheduleTenantCreditScoreCronSuccess } from '../creditAgentViewReducer';
6
+ export type ActionType = ReturnType<typeof scheduleTenantCreditScoreCron> | ReturnType<typeof scheduleTenantCreditScoreCronSuccess> | ReturnType<typeof scheduleTenantCreditScoreCronFailure> | ReturnType<typeof openSnackbar>;
7
+ export declare const scheduleTenantCreditScoreCronEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
8
+ payload: {
9
+ messageSection: import("../../..").SnackbarMessageSections;
10
+ messageText: import("../../..").SnackbarMessageSectionTexts;
11
+ type: import("../../..").SnackbarMessageType;
12
+ showStatusIcon?: boolean;
13
+ variables?: {
14
+ variableName: string;
15
+ variableValue: string;
16
+ }[];
17
+ };
18
+ type: "snackbar/openSnackbar";
19
+ } | {
20
+ payload: {
21
+ tenantId: string | undefined;
22
+ };
23
+ type: "creditAgentView/scheduleTenantCreditScoreCronSuccess";
24
+ } | {
25
+ payload: {
26
+ tenantId: string | undefined;
27
+ error: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
28
+ };
29
+ type: "creditAgentView/scheduleTenantCreditScoreCronFailure";
30
+ }>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scheduleTenantCreditScoreCronEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
7
+ const responsePayload_1 = require("../../../responsePayload");
8
+ const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
9
+ const scheduleTenantCreditScoreCronEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.scheduleTenantCreditScoreCron.match), (0, operators_1.mergeMap)((action) => {
10
+ const { tenantId } = action.payload;
11
+ const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/crons/cards/tenant-credit-score`;
12
+ const body = tenantId != null ? { tenant_id: tenantId } : {};
13
+ return zeniAPI.postAndGetJSON(url, body).pipe((0, operators_1.mergeMap)((response) => {
14
+ if ((0, responsePayload_1.isSuccessResponse)(response)) {
15
+ return (0, rxjs_1.from)([
16
+ (0, creditAgentViewReducer_1.scheduleTenantCreditScoreCronSuccess)(tenantId),
17
+ (0, snackbarReducer_1.openSnackbar)({
18
+ messageSection: 'credit_agent_schedule_cron',
19
+ messageText: 'success',
20
+ type: 'success',
21
+ }),
22
+ ]);
23
+ }
24
+ else {
25
+ return (0, rxjs_1.from)([
26
+ (0, creditAgentViewReducer_1.scheduleTenantCreditScoreCronFailure)(tenantId, response.status),
27
+ (0, snackbarReducer_1.openSnackbar)({
28
+ messageSection: 'credit_agent_schedule_cron',
29
+ messageText: 'failed',
30
+ type: 'error',
31
+ }),
32
+ ]);
33
+ }
34
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
35
+ (0, creditAgentViewReducer_1.scheduleTenantCreditScoreCronFailure)(tenantId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))),
36
+ (0, snackbarReducer_1.openSnackbar)({
37
+ messageSection: 'credit_agent_schedule_cron',
38
+ messageText: 'failed',
39
+ type: 'error',
40
+ }),
41
+ ])));
42
+ }));
43
+ exports.scheduleTenantCreditScoreCronEpic = scheduleTenantCreditScoreCronEpic;
@@ -0,0 +1,37 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { updateCreditAgentRow } from '../../../entity/creditAgent/creditAgentReducer';
3
+ import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
4
+ import { RootState } from '../../../reducer';
5
+ import { ZeniAPI } from '../../../zeniAPI';
6
+ import { updateCardProfile, updateCardProfileFailure, updateCardProfileSuccess } from '../creditAgentViewReducer';
7
+ export type ActionType = ReturnType<typeof updateCardProfile> | ReturnType<typeof updateCardProfileSuccess> | ReturnType<typeof updateCardProfileFailure> | ReturnType<typeof updateCreditAgentRow> | ReturnType<typeof openSnackbar>;
8
+ export declare const updateCardProfileEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
9
+ payload: {
10
+ messageSection: import("../../..").SnackbarMessageSections;
11
+ messageText: import("../../..").SnackbarMessageSectionTexts;
12
+ type: import("../../..").SnackbarMessageType;
13
+ showStatusIcon?: boolean;
14
+ variables?: {
15
+ variableName: string;
16
+ variableValue: string;
17
+ }[];
18
+ };
19
+ type: "snackbar/openSnackbar";
20
+ } | {
21
+ payload: {
22
+ tenantId: string;
23
+ };
24
+ type: "creditAgentView/updateCardProfileSuccess";
25
+ } | {
26
+ payload: {
27
+ tenantId: string;
28
+ error: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
29
+ };
30
+ type: "creditAgentView/updateCardProfileFailure";
31
+ } | {
32
+ payload: {
33
+ payload: import("../creditAgentViewPayload").CardTenantProfileRowPayload;
34
+ tenantId: string;
35
+ };
36
+ type: "creditAgent/updateCreditAgentRow";
37
+ }>;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateCardProfileEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const creditAgentReducer_1 = require("../../../entity/creditAgent/creditAgentReducer");
7
+ const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
8
+ const responsePayload_1 = require("../../../responsePayload");
9
+ const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
10
+ const updateCardProfileEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.updateCardProfile.match), (0, operators_1.mergeMap)((action) => {
11
+ const { tenantId, tenantEmailDomain, update } = action.payload;
12
+ const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cockpit/card-tenant-profiles`;
13
+ const body = {
14
+ tenant_namespace: tenantEmailDomain,
15
+ };
16
+ if (update.cardStatus != null) {
17
+ body.card_status = update.cardStatus;
18
+ }
19
+ if (update.creditLimit != null) {
20
+ body.credit_limit = update.creditLimit;
21
+ }
22
+ if (update.updatedByName != null) {
23
+ body.updated_by_name = update.updatedByName;
24
+ }
25
+ if (update.reason != null && update.reason.trim() !== '') {
26
+ body.reason = update.reason.trim();
27
+ }
28
+ return zeniAPI
29
+ .putAndGetJSON(url, body)
30
+ .pipe((0, operators_1.mergeMap)((response) => {
31
+ if ((0, responsePayload_1.isSuccessResponse)(response) &&
32
+ response.data != null &&
33
+ response.data.profile != null) {
34
+ return (0, rxjs_1.from)([
35
+ (0, creditAgentReducer_1.updateCreditAgentRow)({
36
+ payload: response.data.profile,
37
+ tenantId,
38
+ }),
39
+ (0, creditAgentViewReducer_1.updateCardProfileSuccess)(tenantId),
40
+ (0, snackbarReducer_1.openSnackbar)({
41
+ messageSection: 'credit_agent_update_profile',
42
+ messageText: 'success',
43
+ type: 'success',
44
+ }),
45
+ ]);
46
+ }
47
+ else {
48
+ return (0, rxjs_1.from)([
49
+ (0, creditAgentViewReducer_1.updateCardProfileFailure)(tenantId, response.status),
50
+ (0, snackbarReducer_1.openSnackbar)({
51
+ messageSection: 'credit_agent_update_profile',
52
+ messageText: 'failed',
53
+ type: 'error',
54
+ }),
55
+ ]);
56
+ }
57
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
58
+ (0, creditAgentViewReducer_1.updateCardProfileFailure)(tenantId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))),
59
+ (0, snackbarReducer_1.openSnackbar)({
60
+ messageSection: 'credit_agent_update_profile',
61
+ messageText: 'failed',
62
+ type: 'error',
63
+ }),
64
+ ])));
65
+ }));
66
+ exports.updateCardProfileEpic = updateCardProfileEpic;
@@ -37,7 +37,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
37
37
  export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
38
38
  export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
39
39
  export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
40
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request";
40
+ messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron";
41
41
  messageText: "notification" | "failed" | "success";
42
42
  type: "error" | "success" | "info";
43
43
  variables: {
@@ -18,12 +18,14 @@ const initializeTaskToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
18
18
  description: task.description,
19
19
  status: task.status.code,
20
20
  assignee: task.assignees,
21
+ groupAssignees: task.groupAssignees,
21
22
  dueDate: task.dueDate,
22
23
  priority: task.priority.code,
23
24
  tagIds: task.tagIds,
24
25
  fileIds: task.fileIds,
25
26
  type: task.type,
26
27
  recurringFrequency: task.recurringFrequency,
28
+ recurringDaysOfWeek: task.recurringDaysOfWeek,
27
29
  recurringEndDateLocalData: {
28
30
  recurringDatePickerOptionsType: 'date', // by default, date would be selected
29
31
  recurringEndDate: task.recurringEndDate,
@@ -95,9 +95,14 @@ const prepareTaskPayload = (state, taskId, taskGroupId) => {
95
95
  recurring_start_date: localData.type.code === 'recurring'
96
96
  ? (localData.recurringStartDate?.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) ?? null)
97
97
  : null,
98
+ recurring_days_of_week: localData.type.code === 'recurring' &&
99
+ localData.recurringFrequency === 'semi_weekly'
100
+ ? (localData.recurringDaysOfWeek ?? [])
101
+ : [],
98
102
  sync_token: syncToken,
99
103
  task_group_ids: taskGroupId != null ? [taskGroupId] : [],
100
104
  time_spent: (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(localData.timeSpent),
105
+ group_assignees: localData.groupAssignees,
101
106
  ...(taskId == null ? { is_private: localData.isPrivate ?? false } : {}),
102
107
  };
103
108
  };
@@ -1,5 +1,5 @@
1
1
  import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
- import { PriorityCodeType, TaskStatusCodeType, TaskType } from '../../../entity/task/taskState';
2
+ import { DayOfWeek, PriorityCodeType, TaskStatusCodeType, TaskType } from '../../../entity/task/taskState';
3
3
  import { ZeniDate } from '../../../zeniDayJS';
4
4
  import { RecurringDatePickerOptions, RecurringFrequencyType } from '../../common/recurringViewHelper';
5
5
  import { CommonHistoryView } from '../../spendManagement/commonHistoryView/commonHistory';
@@ -21,6 +21,7 @@ export interface EditTaskLocalData {
21
21
  assignee: ID[];
22
22
  description: string;
23
23
  fileIds: ID[];
24
+ groupAssignees: ID[];
24
25
  name: string;
25
26
  priority: PriorityCodeType;
26
27
  recurringEndDateLocalData: {
@@ -34,6 +35,7 @@ export interface EditTaskLocalData {
34
35
  type: TaskType;
35
36
  dueDate?: ZeniDate;
36
37
  isPrivate?: boolean;
38
+ recurringDaysOfWeek?: DayOfWeek[];
37
39
  recurringFrequency?: RecurringFrequencyType;
38
40
  recurringStartDate?: ZeniDate;
39
41
  savedRecurringEndDate?: ZeniDate;
@@ -6,6 +6,7 @@ exports.initialTaskDetailLocalData = {
6
6
  description: '',
7
7
  status: 'todo',
8
8
  assignee: [],
9
+ groupAssignees: [],
9
10
  dueDate: undefined,
10
11
  priority: 'medium',
11
12
  tagIds: [],
@@ -23,6 +23,7 @@ export interface TaskDetailSelectorView extends SelectorView {
23
23
  isDeleted?: boolean;
24
24
  recurringSourceTaskId?: ID;
25
25
  snoozedUntil?: ZeniDate | null;
26
+ taskGroupId?: ID;
26
27
  }
27
28
  export declare const getTaskDetail: (state: RootState, taskId?: ID) => TaskDetailSelectorView;
28
29
  export declare const allTaskStatus: TaskStatus[];
@@ -32,6 +32,7 @@ const getTaskDetail = (state, taskId) => {
32
32
  let isDeleted = undefined;
33
33
  let recurringSourceTaskId = undefined;
34
34
  let snoozedUntil = undefined;
35
+ let taskGroupId = undefined;
35
36
  if (taskId != null && sourceTaskDetail != null) {
36
37
  const taskEntity = (0, taskSelector_1.getTaskById)(taskState, taskId);
37
38
  const fileIdsInEntity = taskEntity?.fileIds ?? [];
@@ -41,6 +42,7 @@ const getTaskDetail = (state, taskId) => {
41
42
  isDeleted = taskEntity.isDeleted;
42
43
  recurringSourceTaskId = taskEntity.recurringSourceTaskId;
43
44
  snoozedUntil = taskEntity.snoozedUntil;
45
+ taskGroupId = taskEntity.taskGroupIds[0];
44
46
  }
45
47
  if (fileIdsInEntity.length > 0) {
46
48
  fetchStatus = (0, reduceFetchState_1.reduceFetchState)([
@@ -93,6 +95,7 @@ const getTaskDetail = (state, taskId) => {
93
95
  recurringSourceTaskId,
94
96
  showTaskDetailFormFooter,
95
97
  snoozedUntil,
98
+ taskGroupId,
96
99
  };
97
100
  };
98
101
  exports.getTaskDetail = getTaskDetail;
@@ -147,11 +150,13 @@ const showFormFooter = (taskDetailLocalData, taskDetailInStore) => {
147
150
  taskDetailLocalData.status !== taskDetailInStore.status.code ||
148
151
  !(0, isEqual_1.default)(taskDetailInStore.tagIds, taskDetailLocalData.tagIds) ||
149
152
  !(0, isEqual_1.default)(taskDetailLocalData.assignee, taskDetailInStore?.assignees ?? []) ||
153
+ !(0, isEqual_1.default)(taskDetailLocalData.groupAssignees, taskDetailInStore?.groupAssignees ?? []) ||
150
154
  !(0, isEqual_1.default)(taskDetailLocalData.fileIds, taskDetailInStore.fileIds ?? []) ||
151
155
  !(0, isEqual_1.default)(taskDetailLocalData.dueDate, taskDetailInStore.dueDate) ||
152
156
  !(0, isEqual_1.default)(taskDetailLocalData.type, taskDetailInStore.type) ||
153
157
  !(0, isEqual_1.default)(taskDetailLocalData.savedRecurringEndDate, taskDetailInStore.recurringEndDate) ||
154
158
  !(0, isEqual_1.default)(taskDetailLocalData.recurringFrequency, taskDetailInStore.recurringFrequency) ||
159
+ !(0, isEqual_1.default)(taskDetailLocalData.recurringDaysOfWeek, taskDetailInStore.recurringDaysOfWeek) ||
155
160
  !(0, isEqual_1.default)(taskDetailLocalData.recurringStartDate, taskDetailInStore.recurringStartDate) ||
156
161
  !(0, isEqual_1.default)(taskDetailLocalData.timeSpent, taskDetailInStore.timeSpent)) {
157
162
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.0.39",
3
+ "version": "5.0.41",
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",