Bidder pay and the work ledger¶
What it does¶
Bidders are paid for the work they record. Pay is calculated weekly from a work ledger, which records each relevant event at the moment it happens.
Why a ledger¶
Jobs are deleted under the data retention rule. If pay were calculated from the jobs themselves, deleting an old job would change what was paid. The ledger keeps the record of the work independently, so pay stays correct.
How pay is worked out¶
- Events are recorded when work happens: an assignment, a status change, a confirmed request.
- Daily totals are built per bidder from those events.
- Rates apply per day. A rate change only affects the days after it takes effect.
- Weeks run Monday to Sunday (UTC). Each week's total is shown to managers, who record payments.
- Bidders see their own recent weeks in the extension.
Who sees what¶
- Bidders see their own summary.
- Managers see each bidder's weeks, the pay history, and can set rates and record payments.
- Superadmins see the wider reports.
For engineers
Routes: GET /payments/my-summary, GET /payments/weekly-summary, GET /payments/{bidder_id}, PUT /payments/record, POST /payments/pay, GET /manager/work, GET /manager/pay-history, PUT /manager/bidders/{id}/rate.
Backend: app/work_ledger.py, app/routers_payments.py, app/routers_manager.py.
Rule: every assignment or status path must call the matching record_* helper, or pay will be wrong.
Full list: feature map.