@zeniai/client-epic-state 4.19.7 → 4.19.8-betaAR1

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.
@@ -3,7 +3,8 @@ import { AccountListResponse } from './accountListPayload';
3
3
  import { AccountList, AccountListKeyType, AccountListState } from './accountListState';
4
4
  export declare const initialAccountList: AccountList;
5
5
  export declare const initialState: AccountListState;
6
- export declare const fetchAccountList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountListKey: AccountListKeyType, fetchFullResponse?: any, excludeAccountPayableAccounts?: any, excludeAccountReceivableAccounts?: any, isLimitedCategoryEnabled?: any, filterAccountTypes?: ("cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets")[] | undefined], {
6
+ export declare const fetchAccountList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountListKey: AccountListKeyType, fetchFullResponse?: any, excludeAccountPayableAccounts?: any, excludeAccountReceivableAccounts?: any, isLimitedCategoryEnabled?: any, filterAccountTypes?: ("cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets")[] | undefined, isIncludeDeleted?: boolean | undefined], {
7
+ isIncludeDeleted?: true | undefined;
7
8
  accountListKey: AccountListKeyType;
8
9
  fetchFullResponse: any;
9
10
  excludeAccountPayableAccounts: any;
@@ -45,16 +45,13 @@ const accountList = (0, toolkit_1.createSlice)({
45
45
  const existingData = draft.byReportId[action.payload.accountListKey];
46
46
  draft.byReportId[action.payload.accountListKey] = Object.assign(Object.assign({}, existingData), { fetchState: 'In-Progress', error: undefined });
47
47
  },
48
- prepare(accountListKey, fetchFullResponse = false, excludeAccountPayableAccounts = false, excludeAccountReceivableAccounts = false, isLimitedCategoryEnabled = false, filterAccountTypes) {
48
+ prepare(accountListKey, fetchFullResponse = false, excludeAccountPayableAccounts = false, excludeAccountReceivableAccounts = false, isLimitedCategoryEnabled = false, filterAccountTypes, isIncludeDeleted) {
49
49
  return {
50
- payload: {
51
- accountListKey,
50
+ payload: Object.assign({ accountListKey,
52
51
  fetchFullResponse,
53
52
  excludeAccountPayableAccounts,
54
53
  excludeAccountReceivableAccounts,
55
- isLimitedCategoryEnabled,
56
- filterAccountTypes: filterAccountTypes !== null && filterAccountTypes !== void 0 ? filterAccountTypes : [],
57
- },
54
+ isLimitedCategoryEnabled, filterAccountTypes: filterAccountTypes !== null && filterAccountTypes !== void 0 ? filterAccountTypes : [] }, (isIncludeDeleted === true && { isIncludeDeleted })),
58
55
  };
59
56
  },
60
57
  },
@@ -16,14 +16,9 @@ const getAccountTypes = (isLimitedCategoryEnabled, filterAccountTypes) => {
16
16
  return [];
17
17
  };
18
18
  const fetchAccountListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(accountListReducer_1.fetchAccountList.match), (0, operators_1.mergeMap)((action) => {
19
- const { accountListKey, fetchFullResponse, excludeAccountPayableAccounts, excludeAccountReceivableAccounts, isLimitedCategoryEnabled, filterAccountTypes, } = action.payload;
19
+ const { accountListKey, fetchFullResponse, excludeAccountPayableAccounts, excludeAccountReceivableAccounts, isLimitedCategoryEnabled, filterAccountTypes, isIncludeDeleted, } = action.payload;
20
20
  const accountTypes = getAccountTypes(isLimitedCategoryEnabled, filterAccountTypes);
21
- const queryValue = {
22
- is_bookkeeping_admin: fetchFullResponse,
23
- is_exclude_account_payable_accounts: excludeAccountPayableAccounts,
24
- is_exclude_account_receivable_accounts: excludeAccountReceivableAccounts,
25
- account_types: accountTypes,
26
- };
21
+ const queryValue = Object.assign({ is_bookkeeping_admin: fetchFullResponse, is_exclude_account_payable_accounts: excludeAccountPayableAccounts, is_exclude_account_receivable_accounts: excludeAccountReceivableAccounts, account_types: accountTypes }, (isIncludeDeleted === true && { is_include_deleted: true }));
27
22
  return zeniAPI
28
23
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accounts?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
29
24
  .pipe((0, operators_1.mergeMap)((response) => {
@@ -45,6 +45,6 @@ export type UpdateNetBurnSettingsResponse = ZeniAPIResponse<TenantsPayload>;
45
45
  /**
46
46
  * Helpers
47
47
  */
48
- export declare const toNetBurnOrIncomeCOABalanceWithAveragesGrouped: (payload: NetBurnOrIncomeCOABalanceWithAveragesPayload) => NetBurnOrIncomeCOABalanceWithAveragesGrouped;
48
+ export declare const toNetBurnOrIncomeCOABalanceWithAveragesGrouped: (payload: NetBurnOrIncomeCOABalanceWithAveragesPayload | null | undefined) => NetBurnOrIncomeCOABalanceWithAveragesGrouped;
49
49
  export declare const toNetBurnOrIncomeRunway: (payload: RunwayPayload) => NetBurnOrIncomeRunway;
50
50
  export {};
@@ -13,6 +13,15 @@ const netBurnOrIncomeStoryCardState_1 = require("./netBurnOrIncomeStoryCardState
13
13
  */
14
14
  const toNetBurnOrIncomeCOABalanceWithAveragesGrouped = (payload) => {
15
15
  var _a, _b, _c, _d, _e, _f;
16
+ // Guard clause: check if input object exists
17
+ if (payload == null) {
18
+ return {
19
+ months: [],
20
+ averages: {
21
+ months: [],
22
+ },
23
+ };
24
+ }
16
25
  return {
17
26
  months: (_b = (_a = payload.months) === null || _a === void 0 ? void 0 : _a.map((monthPayload) => (0, coaBalancePayload_1.mapCOABalancePayloadToCOABalance)(monthPayload, 'month'))) !== null && _b !== void 0 ? _b : [],
18
27
  averages: {
@@ -18,8 +18,8 @@ const fetchEditRemiDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
18
18
  const state = state$.value;
19
19
  const userId = (_b = (_a = state.tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
20
20
  if (cacheOverride) {
21
- remiDetailActions.push((0, accountListReducer_1.fetchAccountList)('reimbursementAccountList', true, true, true, isLimitedCategoryEnabled));
22
- remiDetailActions.push((0, classListReducer_1.fetchClassList)());
21
+ remiDetailActions.push((0, accountListReducer_1.fetchAccountList)('reimbursementAccountList', true, true, true, isLimitedCategoryEnabled, [], true));
22
+ remiDetailActions.push((0, classListReducer_1.fetchClassList)(true));
23
23
  remiDetailActions.push((0, merchantListReducer_1.fetchMerchantList)());
24
24
  remiDetailActions.push((0, reimbursementConfigReducer_1.fetchReimbursementConfig)());
25
25
  remiDetailActions.push((0, userFinancialAccountReducer_1.fetchUserFinancialAccount)(userId, reimbursementId));
@@ -29,14 +29,12 @@ const fetchEditRemiDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
29
29
  }
30
30
  else {
31
31
  const accountList = state.accountListState.byReportId.reimbursementAccountList;
32
- if (accountList.hasValidState() === false &&
33
- accountList.fetchState !== 'In-Progress') {
34
- remiDetailActions.push((0, accountListReducer_1.fetchAccountList)('reimbursementAccountList', true, true, true, isLimitedCategoryEnabled));
32
+ if (accountList.fetchState !== 'In-Progress') {
33
+ remiDetailActions.push((0, accountListReducer_1.fetchAccountList)('reimbursementAccountList', true, true, true, isLimitedCategoryEnabled, [], true));
35
34
  }
36
35
  const classList = state.classListState;
37
- if (classList.hasValidState() === false &&
38
- classList.fetchState !== 'In-Progress') {
39
- remiDetailActions.push((0, classListReducer_1.fetchClassList)());
36
+ if (classList.fetchState !== 'In-Progress') {
37
+ remiDetailActions.push((0, classListReducer_1.fetchClassList)(true));
40
38
  }
41
39
  const merchantList = state.merchantListState;
42
40
  if (merchantList.hasValidState() === false &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.7",
3
+ "version": "4.19.8-betaAR1",
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
  "types": "lib/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "@liveblocks/client": "^2.23.0",
31
31
  "@trivago/prettier-plugin-sort-imports": "^5.2.2",
32
32
  "@types/big.js": "^6.2.2",
33
- "@types/lodash": "^4.17.16",
33
+ "@types/lodash": "^4.17.23",
34
34
  "@types/node": "^20.19.0",
35
35
  "@types/url-parse": "^1.4.11",
36
36
  "@typescript-eslint/eslint-plugin": "^8.26.0",
@@ -62,7 +62,7 @@
62
62
  "dayjs": "^1.10.7",
63
63
  "dayjs-business-time": "^1.0.4",
64
64
  "js-base64": "^3.6.0",
65
- "lodash": "^4.17.21",
65
+ "lodash": "^4.17.23",
66
66
  "pusher-js": "^8.4.0",
67
67
  "redux": "^4.0.5",
68
68
  "redux-observable": "^1.2.0",