@zeniai/client-epic-state 5.0.85-betaAS4 → 5.0.85-betaJK2

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 (49) hide show
  1. package/lib/entity/task/taskPayload.d.ts +3 -1
  2. package/lib/entity/task/taskPayload.js +2 -0
  3. package/lib/entity/task/taskState.d.ts +2 -0
  4. package/lib/entity/tenant/tenantPayload.d.ts +0 -3
  5. package/lib/entity/tenant/tenantReducer.d.ts +2 -2
  6. package/lib/entity/tenant/tenantReducer.js +10 -46
  7. package/lib/entity/tenant/tenantState.d.ts +1 -4
  8. package/lib/epic.d.ts +2 -3
  9. package/lib/epic.js +2 -3
  10. package/lib/esm/entity/task/taskPayload.js +2 -0
  11. package/lib/esm/entity/tenant/tenantReducer.js +9 -45
  12. package/lib/esm/epic.js +2 -3
  13. package/lib/esm/index.js +5 -5
  14. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +26 -11
  15. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +12 -2
  16. package/lib/esm/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +36 -28
  17. package/lib/esm/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewUIStateEpic.js +16 -0
  18. package/lib/esm/view/companyView/epic/fetchAllCockpitViewsEpic.js +2 -2
  19. package/lib/esm/view/createTransferEntry/epics/createTransferEntryEpic.js +1 -7
  20. package/lib/esm/view/dashboard/dashboardReducer.js +1 -11
  21. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +1 -1
  22. package/lib/esm/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +1 -45
  23. package/lib/index.d.ts +6 -6
  24. package/lib/index.js +24 -25
  25. package/lib/view/companyTaskManagerView/companyTaskManagerViewPayload.d.ts +13 -15
  26. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +5 -4
  27. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +27 -12
  28. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +2 -0
  29. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +11 -1
  30. package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +3 -3
  31. package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.d.ts +1 -3
  32. package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +36 -28
  33. package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewUIStateEpic.d.ts +6 -0
  34. package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewUIStateEpic.js +20 -0
  35. package/lib/view/companyView/epic/fetchAllCockpitViewsEpic.js +2 -2
  36. package/lib/view/companyView/types/cockpitTypes.d.ts +2 -1
  37. package/lib/view/createTransferEntry/epics/createTransferEntryEpic.js +1 -7
  38. package/lib/view/dashboard/dashboardReducer.js +1 -11
  39. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +1 -1
  40. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
  41. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +2 -46
  42. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +0 -2
  43. package/package.json +1 -1
  44. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -18
  45. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -18
  46. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +0 -8
  47. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -22
  48. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +0 -8
  49. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -22
@@ -1,7 +1,6 @@
1
1
  import { FetchState, FetchedState, ID } from '../../commonStateTypes/common';
2
2
  import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes';
3
- import { PageToken } from '../../commonStateTypes/viewAndReport/viewAndReport';
4
- import { TaskManagerViewSortKey } from '../companyView/types/cockpitTypes';
3
+ import { CockpitFilters, TaskManagerViewSortKey } from '../companyView/types/cockpitTypes';
5
4
  export interface TaskManagerMetrics {
6
5
  closed: number;
7
6
  open: number;
@@ -9,8 +8,9 @@ export interface TaskManagerMetrics {
9
8
  total: number;
10
9
  }
11
10
  export interface CompanyTaskManagerViewUIState {
11
+ filters: CockpitFilters;
12
12
  filterText: string;
13
- pageToken: PageToken;
13
+ from: number;
14
14
  sortKey: TaskManagerViewSortKey;
15
15
  sortOrder: SortOrder;
16
16
  }
@@ -1,11 +1,9 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
- import { updateCompanies } from '../../../entity/company/companyReducer';
4
3
  import { updateTags } from '../../../entity/tag/tagReducer';
5
4
  import { updateTasks } from '../../../entity/task/taskReducer';
6
- import { updateAllUsers } from '../../../entity/user/userReducer';
7
5
  import { RootState } from '../../../reducer';
8
6
  import { ZeniAPI } from '../../../zeniAPI';
9
7
  import { fetchCompanyTaskManagerView, updateCompanyTaskManagerViewOnFailure, updateCompanyTaskManagerViewOnSuccess } from '../companyTaskManagerViewReducer';
10
- export type ActionType = ReturnType<typeof fetchCompanyTaskManagerView> | ReturnType<typeof updateCompanyTaskManagerViewOnSuccess> | ReturnType<typeof updateTasks> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateTags> | ReturnType<typeof updateCompanyTaskManagerViewOnFailure>;
8
+ export type ActionType = ReturnType<typeof fetchCompanyTaskManagerView> | ReturnType<typeof updateCompanyTaskManagerViewOnSuccess> | ReturnType<typeof updateTasks> | ReturnType<typeof updateTags> | ReturnType<typeof updateCompanyTaskManagerViewOnFailure>;
11
9
  export declare const fetchCompanyTaskManagerViewEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -4,51 +4,34 @@ exports.fetchCompanyTaskManagerViewEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const sortOrderPayload_1 = require("../../../commonPayloadTypes/sortOrderPayload");
7
- const companyReducer_1 = require("../../../entity/company/companyReducer");
8
7
  const tagReducer_1 = require("../../../entity/tag/tagReducer");
9
8
  const taskReducer_1 = require("../../../entity/task/taskReducer");
10
- const userReducer_1 = require("../../../entity/user/userReducer");
11
9
  const responsePayload_1 = require("../../../responsePayload");
12
10
  const companyTaskManagerViewReducer_1 = require("../companyTaskManagerViewReducer");
13
- const toSortKeyPayload = (sortKey) => {
14
- switch (sortKey) {
15
- case 'taskName':
16
- return 'name';
17
- case 'dueDate':
18
- return 'due_date';
19
- case 'createdBy':
20
- return 'created_by';
21
- case 'name':
22
- return 'company_name';
23
- default:
24
- return sortKey;
25
- }
26
- };
11
+ const DEFAULT_PAGE_SIZE = 100;
27
12
  const fetchCompanyTaskManagerViewEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView.match), (0, operators_1.switchMap)((action) => {
28
- const { pageToken, sortKey, sortOrder, searchString } = action.payload;
13
+ const { from: fromOffset, searchString, sortKey, sortOrder, filters, } = action.payload;
29
14
  const queryValue = {
30
- page_token: pageToken,
15
+ size: DEFAULT_PAGE_SIZE,
16
+ from: fromOffset,
17
+ global_search: searchString ?? '',
31
18
  sort_by: toSortKeyPayload(sortKey),
32
19
  sort_order: (0, sortOrderPayload_1.getSortOrder)(sortOrder),
33
- search_text: searchString ?? '',
34
- view: 'cockpit_task_manager_view',
20
+ ...(filters?.categories != null && filters.categories.length > 0
21
+ ? { filter_by: toFilterByPayload(filters) }
22
+ : {}),
35
23
  };
36
24
  return zeniAPI
37
- .getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels/tasks?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
25
+ .getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels/tasks-es?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
38
26
  .pipe((0, operators_1.mergeMap)((response) => {
39
27
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
40
- const tasksList = response.data.tasks;
28
+ const tasksList = response.data.aggregations.group_by_company_name.buckets.flatMap((bucket) => bucket.tasks);
41
29
  const actions = [
42
30
  (0, companyTaskManagerViewReducer_1.updateCompanyTaskManagerViewOnSuccess)({
43
31
  data: response.data,
44
32
  }),
45
33
  (0, taskReducer_1.updateTasks)(tasksList),
46
- (0, companyReducer_1.updateCompanies)({
47
- payload: response.data.companies,
48
- schema: {},
49
- }),
50
- (0, tagReducer_1.updateTags)(tasksList.map((task) => task.tags).flat()),
51
- (0, userReducer_1.updateAllUsers)({ users: response.data.users }),
34
+ (0, tagReducer_1.updateTags)(tasksList.flatMap((task) => task.tags)),
52
35
  ];
53
36
  return (0, rxjs_1.from)(actions);
54
37
  }
@@ -66,3 +49,28 @@ const fetchCompanyTaskManagerViewEpic = (actions$, _state$, zeniAPI) => actions$
66
49
  }));
67
50
  }));
68
51
  exports.fetchCompanyTaskManagerViewEpic = fetchCompanyTaskManagerViewEpic;
52
+ const toSortKeyPayload = (sortKey) => {
53
+ switch (sortKey) {
54
+ case 'taskName':
55
+ return 'name';
56
+ case 'dueDate':
57
+ return 'due_date';
58
+ case 'createdBy':
59
+ return 'created_by';
60
+ case 'name':
61
+ return 'company_name';
62
+ default:
63
+ return sortKey;
64
+ }
65
+ };
66
+ const toFilterByPayload = (filters) => {
67
+ if (filters.categories == null) {
68
+ return [];
69
+ }
70
+ return filters.categories.map((category) => ({
71
+ field: category.field ?? '',
72
+ operator: category.matchingOperator === 'equal' ? 'is' : 'is_not',
73
+ values: category.values.map((v) => String(v)),
74
+ join: category.valuesCombinationOperator === 'ALL' ? 'and' : 'or',
75
+ }));
76
+ };
@@ -0,0 +1,6 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../reducer';
4
+ import { fetchCompanyTaskManagerView, updateCompanyTaskManagerViewUIState } from '../companyTaskManagerViewReducer';
5
+ export type ActionType = ReturnType<typeof updateCompanyTaskManagerViewUIState> | ReturnType<typeof fetchCompanyTaskManagerView>;
6
+ export declare const updateCompanyTaskManagerViewUIStateEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateCompanyTaskManagerViewUIStateEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const companyTaskManagerViewReducer_1 = require("../companyTaskManagerViewReducer");
7
+ const updateCompanyTaskManagerViewUIStateEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(companyTaskManagerViewReducer_1.updateCompanyTaskManagerViewUIState.match), (0, operators_1.switchMap)((action) => {
8
+ const filters = action.payload.filters;
9
+ const allCategoriesValid = filters?.categories == null
10
+ ? true
11
+ : filters?.categories?.every((category) => category.field != null &&
12
+ category.values != null &&
13
+ category.values.length > 0);
14
+ if (!allCategoriesValid) {
15
+ return rxjs_1.EMPTY;
16
+ }
17
+ const { uiState } = state$.value.companyTaskManagerViewState;
18
+ return (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(0, uiState.sortKey, uiState.sortOrder, false, uiState.filterText, filters));
19
+ }));
20
+ exports.updateCompanyTaskManagerViewUIStateEpic = updateCompanyTaskManagerViewUIStateEpic;
@@ -24,7 +24,7 @@ const fetchAllCockpitViewsEpic = (actions$, state$) => actions$.pipe((0, operato
24
24
  (0, reviewCompanyViewReducer_1.fetchReviewCompanyView)(),
25
25
  (0, companyHealthMetricViewReducer_1.fetchCompanyHealthMetricView)(),
26
26
  (0, companyViewReducer_1.fetchCompanyMetaData)(),
27
- (0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(null, 'dueDate', 'descending', false),
27
+ (0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(0, 'dueDate', 'descending', false),
28
28
  (0, companyHealthMetricConfigReducer_1.fetchCompanyHealthMetricConfig)(),
29
29
  ]);
30
30
  }
@@ -77,7 +77,7 @@ const fetchAllCockpitViewsEpic = (actions$, state$) => actions$.pipe((0, operato
77
77
  }
78
78
  if (state.companyTaskManagerViewState.fetchState !== 'In-Progress' &&
79
79
  state.companyTaskManagerViewState.hasValidState() === false) {
80
- fetchActions.push((0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(null, 'dueDate', 'descending', false));
80
+ fetchActions.push((0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(0, 'dueDate', 'descending', false));
81
81
  }
82
82
  return (0, rxjs_1.from)(fetchActions);
83
83
  }
@@ -18,11 +18,12 @@ export type ManagementViewFilterCategoryField = 'controllerUserIds' | 'customerS
18
18
  export type SubscriptionViewFilterCategoryField = 'controllerUserIds' | 'statusCode' | 'recommendedActionCode' | 'subscriptionPlans' | 'subscriptionAddOns' | 'avg2MonthExpenses' | 'slabLowerLimit' | 'slabUpperLimit' | 'monthlyRecurringRevenue';
19
19
  export type PortfolioViewFilterCategoryField = 'netBurnOrIncome' | 'cashPosition' | 'income' | 'expenses' | 'runway';
20
20
  export type HealthMonitorViewFilterCategoryField = 'verticalProductServices' | 'runway' | 'netPromoterScore' | 'customerSatisfactionScore' | 'churnProbabilityPercentage' | 'controller' | 'customerSuccessManager' | 'lastReportSent' | 'subscriptionStartDate' | 'subscriptionRenewalDate' | 'externalProductServiceExposure' | 'companyEngagementMetricsUpdatedAt' | 'companyGroupId' | 'monthlyRecurringRevenue';
21
+ export type TaskManagerViewFilterCategoryField = 'assignee' | 'creationDate' | 'dueDate' | 'priority' | 'status' | 'tag';
21
22
  export interface CockpitFilterCategory {
22
23
  matchingOperator: 'equal' | 'not_equal';
23
24
  values: FilterCategoryValueType[];
24
25
  valuesCombinationOperator: 'ANY' | 'ALL';
25
- field?: AiAccountantFilterCategoryField | ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField;
26
+ field?: AiAccountantFilterCategoryField | ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField | TaskManagerViewFilterCategoryField;
26
27
  }
27
28
  export interface CockpitFilters {
28
29
  categories?: CockpitFilterCategory[];
@@ -108,18 +108,12 @@ const createTransferEntryEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0
108
108
  id: transactionId,
109
109
  type: sourceTransactionType,
110
110
  };
111
- // The server contract for `transaction-type-update` expects
112
- // `transaction_memo`, but the client-side action payload field is named
113
- // `memo` (callers in web-components dispatch with `memo`). The names are
114
- // intentionally kept separate: `memo` is the internal client model and
115
- // `transaction_memo` is the wire format. Don't unify them without
116
- // updating the action contract and all dispatchers in lockstep.
117
111
  const payload = {
118
112
  transaction_type: transactionType,
119
113
  transaction_id: transactionId,
120
114
  to_account_integration_id: creditAccountIntegrationId,
121
115
  from_account_integration_id: debitAccountIntegrationId,
122
- transaction_memo: memo ?? '',
116
+ memo: memo ?? '',
123
117
  };
124
118
  return zeniAPI
125
119
  .postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/transactions/transaction-type-update`, payload)
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.clearDashboard = exports.updateTreasuryVideoClosed = exports.fetchDashboard = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const zeniDayJS_1 = require("../../zeniDayJS");
7
- const treasurySetupViewReducer_1 = require("../spendManagement/treasury/treasurySetUp/treasurySetupViewReducer");
8
7
  exports.initialState = {
9
- isTreasuryVideoClosed: false,
10
8
  lastFetchRequestTime: undefined,
9
+ isTreasuryVideoClosed: false,
11
10
  };
12
11
  const dashboard = (0, toolkit_1.createSlice)({
13
12
  name: 'dashboard',
@@ -37,15 +36,6 @@ const dashboard = (0, toolkit_1.createSlice)({
37
36
  Object.assign(draft, exports.initialState);
38
37
  },
39
38
  },
40
- extraReducers: (builder) => {
41
- builder
42
- .addCase(treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClicked, (draft) => {
43
- draft.isTreasuryVideoClosed = true;
44
- })
45
- .addCase(treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClick, (draft) => {
46
- draft.isTreasuryVideoClosed = true;
47
- });
48
- },
49
39
  });
50
40
  _a = dashboard.actions, exports.fetchDashboard = _a.fetchDashboard, exports.updateTreasuryVideoClosed = _a.updateTreasuryVideoClosed, exports.clearDashboard = _a.clearDashboard;
51
41
  exports.default = dashboard.reducer;
@@ -17,6 +17,6 @@ const updateTreasuryVideoViewedEpic = (actions$, _state$, zeniAPI) => actions$.p
17
17
  return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryVideoViewedFailure)(response.status));
18
18
  }
19
19
  }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryVideoViewedFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update treasury video viewed REST API call errored out' +
20
- (error?.message ?? JSON.stringify(error)))))));
20
+ JSON.stringify(error))))));
21
21
  }));
22
22
  exports.updateTreasuryVideoViewedEpic = updateTreasuryVideoViewedEpic;
@@ -15,6 +15,6 @@ export declare const fetchTreasuryFunds: import("@reduxjs/toolkit").ActionCreato
15
15
  }, "treasurySetupView/updatePortfolioAllocation", never, never>, updatePortfolioAllocationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdatePortfolioAllocationPayload, "treasurySetupView/updatePortfolioAllocationSuccess">, updatePortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updatePortfolioAllocationFailure", never, never>, fetchPortfolioAllocation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/fetchPortfolioAllocation">, fetchPortfolioAllocationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
16
16
  allocation_percentages: Record<string, number>;
17
17
  custom_corporate_id: string | null;
18
- }, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData">, updateTreasuryPromoIntroClosedByOutsideClick: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryPromoIntroClosedByOutsideClick">, updateTreasuryPromoIntroClosedByOutsideClickFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updateTreasuryPromoIntroClosedByOutsideClickFailure">, updateTreasuryPromoIntroClosedByOutsideClickSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryPromoIntroClosedByOutsideClickSuccess">, updateTreasuryPromoRemindMeLaterClicked: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryPromoRemindMeLaterClicked">, updateTreasuryPromoRemindMeLaterClickedFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updateTreasuryPromoRemindMeLaterClickedFailure">, updateTreasuryPromoRemindMeLaterClickedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryPromoRemindMeLaterClickedSuccess">, updateTreasuryVideoViewed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryVideoViewed">, updateTreasuryVideoViewedFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updateTreasuryVideoViewedFailure">, updateTreasuryVideoViewedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryVideoViewedSuccess">;
18
+ }, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData">, updateTreasuryVideoViewed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryVideoViewed">, updateTreasuryVideoViewedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/updateTreasuryVideoViewedSuccess">, updateTreasuryVideoViewedFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updateTreasuryVideoViewedFailure">;
19
19
  declare const _default: import("redux").Reducer<TreasurySetupViewState>;
20
20
  export default _default;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  var _a;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.updateTreasuryVideoViewedSuccess = exports.updateTreasuryVideoViewedFailure = exports.updateTreasuryVideoViewed = exports.updateTreasuryPromoRemindMeLaterClickedSuccess = exports.updateTreasuryPromoRemindMeLaterClickedFailure = exports.updateTreasuryPromoRemindMeLaterClicked = exports.updateTreasuryPromoIntroClosedByOutsideClickSuccess = exports.updateTreasuryPromoIntroClosedByOutsideClickFailure = exports.updateTreasuryPromoIntroClosedByOutsideClick = exports.updateFundAllocationLocalData = exports.fetchPortfolioAllocationFailure = exports.fetchPortfolioAllocationSuccess = exports.fetchPortfolioAllocation = exports.updatePortfolioAllocationFailure = exports.updatePortfolioAllocationSuccess = exports.updatePortfolioAllocation = exports.updateTreasuryFundsFailure = exports.updateTreasuryFundsSuccess = exports.clearTreasurySetupView = exports.acceptTreasuryTermsFailure = exports.acceptTreasuryTermsSuccess = exports.acceptTreasuryTerms = exports.fetchTreasurySetupViewFailure = exports.fetchTreasurySetupViewSuccess = exports.fetchTreasurySetupView = exports.fetchTreasuryFunds = exports.initialState = void 0;
7
+ exports.updateTreasuryVideoViewedFailure = exports.updateTreasuryVideoViewedSuccess = exports.updateTreasuryVideoViewed = exports.updateFundAllocationLocalData = exports.fetchPortfolioAllocationFailure = exports.fetchPortfolioAllocationSuccess = exports.fetchPortfolioAllocation = exports.updatePortfolioAllocationFailure = exports.updatePortfolioAllocationSuccess = exports.updatePortfolioAllocation = exports.updateTreasuryFundsFailure = exports.updateTreasuryFundsSuccess = exports.clearTreasurySetupView = exports.acceptTreasuryTermsFailure = exports.acceptTreasuryTermsSuccess = exports.acceptTreasuryTerms = exports.fetchTreasurySetupViewFailure = exports.fetchTreasurySetupViewSuccess = exports.fetchTreasurySetupView = exports.fetchTreasuryFunds = exports.initialState = void 0;
8
8
  const toolkit_1 = require("@reduxjs/toolkit");
9
9
  const isEqual_1 = __importDefault(require("lodash/isEqual"));
10
10
  const zeniDayJS_1 = require("../../../../zeniDayJS");
@@ -40,14 +40,6 @@ exports.initialState = {
40
40
  fetchState: 'Not-Started',
41
41
  error: undefined,
42
42
  },
43
- updateTreasuryPromoIntroClosedByOutsideClickStatus: {
44
- fetchState: 'Not-Started',
45
- error: undefined,
46
- },
47
- updateTreasuryPromoRemindMeLaterClickedStatus: {
48
- fetchState: 'Not-Started',
49
- error: undefined,
50
- },
51
43
  updateTreasuryVideoViewedStatus: {
52
44
  fetchState: 'Not-Started',
53
45
  error: undefined,
@@ -305,48 +297,12 @@ const treasurySetupView = (0, toolkit_1.createSlice)({
305
297
  error: action.payload,
306
298
  };
307
299
  },
308
- updateTreasuryPromoRemindMeLaterClicked(draft) {
309
- draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
310
- fetchState: 'In-Progress',
311
- error: undefined,
312
- };
313
- },
314
- updateTreasuryPromoRemindMeLaterClickedSuccess(draft) {
315
- draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
316
- fetchState: 'Completed',
317
- error: undefined,
318
- };
319
- },
320
- updateTreasuryPromoRemindMeLaterClickedFailure(draft, action) {
321
- draft.updateTreasuryPromoRemindMeLaterClickedStatus = {
322
- fetchState: 'Error',
323
- error: action.payload,
324
- };
325
- },
326
- updateTreasuryPromoIntroClosedByOutsideClick(draft) {
327
- draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
328
- fetchState: 'In-Progress',
329
- error: undefined,
330
- };
331
- },
332
- updateTreasuryPromoIntroClosedByOutsideClickSuccess(draft) {
333
- draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
334
- fetchState: 'Completed',
335
- error: undefined,
336
- };
337
- },
338
- updateTreasuryPromoIntroClosedByOutsideClickFailure(draft, action) {
339
- draft.updateTreasuryPromoIntroClosedByOutsideClickStatus = {
340
- fetchState: 'Error',
341
- error: action.payload,
342
- };
343
- },
344
300
  clearTreasurySetupView(draft) {
345
301
  Object.assign(draft, exports.initialState);
346
302
  },
347
303
  },
348
304
  });
349
- _a = treasurySetupView.actions, exports.fetchTreasuryFunds = _a.fetchTreasuryFunds, exports.fetchTreasurySetupView = _a.fetchTreasurySetupView, exports.fetchTreasurySetupViewSuccess = _a.fetchTreasurySetupViewSuccess, exports.fetchTreasurySetupViewFailure = _a.fetchTreasurySetupViewFailure, exports.acceptTreasuryTerms = _a.acceptTreasuryTerms, exports.acceptTreasuryTermsSuccess = _a.acceptTreasuryTermsSuccess, exports.acceptTreasuryTermsFailure = _a.acceptTreasuryTermsFailure, exports.clearTreasurySetupView = _a.clearTreasurySetupView, exports.updateTreasuryFundsSuccess = _a.updateTreasuryFundsSuccess, exports.updateTreasuryFundsFailure = _a.updateTreasuryFundsFailure, exports.updatePortfolioAllocation = _a.updatePortfolioAllocation, exports.updatePortfolioAllocationSuccess = _a.updatePortfolioAllocationSuccess, exports.updatePortfolioAllocationFailure = _a.updatePortfolioAllocationFailure, exports.fetchPortfolioAllocation = _a.fetchPortfolioAllocation, exports.fetchPortfolioAllocationSuccess = _a.fetchPortfolioAllocationSuccess, exports.fetchPortfolioAllocationFailure = _a.fetchPortfolioAllocationFailure, exports.updateFundAllocationLocalData = _a.updateFundAllocationLocalData, exports.updateTreasuryPromoIntroClosedByOutsideClick = _a.updateTreasuryPromoIntroClosedByOutsideClick, exports.updateTreasuryPromoIntroClosedByOutsideClickFailure = _a.updateTreasuryPromoIntroClosedByOutsideClickFailure, exports.updateTreasuryPromoIntroClosedByOutsideClickSuccess = _a.updateTreasuryPromoIntroClosedByOutsideClickSuccess, exports.updateTreasuryPromoRemindMeLaterClicked = _a.updateTreasuryPromoRemindMeLaterClicked, exports.updateTreasuryPromoRemindMeLaterClickedFailure = _a.updateTreasuryPromoRemindMeLaterClickedFailure, exports.updateTreasuryPromoRemindMeLaterClickedSuccess = _a.updateTreasuryPromoRemindMeLaterClickedSuccess, exports.updateTreasuryVideoViewed = _a.updateTreasuryVideoViewed, exports.updateTreasuryVideoViewedFailure = _a.updateTreasuryVideoViewedFailure, exports.updateTreasuryVideoViewedSuccess = _a.updateTreasuryVideoViewedSuccess;
305
+ _a = treasurySetupView.actions, exports.fetchTreasuryFunds = _a.fetchTreasuryFunds, exports.fetchTreasurySetupView = _a.fetchTreasurySetupView, exports.fetchTreasurySetupViewSuccess = _a.fetchTreasurySetupViewSuccess, exports.fetchTreasurySetupViewFailure = _a.fetchTreasurySetupViewFailure, exports.acceptTreasuryTerms = _a.acceptTreasuryTerms, exports.acceptTreasuryTermsSuccess = _a.acceptTreasuryTermsSuccess, exports.acceptTreasuryTermsFailure = _a.acceptTreasuryTermsFailure, exports.clearTreasurySetupView = _a.clearTreasurySetupView, exports.updateTreasuryFundsSuccess = _a.updateTreasuryFundsSuccess, exports.updateTreasuryFundsFailure = _a.updateTreasuryFundsFailure, exports.updatePortfolioAllocation = _a.updatePortfolioAllocation, exports.updatePortfolioAllocationSuccess = _a.updatePortfolioAllocationSuccess, exports.updatePortfolioAllocationFailure = _a.updatePortfolioAllocationFailure, exports.fetchPortfolioAllocation = _a.fetchPortfolioAllocation, exports.fetchPortfolioAllocationSuccess = _a.fetchPortfolioAllocationSuccess, exports.fetchPortfolioAllocationFailure = _a.fetchPortfolioAllocationFailure, exports.updateFundAllocationLocalData = _a.updateFundAllocationLocalData, exports.updateTreasuryVideoViewed = _a.updateTreasuryVideoViewed, exports.updateTreasuryVideoViewedSuccess = _a.updateTreasuryVideoViewedSuccess, exports.updateTreasuryVideoViewedFailure = _a.updateTreasuryVideoViewedFailure;
350
306
  exports.default = treasurySetupView.reducer;
351
307
  function mapTreasuryFundsPayloadToFundData(fundsPayload) {
352
308
  return fundsPayload.funds.map((fund) => ({
@@ -16,8 +16,6 @@ export interface TreasurySetupViewState extends FetchedState {
16
16
  fundAllocationOptions: FundAllocationOption[];
17
17
  fundsDetails: FundData[];
18
18
  };
19
- updateTreasuryPromoIntroClosedByOutsideClickStatus: FetchStateAndError;
20
- updateTreasuryPromoRemindMeLaterClickedStatus: FetchStateAndError;
21
19
  updateTreasuryVideoViewedStatus: FetchStateAndError;
22
20
  treasuryTermsDetails?: {
23
21
  fetchStatus: FetchStateAndError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.0.85-betaAS4",
3
+ "version": "5.0.85-betaJK2",
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",
@@ -1,18 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
4
- import { createZeniAPIStatus, isSuccessStatus, } from '../../../../../responsePayload';
5
- import { updateTreasuryPromoIntroClosedByOutsideClick, updateTreasuryPromoIntroClosedByOutsideClickFailure, updateTreasuryPromoIntroClosedByOutsideClickSuccess, } from '../treasurySetupViewReducer';
6
- export const updateTreasuryPromoIntroClosedByOutsideClickEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(updateTreasuryPromoIntroClosedByOutsideClick.match), switchMap(() => {
7
- return zeniAPI
8
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_intro_closed_by_outside_click: true })
9
- .pipe(mergeMap((response) => {
10
- if (isSuccessStatus(response)) {
11
- return of(updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser(), updateTreasuryPromoIntroClosedByOutsideClickSuccess());
12
- }
13
- else {
14
- return of(updateTreasuryPromoIntroClosedByOutsideClickFailure(response.status));
15
- }
16
- }), catchError((error) => of(updateTreasuryPromoIntroClosedByOutsideClickFailure(createZeniAPIStatus('Unexpected error', 'Update treasury promo intro closed by outside click REST API call errored out' +
17
- (error?.message ?? JSON.stringify(error)))))));
18
- }));
@@ -1,18 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { updateTreasuryPromoRemindMeLaterClickedForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
4
- import { createZeniAPIStatus, isSuccessStatus, } from '../../../../../responsePayload';
5
- import { updateTreasuryPromoRemindMeLaterClicked, updateTreasuryPromoRemindMeLaterClickedFailure, updateTreasuryPromoRemindMeLaterClickedSuccess, } from '../treasurySetupViewReducer';
6
- export const updateTreasuryPromoRemindMeLaterClickedEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(updateTreasuryPromoRemindMeLaterClicked.match), switchMap(() => {
7
- return zeniAPI
8
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_video_remind_me_later_clicked: true })
9
- .pipe(mergeMap((response) => {
10
- if (isSuccessStatus(response)) {
11
- return of(updateTreasuryPromoRemindMeLaterClickedForLoggedInUser(), updateTreasuryPromoRemindMeLaterClickedSuccess());
12
- }
13
- else {
14
- return of(updateTreasuryPromoRemindMeLaterClickedFailure(response.status));
15
- }
16
- }), catchError((error) => of(updateTreasuryPromoRemindMeLaterClickedFailure(createZeniAPIStatus('Unexpected error', 'Update treasury promo remind me later REST API call errored out' +
17
- (error?.message ?? JSON.stringify(error)))))));
18
- }));
@@ -1,8 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
4
- import { RootState } from '../../../../../reducer';
5
- import { ZeniAPI } from '../../../../../zeniAPI';
6
- import { updateTreasuryPromoIntroClosedByOutsideClick, updateTreasuryPromoIntroClosedByOutsideClickFailure, updateTreasuryPromoIntroClosedByOutsideClickSuccess } from '../treasurySetupViewReducer';
7
- export type ActionType = ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClick> | ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser> | ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClickSuccess> | ReturnType<typeof updateTreasuryPromoIntroClosedByOutsideClickFailure>;
8
- export declare const updateTreasuryPromoIntroClosedByOutsideClickEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateTreasuryPromoIntroClosedByOutsideClickEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const tenantReducer_1 = require("../../../../../entity/tenant/tenantReducer");
7
- const responsePayload_1 = require("../../../../../responsePayload");
8
- const treasurySetupViewReducer_1 = require("../treasurySetupViewReducer");
9
- const updateTreasuryPromoIntroClosedByOutsideClickEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClick.match), (0, operators_1.switchMap)(() => {
10
- return zeniAPI
11
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_intro_closed_by_outside_click: true })
12
- .pipe((0, operators_1.mergeMap)((response) => {
13
- if ((0, responsePayload_1.isSuccessStatus)(response)) {
14
- return (0, rxjs_1.of)((0, tenantReducer_1.updateTreasuryPromoIntroClosedByOutsideClickForLoggedInUser)(), (0, treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClickSuccess)());
15
- }
16
- else {
17
- return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClickFailure)(response.status));
18
- }
19
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoIntroClosedByOutsideClickFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update treasury promo intro closed by outside click REST API call errored out' +
20
- (error?.message ?? JSON.stringify(error)))))));
21
- }));
22
- exports.updateTreasuryPromoIntroClosedByOutsideClickEpic = updateTreasuryPromoIntroClosedByOutsideClickEpic;
@@ -1,8 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateTreasuryPromoRemindMeLaterClickedForLoggedInUser } from '../../../../../entity/tenant/tenantReducer';
4
- import { RootState } from '../../../../../reducer';
5
- import { ZeniAPI } from '../../../../../zeniAPI';
6
- import { updateTreasuryPromoRemindMeLaterClicked, updateTreasuryPromoRemindMeLaterClickedFailure, updateTreasuryPromoRemindMeLaterClickedSuccess } from '../treasurySetupViewReducer';
7
- export type ActionType = ReturnType<typeof updateTreasuryPromoRemindMeLaterClicked> | ReturnType<typeof updateTreasuryPromoRemindMeLaterClickedForLoggedInUser> | ReturnType<typeof updateTreasuryPromoRemindMeLaterClickedSuccess> | ReturnType<typeof updateTreasuryPromoRemindMeLaterClickedFailure>;
8
- export declare const updateTreasuryPromoRemindMeLaterClickedEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateTreasuryPromoRemindMeLaterClickedEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const tenantReducer_1 = require("../../../../../entity/tenant/tenantReducer");
7
- const responsePayload_1 = require("../../../../../responsePayload");
8
- const treasurySetupViewReducer_1 = require("../treasurySetupViewReducer");
9
- const updateTreasuryPromoRemindMeLaterClickedEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClicked.match), (0, operators_1.switchMap)(() => {
10
- return zeniAPI
11
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/user/self`, { is_treasury_promo_video_remind_me_later_clicked: true })
12
- .pipe((0, operators_1.mergeMap)((response) => {
13
- if ((0, responsePayload_1.isSuccessStatus)(response)) {
14
- return (0, rxjs_1.of)((0, tenantReducer_1.updateTreasuryPromoRemindMeLaterClickedForLoggedInUser)(), (0, treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClickedSuccess)());
15
- }
16
- else {
17
- return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClickedFailure)(response.status));
18
- }
19
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updateTreasuryPromoRemindMeLaterClickedFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update treasury promo remind me later REST API call errored out' +
20
- (error?.message ?? JSON.stringify(error)))))));
21
- }));
22
- exports.updateTreasuryPromoRemindMeLaterClickedEpic = updateTreasuryPromoRemindMeLaterClickedEpic;