A cycle is a single contribution round in your savings group. During a cycle every active member is expected to pay a fixedDocumentation Index
Fetch the complete documentation index at: https://docs.digiflecttech.dev/llms.txt
Use this file to discover all available pages before exploring further.
contribution_amount by a set contribution_due_date, and each member receives a payout exactly once — in an order determined by their credit score. Only one cycle can be active at a time. When all payouts have been disbursed the admin ends the cycle, credit scores are updated, and the group is ready to start the next round.
Cycle Lifecycle
status field on a cycle object will be one of:
| Status | Meaning |
|---|---|
ACTIVE | The cycle is running; contributions are being collected and payouts are being processed |
COMPLETED | The cycle has ended; all members received their payouts |
CANCELLED | The cycle was cancelled before completion (rare administrative action) |
Key Cycle Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique cycle identifier |
cycle_number | integer | Auto-incrementing sequence number (1, 2, 3…) |
contribution_amount | float | Fixed amount every member must pay this cycle |
contribution_due_date | datetime | Deadline for all member contributions |
start_date | datetime | When the cycle officially began |
end_date | datetime | null | When the cycle was closed; null while active |
status | string | ACTIVE or COMPLETED |
API Endpoints
Start a new cycle
POST /api/cycles/start — Admin only
Creates a new cycle and immediately generates the payout queue based on current credit scores. If contribution_amount is omitted, the value from system configuration (SystemConfig.contribution_amount) is used.
Get the current active cycle
GET /api/cycles/current — Any authenticated user
Returns the single active cycle, or 404 if none exists.
Get cycle statistics
GET /api/cycles/{cycle_id}/statistics — Any authenticated user
Returns a real-time snapshot of how the cycle is progressing.
Get the payout queue
GET /api/cycles/{cycle_id}/queue — Any authenticated user
Returns the full ordered list of members and their payout status for the cycle. The queue is generated once at cycle creation using each member’s credit score at that moment (credit_score_at_generation).
End a cycle
POST /api/cycles/{cycle_id}/end — Admin only
Closes the cycle and records a cycles_completed event on every member’s credit score. The endpoint returns 400 if any queue member has not yet received their payout.
Check contribution completion
GET /api/cycles/{cycle_id}/contributions-complete — Any authenticated user
A lightweight check that returns true when every active member has paid the full contribution_amount.
The Payout Queue
When a cycle starts, Save App callsget_member_rankings to retrieve all active members sorted by credit score (highest first). It creates a PayoutQueue row for each member, locking in their credit_score_at_generation and position. That order does not change during the cycle — it is a snapshot taken at the moment the cycle was created.
A member must have their contribution paid in full before the group can process any payout in that cycle. The
can_process_payout check enforces this: if all_contributions_received is false, no payout will be approved.position order. Each admin must approve a payout before it is executed. Once executed, has_received_payout is set to true for that queue entry and actual_payout_date is recorded.
Frequently Asked Questions
What if I miss the contribution due date?
What if I miss the contribution due date?
Your contribution is still accepted after the due date, but it is recorded as a late payment, which reduces your credit score. A late payment carries a
-10 point penalty by default. Missed payments (never paid) carry a -20 penalty. Your position in the queue for the current cycle is already fixed, but your score will affect your queue position in the next cycle.Can the payout queue order change mid-cycle?
Can the payout queue order change mid-cycle?
No. The queue is a snapshot generated at cycle creation. Subsequent changes to credit scores during the cycle do not affect the current queue. The updated scores will influence the queue generated when the next cycle starts.
What happens if a member joins after a cycle has started?
What happens if a member joins after a cycle has started?
New members added while a cycle is already
ACTIVE are not automatically added to the existing queue. They will appear in the queue for the next cycle that starts after their account becomes active.Can a cycle be started with a custom contribution amount?
Can a cycle be started with a custom contribution amount?
Yes. If you supply
contribution_amount in the POST /api/cycles/start body it overrides the system-wide default for that cycle only. If you omit it, the system configuration value (SystemConfig.contribution_amount, default 50,000) is used.What does 'is_complete' mean in statistics?
What does 'is_complete' mean in statistics?
is_complete: true means every member in the payout queue for that cycle has has_received_payout: true. It is a prerequisite for calling POST /api/cycles/{cycle_id}/end — the end endpoint will reject the request if is_complete is still false.