Depends on: Issue Thalos-Infrastructure/ThalosBackend#8
Task Description
lib/actions/agreements.ts still queries Supabase directly and is the dependency for disputes logic. Create a backend client and migrate consumers.
Deliverable
- New
lib/api/agreements.ts mapping to backend endpoints.
- Consumers updated to use it; Supabase queries removed.
Requirements
- Map functions to:
POST /agreements, GET /agreements, GET /agreements/:id, PATCH /agreements/:id/status, PATCH /agreements/:id/milestones, GET /agreements/:id/activity, GET /agreements/by-contract/:contractId.
- Preserve
updateAgreementStatus and logAgreementActivity signatures (used by lib/actions/disputes.ts).
Validation System
- Create/read/update agreements works end-to-end via backend.
- Grep shows no
supabase.from("agreements") / agreement_activity in the FE.
Technical Requirements
Additional Notes
Do this before Issue Thalos-Infrastructure/ThalosBackend#5 — disputes call updateAgreementStatus and logAgreementActivity.
Depends on: Issue Thalos-Infrastructure/ThalosBackend#8
Task Description
lib/actions/agreements.tsstill queries Supabase directly and is the dependency for disputes logic. Create a backend client and migrate consumers.Deliverable
lib/api/agreements.tsmapping to backend endpoints.Requirements
POST /agreements,GET /agreements,GET /agreements/:id,PATCH /agreements/:id/status,PATCH /agreements/:id/milestones,GET /agreements/:id/activity,GET /agreements/by-contract/:contractId.updateAgreementStatusandlogAgreementActivitysignatures (used bylib/actions/disputes.ts).Validation System
supabase.from("agreements")/agreement_activityin the FE.Technical Requirements
wallet_addressbased on the user's active wallet.Additional Notes
Do this before Issue Thalos-Infrastructure/ThalosBackend#5 — disputes call
updateAgreementStatusandlogAgreementActivity.