ObservingQuota
ObservingQuota Schema¶
Description: Period-based credit quota attached to either an ObservingAccount or an ObservingGrant.
Exactly one of ``account_id`` / ``grant_id`` must be set (enforced by CHECK).
Window logic and credits-used aggregation are driven by which FK is populated:
if ``account_id`` is set, transactions are summed by ``account_id``; otherwise
by ``grant_id``.
**Enforcement point**: quotas bind in the scheduler — funding chains
with an exhausted enabled quota window are excluded from queue
assignment (``cp_sat_task_scheduler``'s candidate selection), so the
affected tasks stay unscheduled until the window rolls over. Submit
and publish do not reject on quota (the window may roll before the
task runs); UI surfaces remaining credits as guidance.
Properties¶
| Name | Type | Description |
|---|---|---|
| id | Integer |
No description |
| account_id | Integer (Optional) |
No description |
| grant_id | Integer (Optional) |
No description |
| period_type | Enum(lifetime, day, week, month, night) |
No description |
| max_credits | Float |
No description |
| timezone | String(64) |
No description |
| anchor_at | DateTime (Optional) |
No description |
| starts_at_local_time | TIME (Optional) |
No description |
| enabled | Boolean |
No description |
| created_on | DateTime |
No description |
| updated_on | DateTime |
No description |
Relationships¶
| Relationship Name | Type |
|---|---|
| account | ObservingAccount |
| grant | ObservingGrant |