freightdesk/supabase/migrations
FreightDesk 4923357e29
Some checks are pending
FreightDesk CI/CD / Lint & Test (push) Waiting to run
FreightDesk CI/CD / Build Docker Image (push) Blocked by required conditions
FreightDesk CI/CD / Deploy to Coolify (push) Blocked by required conditions
[OWL] Payment escrow system + marketplace payment integration
Database (migration 006):
- escrow_accounts: per-user balance tracking (available + held)
- escrow_transactions: all financial transactions (deposit/hold/release/refund/payout/fee)
- payout_requests: driver withdrawal requests with bank/UPI details
- platform_config: fee settings (5% commission, min deposit, hold period)
- disputes: payment dispute tracking
- Enhanced loads table: payment_status, escrow_amount, platform_fee, settled_at

Escrow Routes (/escrow):
- GET /escrow — payment dashboard with balance and transactions
- GET/POST /escrow/deposit — deposit funds (simulated, production: Razorpay)
- POST /escrow/hold — move funds to escrow for a specific load
- POST /escrow/release — release funds to driver after delivery
- GET/POST /escrow/payout — driver payout request (UPI or bank)
- POST /escrow/admin/payouts/:id/approve — admin approves payout
- POST /escrow/dispute — raise payment dispute

Views:
- Payment dashboard (balance, transactions, quick actions)
- Deposit page with quick amounts
- Payout request page with bank/UPI forms
- Payment status card on load detail (shipper view)
- Hold/Release/Dispute actions integrated into marketplace flow

Payment Flow:
1. Shipper deposits funds → balance
2. Shipper accepts bid → hold in escrow (driver freight + 5% fee)
3. Delivery confirmed → release to driver
4. Driver requests payout → admin approves → bank transfer
2026-06-08 01:50:02 +00:00
..
001_initial_schema.sql Initial commit: FreightDesk v1.0 2026-06-07 18:57:24 +00:00
002_seed_data.sql Initial commit: FreightDesk v1.0 2026-06-07 18:57:24 +00:00
003_soft_delete.sql [OWL] Security fixes: remove hardcoded password, add setup form, soft-delete migration 2026-06-07 19:34:22 +00:00
004_audit_logging.sql [OWL] Audit logging: cherry-pick Hermes' audit SQL, add routes + views 2026-06-07 20:03:23 +00:00
005_saas_marketplace.sql [OWL] SaaS Marketplace: registration, marketplace, bidding, notifications 2026-06-08 01:35:24 +00:00
006_payment_escrow.sql [OWL] Payment escrow system + marketplace payment integration 2026-06-08 01:50:02 +00:00