commoditiescommodity_perishability_profiles
organizationsuserssellersbuyersdestinationscollection_points
lotslot_eventsbuyer_bidsvehiclesvehicle_capacity_blocksroutesroute_snapshotsweather_snapshotscongestion_snapshots
allocation_runsallocation_decisionsdecision_candidate_scoresreassignment_eventsaudit_logs
- One
commoditycan have manycommodity_perishability_profiles. - One
sellercan declare manylots. - One
buyercan own manydestinationsand manybuyer_bids. - One
destinationcan receive many bids and many congestion snapshots. - One
lotparticipates in many candidate scores and may have zero or more reassignment events. - One
allocation_runowns many candidate scores and many final decisions.
Each operational record carries India-relevant location fields:
statedistricttehsilortalukwhen availablepin_codelatitudelongitude
This allows operation without a hard dependency on external GIS providers.
- quantity is normalized to kilograms internally,
- prices are modeled in INR with explicit decimal precision,
- reporting can render quintals or tonnes as needed.
- store timestamps in UTC,
- render operator views in IST,
- retain bid and unloading windows explicitly,
- record freshness hard stops separately from soft viability thresholds.
decision_candidate_scores is not an optional debug table. It is part of the product. It preserves:
- candidates considered,
- score components,
- feasibility failures,
- why a higher nominal bid lost,
- what the winning margin was.
organizations -> users
organizations -> sellers -> lots -> lot_events
organizations -> buyers -> destinations
commodities -> commodity_perishability_profiles
buyers -> buyer_bids -> destinations
vehicles -> vehicle_capacity_blocks
routes -> route_snapshots
destinations -> congestion_snapshots
lots + buyer_bids + routes -> decision_candidate_scores -> allocation_decisions
allocation_decisions -> reassignment_events
all allocation-changing entities -> audit_logs