SpendPolicy¶
Configuration dataclass for spend governance rules.
paygraph.policy.SpendPolicy
dataclass
¶
Configuration for spend governance rules.
Attributes:
| Name | Type | Description |
|---|---|---|
max_transaction |
float
|
Maximum dollar amount allowed per transaction. |
daily_budget |
float
|
Maximum total dollar amount allowed per calendar day. |
allowed_vendors |
list[str] | None
|
If set, only vendors matching these names are permitted (case-insensitive substring match). |
blocked_vendors |
list[str] | None
|
If set, vendors matching these names are always blocked (case-insensitive substring match). |
allowed_mccs |
list[int] | None
|
Merchant Category Code allowlist (reserved for future use). |
require_justification |
bool
|
Whether a justification string is required for every spend request. |
Source code in src/paygraph/policy.py
paygraph.policy.PolicyResult
dataclass
¶
Result of a policy evaluation.
Attributes:
| Name | Type | Description |
|---|---|---|
approved |
bool
|
Whether the spend request passed all policy checks. |
denial_reason |
str | None
|
Human-readable reason if the request was denied. |
checks_passed |
list[str]
|
Names of policy checks that passed before denial (or all checks if approved). |