Schema Blueprint

Entity Relationship Diagram

Relational mapping of the core data structures powering GramMarket AI.

USERS

Table
id UUID
email String
role Enum(F, B, A)
kyc_status Boolean
created_at Timestamp
1 : N

PRODUCTS

Table
id UUID
farmer_id UUID
name String
harvest_date Date
expiry_date Date
price_per_kg Decimal

ORDERS

Table
id UUID
buyer_id UUID
product_id UUID
total_weight Decimal
status Enum

TRANSACTIONS

Table
id UUID
order_id UUID
amount Decimal
escrow_status String
payment_ref String

DELIVERY

Table
id UUID
order_id UUID
tracking_num String
delivery_fee Decimal
est_arrival Timestamp