import { ApprovalRule } from './approvalRuleState'; /** * Condition Payload — one entry inside criteria.conditions[]. * * field examples: 'amount' | 'vendor_id' | 'accounting_class_id' * type examples: 'gte' | 'lte' | 'eq' | 'in' | 'not_in' * value: number for amount comparisons; string[] for in / not_in lookups. */ export interface ConditionPayload { field: string; type: string; value: number | string[]; } /** * Criteria Payload — list of conditions joined by `criteria_operator`. * * `currency_code` / `currency_symbol` apply to amount conditions inside * `conditions[]`. Kept here pending confirmation that they should remain. */ export interface CriteriaPayload { conditions: ConditionPayload[]; criteria_operator: string; currency_code: string; currency_symbol: string; } export interface ActorPayload { type: string; id?: string | null; id_type?: string | null; is_implicit_actor?: boolean; sub_type?: string | null; } export interface StepPayload { action: string; actors: ActorPayload[]; operator: string; } /** * Approval Rule Payload */ export interface ApprovalRulePayload { approval_rule_id: string; create_time: string; criteria: CriteriaPayload; entity_type: string; name: string | null; steps: StepPayload[]; update_time: string; are_approvals_serialized?: boolean; description?: string | null; is_fallback?: boolean; /** * Approval Rules 3.0 — when `true`, the rule enforces separation of * duties (a user can't approve their own request even if they are * also an approver). The list-page rule card surfaces this as a * green "Separation of duties" capsule. */ is_separation_of_duty_enabled?: boolean; pending_approvals_count?: number; pending_entity_approval_update_status?: string; priority?: number; version?: number | string; } /** * Helpers */ export declare const toApprovalRule: (payload: ApprovalRulePayload) => ApprovalRule;