Backend API Developer - Fix Escrow, Notifications & Cashout (Supabase/Next.js)

Job ID: 40500638

Budget: $2 – $8 USD

Tingum is a mobile marketplace platform connecting clients with local taskers (similar to TaskRabbit). Users can post jobs, hire taskers, handle payments via wallet/escrow, approve materials, and complete jobs.

Our website is a simple landing page that directs users to download our mobile app (iOS/Android). All marketplace functionality lives in the mobile app, which consumes our backend API.

We are a small team with a working MVP. The backend is 90% complete. We need an experienced backend developer to finish the remaining critical API endpoints and database logic so our mobile app developer can complete the app.

SCOPE OF WORK - COMPLETE BACKEND COMPLETION:

PHASE 1 - CRITICAL FIXES:
1. Escrow Release API - Create endpoint POST /api/jobs/release-escrow to transfer funds from job escrow to tasker wallet when client approves work, update both client and tasker wallet balances atomically, create auditable transaction records
2. Job Completion Milestone - Fix bug where 'waiting_review' milestone not saving when tasker marks job complete, ensure job status changes from 'in_progress' to 'completed' and milestone from 'work_started' to 'waiting_review'
3. Materials Escrow Trigger - Add PostgreSQL trigger to auto-update jobs.escrow_balance when job_materials.paid_at is set
4. Wallet Balance Updates - Ensure atomic transactions (both wallets update or neither)

PHASE 2 - NOTIFICATIONS:
5. Notification Triggers - Auto-create notifications in database for: job completed (to client), payment released (to tasker), material approved/funded (to tasker), cashout processed (to tasker)
6. Notification API - Create GET /api/notifications to fetch unread notifications for mobile app, PATCH /api/notifications/:id/read to mark as read

PHASE 3 - CASHOUT/WITHDRAWAL SYSTEM:
7. Cashout Request API - POST /api/wallet/cashout for taskers to request withdrawal from wallet (requires amount and payment method details)
8. Admin Cashout Approval - GET /api/admin/cashouts to list pending requests, POST /api/admin/cashouts/:id/approve and /api/admin/cashouts/:id/reject for admin actions
9. Cashout Processing - Upon approval, deduct amount from wallet available_balance, mark request as completed, create transaction record
10. Cashout Rejection - Upon rejection, return funds to wallet, mark request as rejected, notify tasker

PHASE 4 - TESTING & DOCUMENTATION:
11. End-to-End Testing - Test complete flow: client posts job -> tasker bids -> client accepts -> client adds funds (Stripe) -> client funds job escrow -> tasker adds material invoice -> client approves material (wallet deduction) -> tasker marks job complete -> client receives notification -> client approves release -> escrow funds release to tasker wallet -> tasker requests cashout -> admin approves cashout -> tasker receives funds
12. Bug Fixes - Identify and fix any bugs discovered during testing
13. API Documentation - Provide Postman collection with all working endpoints
14. Migration Scripts - Provide SQL scripts for all database changes

DELIVERABLES:
- Git PR with all code changes
- SQL migration scripts
- Postman collection with all endpoints
- Loom or markdown documentation walking through fixes
- Test evidence (screenshots or video) showing complete flow works

STACK: Supabase v2 (PostgreSQL, triggers, RLS), Next.js 13+ API routes (App Router, TypeScript), Stripe SDK, Supabase Realtime

NOT REQUIRED: Mobile app development, frontend UI work, website/landing page, UI design