@zeniai/client-epic-state 5.0.81-betaAR1 → 5.0.81-betaAR3

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.
@@ -49,6 +49,13 @@ export interface ApprovalRulePayload {
49
49
  are_approvals_serialized?: boolean;
50
50
  description?: string | null;
51
51
  is_fallback?: boolean;
52
+ /**
53
+ * Approval Rules 3.0 — when `true`, the rule enforces separation of
54
+ * duties (a user can't approve their own request even if they are
55
+ * also an approver). The list-page rule card surfaces this as a
56
+ * green "Separation of duties" capsule.
57
+ */
58
+ is_separation_of_duty_enabled?: boolean;
52
59
  pending_approvals_count?: number;
53
60
  pending_entity_approval_update_status?: string;
54
61
  priority?: number;
@@ -20,8 +20,7 @@ const toApprovalRule = (payload) => ({
20
20
  description: payload.description ?? undefined,
21
21
  priority: payload.priority,
22
22
  isFallback: payload.is_fallback ?? false,
23
- // separationOfDuties: backend doesn't ship this field yet; left undefined
24
- // until the spec is finalized.
23
+ separationOfDuties: payload.is_separation_of_duty_enabled ?? false,
25
24
  areApprovalsSerialized: payload.are_approvals_serialized,
26
25
  pendingApprovalsCount: payload.pending_approvals_count,
27
26
  pendingEntityApprovalUpdateStatus: payload.pending_entity_approval_update_status,
@@ -56,6 +56,17 @@ export interface DepartmentCriteria {
56
56
  type: 'department';
57
57
  }
58
58
  export type Criteria = AmountCriteria | VendorCriteria | DepartmentCriteria;
59
+ /**
60
+ * Approval Rules 3.0 — canonical discriminator across the three
61
+ * condition variants. Derived from the `Criteria` union's `type`
62
+ * field so it can't drift from the underlying data model.
63
+ *
64
+ * Used by the unified `ConditionRow` UI component to switch which
65
+ * variant body to render, and by chip-rendering helpers on the list
66
+ * page to pick a label format. Consumers should import this type
67
+ * rather than redeclaring the three string literals locally.
68
+ */
69
+ export type ConditionType = Criteria['type'];
59
70
  export interface Step {
60
71
  actors: Actor[];
61
72
  operator: StepOperatorType;
@@ -17,8 +17,7 @@ export const toApprovalRule = (payload) => ({
17
17
  description: payload.description ?? undefined,
18
18
  priority: payload.priority,
19
19
  isFallback: payload.is_fallback ?? false,
20
- // separationOfDuties: backend doesn't ship this field yet; left undefined
21
- // until the spec is finalized.
20
+ separationOfDuties: payload.is_separation_of_duty_enabled ?? false,
22
21
  areApprovalsSerialized: payload.are_approvals_serialized,
23
22
  pendingApprovalsCount: payload.pending_approvals_count,
24
23
  pendingEntityApprovalUpdateStatus: payload.pending_entity_approval_update_status,
package/lib/index.d.ts CHANGED
@@ -52,7 +52,7 @@ import { AccountReconciliationEntity, getAccountReconByAccountIdAndSelectedPerio
52
52
  import { BalanceDataStatusCodeType, BankStatusCodeType, RecommendedActionCodeType, ReconciliationStatusCodeType, StatementDataStatusCodeType, StatementStatusCodeType, TransactionsToReview } from './entity/accountRecon/accountReconState';
53
53
  import { getAddressByAddressId } from './entity/address/addressSelector';
54
54
  import { Address } from './entity/address/addressState';
55
- import { Actor, ActorType, AmountComparator, AmountCriteria, ApprovalActionType, ApprovalRule, ApprovalRuleState, Approvers, AttributeType, Criteria, DepartmentCriteria, RoleType, Step, StepOperatorType, VendorCriteria, toAttributeOrRoleTypeStrict, toAttributeTypeStrict, toRoleTypeStrict } from './entity/approvalRule/approvalRuleState';
55
+ import { Actor, ActorType, AmountComparator, AmountCriteria, ApprovalActionType, ApprovalRule, ApprovalRuleState, Approvers, AttributeType, ConditionType, Criteria, DepartmentCriteria, RoleType, Step, StepOperatorType, VendorCriteria, toAttributeOrRoleTypeStrict, toAttributeTypeStrict, toRoleTypeStrict } from './entity/approvalRule/approvalRuleState';
56
56
  import { getAmountCriteria, getApprovalRulesByEntityType, getDepartmentCriteria, getFallbackApprovalRule, getVendorCriteria } from './entity/approvalRule/approvalRuleSelector';
57
57
  import { BankAccount } from './entity/bankAccount/bankAccount';
58
58
  import { BillPayInfo, BillPaymentRefundStatus, BillPaymentRefundStatusCodeType, BillPaymentStatus, BillPaymentStatusCodeType, BillStage, BillStageCodeType, BillStatus, BillStatusCodeType, BillTransaction, DeletionSourceType, InternationalTransferFeeBearerPaymentMethod, toOutsideZeniPaymentModeType } from './entity/billPay/billTransaction/billTransactionState';
@@ -809,7 +809,7 @@ export { RemiSetupViewState, RemiSetupViewLocalData, MileageDetailsLocalData, Mi
809
809
  export { PaymentAccount, Logo, VERIFIED_PAYMENT_ACCOUNT_PROVIDER_VERIFICATION_STATUS, };
810
810
  export { SubscriptionPaymentAccount };
811
811
  export { PreviousBillsSelectorView, InvoiceProcessingPayload, InvoiceProcessingResponse, isSuccessResponse, isInvalidSessionError, isAccessDeniedError, };
812
- export { Step, Actor as ApprovalRuleActor, ActorType, ApprovalActionType, StepOperatorType, ApprovalRuleState, ApprovalRule, AmountComparator, AmountCriteria, Criteria, DepartmentCriteria, VendorCriteria, AttributeType, Approvers, RoleType, EntityApprovalStatusState, EntityApprovalStatus, SpendManagementEntityType, SpendManagementEntityTypeWithOtherConnection, getAmountCriteria, getApprovalRulesByEntityType, getDepartmentCriteria, getFallbackApprovalRule, getVendorCriteria, toAttributeTypeStrict, toAttributeOrRoleTypeStrict, toRoleTypeStrict, };
812
+ export { Step, Actor as ApprovalRuleActor, ActorType, ApprovalActionType, StepOperatorType, ApprovalRuleState, ApprovalRule, AmountComparator, AmountCriteria, ConditionType, Criteria, DepartmentCriteria, VendorCriteria, AttributeType, Approvers, RoleType, EntityApprovalStatusState, EntityApprovalStatus, SpendManagementEntityType, SpendManagementEntityTypeWithOtherConnection, getAmountCriteria, getApprovalRulesByEntityType, getDepartmentCriteria, getFallbackApprovalRule, getVendorCriteria, toAttributeTypeStrict, toAttributeOrRoleTypeStrict, toRoleTypeStrict, };
813
813
  export { ApprovalRuleUpdateData, ApprovalRuleCreateData, BillPayApprovalRuleWithUser, ApprovalUpdateActionType, ApproverViewUpdateData, BillPaySetupApproverViewState, BillPaySetupApproverView, BillPaySetupApproverUpdateDataView, getBillPaySetupApproverView, getBillPaySetupApproverUpdateDataView, fetchBillPaySetupApproverView, fetchBillPayApproversDetails, fetchBillPayApproversList, deleteBillPayApprovalRule, saveBillPaySetupApproverViewUpdateData, saveBillPaySetupApproverViewUpdates, setBillsSetupApproverViewListeningToPusherEvent, initializeBillPaySetupApproverViewUpdateData, clearBillPaySetupApproverViewUpdateData, clearBillPaySetupApproverView, };
814
814
  export { RemiApprovalRuleWithUser, RemiSetupApproverViewState, RemiSetupApproverView, RemiSetupApproverUpdateDataView, getRemiSetupApproverView, getRemiSetupApproverUpdateDataView, fetchRemiSetupApproverView, fetchRemiApproversList, fetchRemiApproversDetails, deleteRemiApprovalRule, saveRemiSetupApproverViewUpdateData, saveRemiSetupApproverViewUpdates, initializeRemiSetupApproverViewUpdateData, setRemiSetupApproverViewListeningToPusherEvent, clearRemiSetupApproverViewUpdateData, clearRemiSetupApproverView, };
815
815
  export { RemiDetailViewSelector, getRemiDetailView, RemiActivity, RemiDetails, checkApproveRejectBtnShowForRemi, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.0.81-betaAR1",
3
+ "version": "5.0.81-betaAR3",
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",