📍 Page Location
URL: /dashboard/authenticated (buyer)
📸 Visual Representation of the Page
My Contracts
| Contract ID | Product | Value | Status | Actions |
|---|---|---|---|---|
| contract-001 | Wheat | $2,627,500 | PENDING SUPPLIER CONFIRMATION |
🎨 Detailed Visual Description
Buyer dashboard shows: "Payment Due: $X (70% + fees)" with countdown timer displaying days/hours/minutes remaining. Countdown = (voyage time - 3 days) from document upload date. "Pay Remaining Amount" button visible. If countdown reaches zero, contract automatically moves to "Auction Board" with status "IN AUCTION". Auction page shows minimum bid = 70% + fees. If buyer pays before countdown expires, contract shows "COMPLETED" status.
Key Visual Elements:
- Countdown timer (voyage time - 3 days)
- Payment due amount display
- Automatic auction trigger on timeout
- Auction board with minimum bid
- Real-time countdown updates
⚙️ Backend Process
API Endpoint: POST /api/contracts/:contractId/release-payment (if paid) OR Automatic auction creation (if timeout)
Process Flow:
1. If buyer pays before countdown expires:
2. - Validates payment amount (70% + fees)
3. - Updates contract: status = "completed", finalPaymentReleased = true
4. - Creates transaction record
5. - Logs audit event: payment_released
6. If countdown expires (paymentDueDate < now):
7. - Automatically creates auction in database.auctions Map
8. - Sets auction.minimumBid = (totalValue - depositAmount) + fees = 70% + fees
9. - Sets auction.startingBid = 70% + fees
10. - Updates contract: status = "in_auction", auctionId = auction.id
11. - Removes contract from buyer active contracts list
12. - Adds contract to auction board
13. - Sends notification to all users about new auction
14. - Logs audit event: contract_moved_to_auctionDatabase Operations:
- Table:
database.contracts (update), database.auctions (create if timeout), database.transactions (create if paid) - Action: Complete contract if paid, or create auction if timeout
➡️ Next Action
If paid: Contract completed. If timeout: Contract in auction. Auction bidders can bid minimum 70% + fees to acquire the goods.