@zeniai/client-epic-state 4.14.77 → 4.14.78

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 (47) hide show
  1. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  2. package/lib/entity/userRole/userRolePayload.d.ts +1 -0
  3. package/lib/entity/userRole/userRolePayload.js +3 -0
  4. package/lib/entity/userRole/userRoleType.d.ts +2 -2
  5. package/lib/entity/userRole/userRoleType.js +6 -7
  6. package/lib/epic.d.ts +5 -1
  7. package/lib/epic.js +5 -1
  8. package/lib/index.d.ts +14 -13
  9. package/lib/index.js +32 -29
  10. package/lib/view/accountMappingView/accountMappingTypeHelper.d.ts +17 -0
  11. package/lib/view/accountMappingView/accountMappingTypeHelper.js +2 -0
  12. package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +1 -0
  13. package/lib/view/commonVendorView/transactionVendorView/epics/saveTransactionVendorEpic.d.ts +2 -1
  14. package/lib/view/commonVendorView/transactionVendorView/epics/saveTransactionVendorEpic.js +43 -15
  15. package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/fetchAccountSettingsListForAccountTypesEpic.d.ts +8 -0
  16. package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/fetchAccountSettingsListForAccountTypesEpic.js +41 -0
  17. package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/fetchRecommendationForAccountSettingsEpic.d.ts +7 -0
  18. package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/fetchRecommendationForAccountSettingsEpic.js +27 -0
  19. package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/initializeAccountSettingsViewEpic.d.ts +4 -0
  20. package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/initializeAccountSettingsViewEpic.js +13 -0
  21. package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/saveAccountSettingsViewEpic.d.ts +8 -0
  22. package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/saveAccountSettingsViewEpic.js +50 -0
  23. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -2
  24. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +1 -0
  25. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.d.ts +2 -1
  26. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +6 -0
  27. package/lib/view/expenseAutomationView/helpers/jeAccountSettingHelper.d.ts +3 -0
  28. package/lib/view/expenseAutomationView/helpers/jeAccountSettingHelper.js +50 -0
  29. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +19 -6
  30. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +153 -2
  31. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +5 -1
  32. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +10 -2
  33. package/lib/view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes.d.ts +19 -0
  34. package/lib/view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes.js +2 -0
  35. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  36. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +2 -0
  37. package/lib/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.d.ts +3 -0
  38. package/lib/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +41 -0
  39. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -0
  40. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +3 -1
  41. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +27 -0
  42. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -0
  43. package/lib/view/people/helpers/updateManagersListOnRoleChange.js +3 -2
  44. package/lib/view/people/peoplePayload.d.ts +1 -0
  45. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -1
  46. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +6 -3
  47. package/package.json +2 -2
@@ -16,7 +16,7 @@ function getExpenseAutomationTransactionView(state) {
16
16
  var _a;
17
17
  const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
18
18
  const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
19
- const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
19
+ const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
20
20
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
21
21
  const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
22
22
  const classList = (0, classListSelector_1.getClassList)(classState, classListState);
@@ -104,5 +104,7 @@ function getExpenseAutomationTransactionView(state) {
104
104
  completionStatus,
105
105
  totalCountByTab,
106
106
  fetchStateByTransactionTabs: fetchStateByTab,
107
+ selectedTransactionId,
108
+ selectedTransactionLineId,
107
109
  };
108
110
  }
@@ -1,5 +1,8 @@
1
+ import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
1
2
  import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
3
+ import { Recommendation } from '../../../commonStateTypes/recommendationBase';
2
4
  import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
5
+ import { AccountBase } from '../../../entity/account/accountState';
3
6
  import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
4
7
  import { VendorBase } from '../../../entity/vendor/vendorState';
5
8
  export interface JESchedulesViewUIState {
@@ -24,8 +27,32 @@ export interface JESchedulesViewState extends FetchedState {
24
27
  jeScheduleTransactionKeysByPeriod: Record<MonthYearPeriodId, JEScheduleTransactionKey[]>;
25
28
  failedJeScheduleTransactionKeysByPeriod: Record<MonthYearPeriodId, JEScheduleTransactionKey[]>;
26
29
  jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
30
+ accountSettings: AccountSettingsState;
27
31
  postStatusById: Record<ID, FetchStateAndError>;
28
32
  ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
29
33
  refreshStatus: FetchStateAndError;
30
34
  uiState: JESchedulesViewUIState;
31
35
  }
36
+ export interface AccountSettingsLocalData {
37
+ selectedFixedAssetsAccountIds: ID[];
38
+ selectedPrepaidExpensesAccountIds: ID[];
39
+ selectedAccruedExpensesAccountIds: ID[];
40
+ previousPrepaidExpensesAccount: AccountBase[];
41
+ previousFixedAssetsAccount: AccountBase[];
42
+ previousAccruedExpensesAccount: AccountBase[];
43
+ }
44
+ export interface AccountSettingsState {
45
+ localData: AccountSettingsLocalData;
46
+ accountListFetchState: FetchStateAndError;
47
+ recommendationFetchState: FetchStateAndError;
48
+ updateFetchState: FetchStateAndError;
49
+ prepaidExpensesAccountIdList: ID[];
50
+ prepaidExpensesNestedAccountListHierarchy: NestedAccountHierarchyForReport[];
51
+ prepaidExpensesRecommendations: Recommendation[];
52
+ fixedAssetsAccountIdList: ID[];
53
+ fixedAssetsNestedAccountListHierarchy: NestedAccountHierarchyForReport[];
54
+ fixedAssetsRecommendations: Recommendation[];
55
+ accruedExpensesAccountIdList: ID[];
56
+ accruedExpensesNestedAccountListHierarchy: NestedAccountHierarchyForReport[];
57
+ accruedExpensesRecommendations: Recommendation[];
58
+ }
@@ -84,6 +84,8 @@ export interface TransactionsTabViewState extends FetchedState {
84
84
  markAsNotMiscategorizedStatus: FetchStateAndError;
85
85
  refreshStatus: FetchStateAndError;
86
86
  uiState: TransactionsViewUIState;
87
+ selectedTransactionId?: ID;
88
+ selectedTransactionLineId?: ID;
87
89
  }
88
90
  export type TransactionsViewState = {
89
91
  selectedTransactionCategorizationTab: TransactionsTab;
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateManagersListOnRoleChange = void 0;
4
4
  const userListViewReducer_1 = require("../../userListView/userListViewReducer");
5
5
  const updateManagersListOnRoleChange = (actions, userRoles, isZeniTenant) => {
6
- const { is_admin, is_bookkeeping_admin, is_bookkeeping_user, user_id, is_invite_accepted, is_reimbursements_user, is_zeni, } = userRoles;
6
+ const { is_admin, is_bookkeeping_admin, is_bookkeeping_user, user_id, is_invite_accepted, is_reimbursements_user, is_zeni, is_zeni_support_user, } = userRoles;
7
7
  if (is_invite_accepted && (!is_zeni || Boolean(isZeniTenant))) {
8
- if (is_admin ||
8
+ if (is_zeni_support_user ||
9
+ is_admin ||
9
10
  is_bookkeeping_admin ||
10
11
  is_bookkeeping_user ||
11
12
  is_reimbursements_user) {
@@ -7,6 +7,7 @@ export interface PeoplePayload {
7
7
  }
8
8
  export interface PeopleUpdatePayload {
9
9
  is_admin: boolean;
10
+ is_zeni_support_user: boolean;
10
11
  is_bookkeeping_admin: boolean;
11
12
  is_banker: boolean;
12
13
  is_investor_or_banker: boolean;
@@ -46,4 +46,4 @@ export interface ReimbursementView extends Reimbursement {
46
46
  export declare const getRemiList: (state: RootState, currentTimePeriod: TimePeriod, isBulkActionFeatureEnabled: boolean) => RemiListReport;
47
47
  export declare const getApproversOrRejectors: (reimbursement: Reimbursement, entityApprovalStatusState: EntityApprovalStatusState, userState: UserState) => Approvers;
48
48
  export declare const getRemiListOnSort: (sortKey: ReimbursementViewSortKey, sortOrder: SortOrder, currentTab: RemiTabType, reimbursements: ReimbursementView[]) => ReimbursementView[];
49
- export declare const getAllowedBulkActions: (selectedTab: RemiTabType, selectedSubTab: RemiSubTabType, isAllAwaitingMyApproval: boolean, isFirstBillProcessing: boolean) => BulkOperationType[];
49
+ export declare const getAllowedBulkActions: (selectedTab: RemiTabType, selectedSubTab: RemiSubTabType, isAllAwaitingMyApproval: boolean, isFirstBillProcessing: boolean, hasReimbursementFromOthers: boolean) => BulkOperationType[];
@@ -112,9 +112,10 @@ const getRemiList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
112
112
  });
113
113
  const allBulkRemisAwaitingMyApproval = (0, difference_1.default)(remisSelectedForBulkAction, pendingApprovalTransactionIDs)
114
114
  .length === 0;
115
+ const hasReimbursementFromOthers = reimbursementsDetailed.some((remi) => remi.createdBy !== loggedInUserId);
115
116
  const allowedBulkActions = isBulkActionAllowed
116
117
  ? (0, exports.getAllowedBulkActions)(remiListState.currentTab, remiListState.currentSubTab, allBulkRemisAwaitingMyApproval, (firstRemiInBulkList === null || firstRemiInBulkList === void 0 ? void 0 : firstRemiInBulkList.reimbursementInfo.billPaymentStatus.code) ===
117
- 'processing')
118
+ 'processing', hasReimbursementFromOthers)
118
119
  : [];
119
120
  remiListBulkActionInfo = {
120
121
  isBulkActionAllowed,
@@ -510,10 +511,12 @@ const isRemiSelectableForBulkAction = (reimbursement, selectedTab, firstSelectab
510
511
  }
511
512
  return result;
512
513
  };
513
- const getAllowedBulkActions = (selectedTab, selectedSubTab, isAllAwaitingMyApproval, isFirstBillProcessing) => {
514
+ const getAllowedBulkActions = (selectedTab, selectedSubTab, isAllAwaitingMyApproval, isFirstBillProcessing, hasReimbursementFromOthers) => {
514
515
  switch (selectedTab) {
515
516
  case 'draft':
516
- return ['send_for_approval', 'delete'];
517
+ return hasReimbursementFromOthers
518
+ ? ['delete']
519
+ : ['send_for_approval', 'delete'];
517
520
  case 'pending_approval': {
518
521
  switch (selectedSubTab) {
519
522
  case 'all':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.14.77",
3
+ "version": "4.14.78",
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",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "homepage": "https://github.com/zeni-ai/client-epic-state#readme",
27
27
  "devDependencies": {
28
- "@liveblocks/client": "^2.20.0",
28
+ "@liveblocks/client": "^2.22.1",
29
29
  "@trivago/prettier-plugin-sort-imports": "^5.2.2",
30
30
  "@types/chai": "^5.0.1",
31
31
  "@types/jest": "^29.5.14",