@zeniai/client-epic-state 5.0.69-betaAR4 → 5.0.69-betaAS1

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 (30) hide show
  1. package/lib/entity/approvalRule/approvalRulePayload.d.ts +5 -27
  2. package/lib/entity/approvalRule/approvalRulePayload.js +10 -131
  3. package/lib/entity/approvalRule/approvalRuleSelector.d.ts +1 -25
  4. package/lib/entity/approvalRule/approvalRuleSelector.js +0 -40
  5. package/lib/entity/approvalRule/approvalRuleState.d.ts +7 -48
  6. package/lib/esm/entity/approvalRule/approvalRulePayload.js +10 -131
  7. package/lib/esm/entity/approvalRule/approvalRuleSelector.js +0 -35
  8. package/lib/esm/index.js +1 -2
  9. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +7 -11
  10. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +16 -61
  11. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -7
  12. package/lib/esm/view/spendManagement/commonHistoryView/commonHistoryPayload.js +1 -0
  13. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +7 -11
  14. package/lib/index.d.ts +2 -3
  15. package/lib/index.js +16 -22
  16. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  17. package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
  18. package/lib/view/people/peopleTypes.d.ts +1 -1
  19. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +6 -10
  20. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +1 -9
  21. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +16 -61
  22. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +5 -31
  23. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -7
  24. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  25. package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +1 -0
  26. package/lib/view/spendManagement/commonHistoryView/commonHistoryPayload.d.ts +1 -0
  27. package/lib/view/spendManagement/commonHistoryView/commonHistoryPayload.js +1 -0
  28. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +6 -10
  29. package/lib/view/taskManager/taskListView/taskList.d.ts +3 -3
  30. package/package.json +1 -1
@@ -9,7 +9,6 @@ exports.getPaymentSection = getPaymentSection;
9
9
  exports.toPaymentToOption = toPaymentToOption;
10
10
  const get_1 = __importDefault(require("lodash/get"));
11
11
  const has_1 = __importDefault(require("lodash/has"));
12
- const approvalRuleSelector_1 = require("../../../../entity/approvalRule/approvalRuleSelector");
13
12
  const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
14
13
  const bankAccountSelector_1 = require("../../../../entity/bankAccount/bankAccountSelector");
15
14
  const contactSelector_1 = require("../../../../entity/billPay/contact/contactSelector");
@@ -699,13 +698,9 @@ exports.getDefaultWithdrawFromAccount = getDefaultWithdrawFromAccount;
699
698
  const checkIfCreatorIsApprover = (billAmount, approvalRules, signedInUser) => {
700
699
  let isCreatorAlsoApprover = false;
701
700
  const approvalRule = approvalRules.find((rule) => {
702
- const amountCriteria = (0, approvalRuleSelector_1.getAmountCriteria)(rule.criteria);
703
- if (amountCriteria?.min == null) {
704
- return false;
705
- }
706
- const { min, max } = amountCriteria;
701
+ const { max, min } = rule.criteria[0].range;
707
702
  return (billAmount > min.amount &&
708
- (max?.amount != null ? billAmount <= max.amount : true));
703
+ (max?.amount != null ? billAmount <= max?.amount : true));
709
704
  });
710
705
  if (approvalRule != null) {
711
706
  const requireApprovalSteps = approvalRule.steps.filter((step) => step.action === 'require_approval');
@@ -61,7 +61,7 @@ export declare const initialCreditAcc: CreditAccount;
61
61
  export declare const initialDebitCardSummaries: DebitCardSummaries;
62
62
  export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
63
63
  export declare const initialCreditAccountRepayment: CreditAccountRepayment;
64
- export declare const toChargeCardSortKeyType: (v: string) => "status" | "department" | "accountType" | "owner" | "cardName" | "limit" | "cardType" | "utilisation";
64
+ export declare const toChargeCardSortKeyType: (v: string) => "status" | "accountType" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
65
65
  export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
66
66
  export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
67
67
  export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
@@ -11,6 +11,7 @@ export interface HistoricEvent {
11
11
  eventSubText: string[];
12
12
  eventText: string[];
13
13
  updates: HistoricEventUpdate[];
14
+ paymentTraceId?: string | null;
14
15
  timestamp?: ZeniDate;
15
16
  }
16
17
  export interface HistoricEventUpdate {
@@ -20,6 +20,7 @@ interface HistoricEventMetaDataPayload {
20
20
  activity_title: string;
21
21
  actor_id: string;
22
22
  actor_name: string;
23
+ payment_trace_id?: string | null;
23
24
  }
24
25
  export declare const toHistoricEvent: (payload: HistoricEventPayload) => HistoricEvent;
25
26
  export type FetchEntityHistoryResponse = ZeniAPIResponse<HistoryPayload>;
@@ -8,6 +8,7 @@ const toHistoricEvent = (payload) => ({
8
8
  eventSubText: payload.event_sub_text ?? [],
9
9
  timestamp: payload.timestamp != null ? (0, zeniDayJS_1.dateLocal)(payload.timestamp) : undefined,
10
10
  updates: payload.updates.map((eventUpdatePayload) => toHistoricEventUpdate(eventUpdatePayload)),
11
+ paymentTraceId: payload.metadata.payment_trace_id ?? null,
11
12
  });
12
13
  exports.toHistoricEvent = toHistoricEvent;
13
14
  const toHistoricEventUpdate = (payload) => ({
@@ -11,20 +11,16 @@ const initializeRemiSetupApproverViewUpdateDataEpic = (actions$, state$) => acti
11
11
  if (approvalRuleId != null) {
12
12
  const approvalRule = (0, approvalRuleSelector_1.getApprovalRuleById)(state$.value.approvalRuleState, approvalRuleId);
13
13
  if (approvalRule != null) {
14
+ const criteria = approvalRule.criteria[0];
15
+ const range = criteria?.range;
14
16
  const remiSetupApproverViewUpdateData = {
15
17
  approvalRuleId,
16
18
  steps: approvalRule.steps,
17
19
  criteria: {
18
- amount: (0, approvalRuleSelector_1.getAmountCriteria)(approvalRule.criteria),
19
- vendor: (0, approvalRuleSelector_1.getVendorCriteria)(approvalRule.criteria),
20
- department: (0, approvalRuleSelector_1.getDepartmentCriteria)(approvalRule.criteria),
20
+ rangeType: criteria?.rangeType,
21
+ rangeEntity: criteria?.rangeEntity,
22
+ range,
21
23
  },
22
- // Approval Rules 3.0 — seed rule-level fields so the form can
23
- // round-trip them on edit. Each may be undefined on legacy rules.
24
- name: approvalRule.name,
25
- description: approvalRule.description,
26
- separationOfDuties: approvalRule.separationOfDuties,
27
- isFallback: approvalRule.isFallback,
28
24
  };
29
25
  fetchActions.push((0, remiSetupApproverViewReducer_1.clearRemiSetupApproverViewUpdateData)(), (0, remiSetupApproverViewReducer_1.saveRemiSetupApproverViewUpdateData)(remiSetupApproverViewUpdateData));
30
26
  }
@@ -32,7 +28,7 @@ const initializeRemiSetupApproverViewUpdateDataEpic = (actions$, state$) => acti
32
28
  else {
33
29
  const remiSetupApproverViewCreateData = {
34
30
  steps: [],
35
- criteria: {},
31
+ criteria: undefined,
36
32
  };
37
33
  fetchActions.push((0, remiSetupApproverViewReducer_1.clearRemiSetupApproverViewUpdateData)(), (0, remiSetupApproverViewReducer_1.saveRemiSetupApproverViewUpdateData)(remiSetupApproverViewCreateData));
38
34
  }
@@ -50,15 +50,15 @@ export interface TaskFilterCategory {
50
50
  }
51
51
  export type TaskListFilterCategoryField = 'status' | 'dueDate' | 'assignee' | 'creationDate' | 'priority' | 'tag';
52
52
  export declare const TASK_LIST_GROUP_BY_KEYS: readonly ["groupName", "status", "dueDate", "assignee", "priority", "tag"];
53
- export declare const toTaskListGroupByKeyType: (v: string) => "status" | "priority" | "dueDate" | "groupName" | "tag" | "assignee";
54
- export declare const toTaskListGroupByKeyTypeStrict: (v: string) => "status" | "priority" | "dueDate" | "groupName" | "tag" | "assignee" | undefined;
53
+ export declare const toTaskListGroupByKeyType: (v: string) => "status" | "dueDate" | "groupName" | "tag" | "priority" | "assignee";
54
+ export declare const toTaskListGroupByKeyTypeStrict: (v: string) => "status" | "dueDate" | "groupName" | "tag" | "priority" | "assignee" | undefined;
55
55
  export declare type TaskGroupKey = ReturnType<typeof toTaskListGroupByKeyType>;
56
56
  export interface TaskListUIState extends SpendManagementUIState {
57
57
  groupByKey: TaskGroupKey;
58
58
  searchText: string;
59
59
  sortKey: TaskListViewSortKey;
60
60
  }
61
- declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "priority" | "dueDate" | "tag" | "timeSpent" | "assignee" | "creationDate" | "visibility";
61
+ declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "dueDate" | "tag" | "priority" | "timeSpent" | "assignee" | "creationDate" | "visibility";
62
62
  export declare type TaskListViewSortKey = ReturnType<typeof toTaskListSortKeyType>;
63
63
  export declare const TASK_LIST_FILTER_CATEGORIES: TaskListFilterCategoryOption[];
64
64
  interface TaskListFilterCategoryOption {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.0.69-betaAR4",
3
+ "version": "5.0.69-betaAS1",
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",