import { ID } from '../../commonStateTypes/common'; import { EntityType } from '../entityApprovalStatus/entityApprovalStatusState'; import { AmountCriteria, ApprovalRule, ApprovalRuleState, Criteria, DepartmentCriteria, VendorCriteria } from './approvalRuleState'; export declare function getApprovalRuleById(approvalRuleState: ApprovalRuleState, approvalRuleId: ID): ApprovalRule | undefined; export declare function getApprovalRulesByIds(approvalRuleState: ApprovalRuleState, approvalRuleIds: ID[]): ApprovalRule[]; /** * Returns the amount-range portion of a rule's criteria, if any. * * Use this whenever a caller needs to read amount min/max from the new * discriminated `Criteria` union without inlining a type guard. */ export declare function getAmountCriteria(criteria: Criteria[]): AmountCriteria | undefined; export declare function getVendorCriteria(criteria: Criteria[]): VendorCriteria | undefined; export declare function getDepartmentCriteria(criteria: Criteria[]): DepartmentCriteria | undefined; /** * Returns all rules of the given entityType, sorted by `priority` ascending. * * Rules without a `priority` value sort to the end (treated as Infinity). * Use this for the list page where rules render in evaluation order. */ export declare function getApprovalRulesByEntityType(approvalRuleState: ApprovalRuleState, entityType: EntityType): ApprovalRule[]; /** * Returns the tenant's fallback rule for the given entityType, if one exists. * * The fallback rule is shown by the "fallback engine active" banner on the * list page and is used to handle bills/reimbursements that match no other rule. */ export declare function getFallbackApprovalRule(approvalRuleState: ApprovalRuleState, entityType: EntityType): ApprovalRule | undefined;