c_agri_trade/01_BRD/PRD_Specification.md

71 KiB
Raw Blame History

Product Requirements Document (PRD) — Agriculture Trading Backoffice

Field Value
Document PRD_Specification.md
Product Agriculture Trading Backoffice (ATB)
Version 1.0.0
Author Stakeholder elicitation with up-requirements-elicit
Process UP-AI v1.5
Status Draft — business direction accepted; candidate policies pending domain review and baseline approval
Last Updated 2026-10-11

1. Executive Summary & Problem Statement

1.1 The Business Need

Wholesale physical agricultural commodity trading in India's Agricultural Produce Market Committee (APMC) mandis (such as Neemuch, Mandsaur, Ratlam, Kota, and Indore) involves fast-paced daily auctions, high financial exposure, multi-warehouse storage, and strict quality grading.

Wholesale trading firms and licensed commission agents (arhatiyas) handle dozens of truckloads daily across dry-agri commodities (pulses, oilseeds, grains, and spices such as chickpea/chana, soybean, mustard seed, coriander seed, cumin seed, fenugreek, turmeric, and wheat). Trading firms currently struggle with:

  1. Disconnected Paper Slips (Sauda Buhis): Auction purchase commitments made in the mandi yard are not reflected in real time at the godowns, causing intake delays, truck detention, and weighbridge disputes.
  2. Dual-Unit Commercial Complexity: Trading rates are quoted strictly in Indian Rupees per Quintal (₹/Qtl), whereas physical freight, warehouse capacity, and bookkeeping operate in Metric Tonnes (MT) and physical bag counts (kattha/bora). Manual math frequently causes billing errors.
  3. Quality & Lot Segregation Risks: Consignments arriving with high moisture or impurities are accidentally mixed into clean warehouse stacks because quality inspection holds (QC Hold) are not enforced by software gates.
  4. Unhedged Customer Credit Exposure: Customers frequently buy on credit terms (e.g., 7–15 days). Without real-time exposure monitoring, sales desks book orders for customers who have exceeded their sanctioned credit limit, leading to severe bad debt.
  5. Multi-Godown Blind Spots: Stock balances across multiple transit and buffer godowns are reconciled manually at day-end, preventing real-time commitment of available inventory to buyers.

1.2 Target Operating Model

The Agriculture Trading Backoffice (ATB) is a modular, multi-tenant back-office and trading operations platform. Its configured implementation stack is maintained in tech-profile.yaml and is not prescribed by this business requirements document. The product establishes an operational chain across the 11 functional areas represented by the reference mockup and this PRD:

Market Desk (Arrivals & Modal Price)
       │
       ▼
Procurement (Auction Sauda Booking) ──► Inward Weighbridge (Gross/Tare/Bags)
                                                │
                                                ▼
                                         Godown Intake & Lot ID Generation
                                                │
                                                ▼
                                         Lab QC Inspection (QC Hold / Release)
                                                │
                                                ▼
Customer Sales Contract ◄────────────── Available Warehouse Stock (MT & Bags)
       │
       ▼
Credit Limit Check (≤80% / Breach Block)
       │
       ▼
Outbound Dispatch Board ──► Transport Fleet Scheduling ──► Outward Weighbridge
                                                                  │
                                                                  ▼
                                                      Customer Receivables Ledger

1.3 Success Measures and Operational Invariants

The following control outcomes are non-negotiable product invariants, measured across all applicable transactions rather than treated as aspirational averages:

  • Complete lot traceability: 100% of lots accepted into inventory must retain the required links from purchase/receipt through QC, stock movements, allocation, and dispatch where applicable.
  • QC safety: Zero allocation or dispatch of a lot that is not in the Released state; no user override may bypass this invariant.
  • Credit control: Zero dispatches above the applicable credit block without a recorded authorized override.

Business-efficiency outcomes must be measured for a representative tenant over 30 operating days before rollout to establish a manual baseline, then for 30 operating days after rollout using the same method. Record manual effort per transaction, gate-in-to-stock-posting time, and stock-reconciliation variance by godown/commodity. The business owner will set numeric improvement targets from the observed pre- and post-rollout results. The protocol is accepted; numeric baseline and target values remain open under AMB-001 pending pilot evidence.

Commercial dual-unit calculation correctness is governed by the formula below and BRD-NFR-001; its performance is addressed separately by the approved service-level targets.

\text{Value (INR)} = \text{Quantity (MT)} \times 10 \times \text{Rate (₹/Qtl)}

2. Target Personas & User Classes

Persona Role / Designation Core Responsibilities & System Permissions
Partner / Managing Director Executive Management Full strategic oversight; reviews daily trading snapshots, net P&L metrics, operational alerts, cash flow, and holds exclusive authority for credit-limit override approvals.
Purchase Manager Procurement Lead Manages supplier relationships, monitors mandi auction windows, negotiates rates, reviews purchase vs. market modal rate variances, and approves purchase saudas.
Procurement Executive Mandi Field Buyer Enters daily mandi auction purchases, tracks arrival volumes, and logs daily market desk price observations directly from mandi yards.
Sales Manager Commercial Lead Evaluates customer inquiries, negotiates sales contracts, monitors customer credit exposure, approves sales contracts, and allocates inventory.
Sales Executive Field / Desk Sales Inputs customer sales orders, tracks order fulfillment stages, and communicates dispatch details to buyers.
Yard Supervisor / Godown Keeper Warehouse Operations Manages godown intake, operates weighbridge gross/tare weighment, verifies physical bag counts (bardana tally), manages stack placement, and oversees dispatch loading.
Quality Officer Quality Inspection & Lab Inspects inward lots, performs physical/lab sampling (moisture %, foreign matter %, damaged grains), enters test results, and toggles FSM states (QC Hold vs. Released).
Logistics Coordinator Transport & Fleet Coordinates carrier fleet (owned and contracted trucks), assigns vehicles to dispatches, generates dispatch bilties/manifests, and monitors transit status.
Accounts Executive Finance & Accounting Records customer payment receipts (NEFT/RTGS/Cheque/Cash), maintains supplier payables aging ledgers, records operational expense vouchers, and reconciles balances.
System Administrator Technical Governance Manages tenant lifecycle, platform configuration, support access, and audit trails. Routine tenant business-data access is not implied by this role.
Tenant Administrator Tenant Operations Manages the tenant’s users, memberships, and role assignments within that tenant; cannot administer other tenants.

3. Mathematical & Commercial Calculation Engine Standards

3.1 Dual-Unit Conversion Engine

In Indian agricultural markets, rates are quoted in ₹ per Quintal, while transport and inventory operate in Metric Tonnes (MT) and Bags:

  1. Metric Unit Definitions:
    • 1\text{ Metric Tonne (MT)} = 1,000\text{ Kilograms (kg)}
    • 1\text{ Quintal (Qtl)} = 100\text{ Kilograms (kg)} = 0.100\text{ MT}
    • 1\text{ Metric Tonne (MT)} = 10.0\text{ Quintals (Qtl)}
  2. Gross Trade Value Formula:
    \text{Value (INR)} = \text{Quantity (MT)} \times 10 \times \text{Rate (₹/Qtl)}
    Example: 24.0\text{ MT} of Coriander seed at ₹4,486\text{ / Qtl} \implies 24.0 \times 10 \times 4486 = ₹1,076,640.
  3. Bag Packing Standard:
    \text{Average Bag Weight (kg)} = \frac{\text{Net Weight (MT)} \times 1000}{\text{Bag Count}}
    Standard nominal packing is 50 kg or 100 kg per bag.

3.2 Inward Weighbridge & Bag Tare Deduction (Bardana Katai)

  1. Net Truck Weight:
    \text{Gross Truck Weight (kg)} - \text{Tare Truck Weight (kg)} = \text{Unloaded Gross Commodity Weight (kg)}
  2. Bag Tare Deduction (Bardana Katai):
    \text{Tare Bag Deduction (kg)} = \text{Bag Count} \times \text{Tare Weight Per Bag (kg)}
    (Default standard: 1.0 kg per gunny/jute bag, 0.2 kg per HDPE/plastic bag).
  3. Net Payable Weight:
    \text{Net Weight (MT)} = \frac{\text{Unloaded Gross Commodity Weight (kg)} - \text{Tare Bag Deduction (kg)}}{1000}
  4. Weighment Shortage / Variance Calculation:
    \text{Variance \%} = \frac{\text{Actual Net Weighbridge MT} - \text{Booked Purchase MT}}{\text{Booked Purchase MT}} \times 100
    • If |\text{Variance \%}| \le 0.5\%: Auto-accepted within normal mandi weighment tolerance.
    • If \text{Variance \%} < -0.5\%: Shortage flagged; net payable MT adjusted to actual weighbridge receipt.

3.3 Customer Credit Exposure & Risk Engine

\text{Current Exposure (INR)} = \text{Total Outstanding Unpaid Receivables (INR)} + \text{Unbilled Confirmed Orders (INR)}
\text{Exposure Ratio \%} = \frac{\text{Current Exposure (INR)}}{\text{Sanctioned Credit Limit (INR)}} \times 100
  • Normal Zone (\le 80\%): Sales orders and dispatches proceed without restriction.
  • Watch Warning Zone (>80\% and \le 100\%): System issues an automated Warning Alert; sales entry flags account on Watch.
  • Breach Block Zone (>100\%): System enforces a Hard Block; order cannot transition to Confirmed or Dispatched without recorded Partner / MD approval.

4. Finite State Machines (FSMs) & Lifecycle Contracts

4.1 Purchase Sauda FSM

[Draft] ──► [Booked] ──► [Gate Inward] ──► [Under QC] ──► [Received / Closed]
               │                                │
               ▼                                ▼
          [Cancelled]                      [Rejected]
  • Draft: Initial booking entered by Mandi Buyer.
  • Booked: Sauda confirmed with supplier and market rate locked.
  • Gate Inward: Truck arrived at godown gate; weighbridge gross weight captured.
  • Under QC: Commodity unloaded; lot minted; awaiting lab test sign-off.
  • Received / Closed: QC accepted; net tare calculated; GRN posted; inventory credited.
  • Rejected: Commodity failed quality thresholds; gate pass issued for return to supplier.

4.2 Commodity Lot FSM

[Generated] ──► [Under QC] ──┬──► [Released] (Available for Allocation & Dispatch)
                             │
                             └──► [QC Hold] ──► [Released] (Post Remediation/Approval)
                                     │
                                     └──► [Rejected / Disposal]
  • Under QC: Initial state upon godown unloading. Cannot be linked to sales orders.
  • QC Hold: Flagged for excessive moisture, foreign matter, or quality dispute. Hard-locked against sales reservation and loading.
  • Released: Lab approved. Eligible for sales order allocation and dispatch board loading.
  • Rejected: Unfit for trade; flagged for return or discounted salvage.

4.3 Sales Order & Dispatch Board FSM

[Draft] ──► [Confirmed] ──► [Allocated] ──► [Loading] ──► [In Transit] ──► [Delivered]
               │                  │
               ▼                  ▼
          [Cancelled]       [Order Hold]
  • Draft: Customer inquiry and pricing quote.
  • Confirmed: Credit check passed; sales contract ratified.
  • Allocated: Released inventory lot(s) tagged to order.
  • Loading: Transport vehicle assigned; bags being loaded onto truck.
  • In Transit: Outward weighbridge completed; dispatch bilty generated; truck en route.
  • Delivered: Consignee proof of delivery (POD) acknowledged; sales invoice finalized.

5. Comprehensive Granular Feature Inventory (BRD-FR-xxx)

Every discrete requirement carries a unique BRD-FR-xxx root ID, detailed operational statement, input/output data attributes, validation rules, and failure modes.

Operational thresholds in the feature descriptions are proposed values from the supplied backup PRD; see §6.2. They are not confirmed operating policy until domain review and baseline approval.

5.1 Module 1: Market Desk & Daily Mandi Intelligence

BRD-FR-001: Daily APMC Mandi Arrival Ingestion & Tracking

  • Owning Module: Market Desk
  • Primary Persona: Procurement Executive / Mandi Buyer
  • Priority: P0
  • Operational Statement: The system must record daily physical arrival volumes at APMC mandi yards across target commodities (Chana, Coriander, Cumin, Fenugreek, Groundnut, Isabgol, Jaggery, Maize, Mustard, Soybean, Turmeric, Wheat) across monitored markets (Neemuch, Mandsaur, Ratlam, Kota, Indore, Jaora, Ujjain, Chittorgarh).
  • Data Attributes: Observation Date, Market Yard, Commodity, Variety, Grade, Arrival Quantity in MT, Internal Stock Position in MT, Observation Source, Timestamp.
  • Validation Rules: Observation date cannot be in the future. Arrival quantity must be \ge 0.0\text{ MT}. Duplicate observation for same market, commodity, variety, and date must be blocked.
  • Failure / Exception Flow: If arrival data is unavailable for a holiday/strike, system must allow flagging the market as Closed / Mandi Holiday.

BRD-FR-002: Daily Modal & Range Pricing Tracking (₹/Qtl)

  • Owning Module: Market Desk
  • Primary Persona: Procurement Executive / Purchase Manager
  • Priority: P0
  • Operational Statement: For each daily mandi arrival record, the system must capture the quoted price range (Min Rate ₹/Qtl, Max Rate ₹/Qtl) and the official modal clearing price (Modal Rate ₹/Qtl).
  • Data Attributes: Quoted Min Rate (₹/Qtl), Quoted Max Rate (₹/Qtl), Modal Clearing Rate (₹/Qtl).
  • Validation Rules: \text{Min Rate} \le \text{Modal Rate} \le \text{Max Rate}. All rates must be > 0.
  • Failure / Exception Flow: If user inputs Modal Rate outside the Min-Max range, validation must reject save with an explicit arithmetic constraint error.

BRD-FR-003: Intraday Price Trend Analysis & 20-Day Benchmark Analytics

  • Owning Module: Market Desk
  • Primary Persona: Purchase Manager / Partner
  • Priority: P0
  • Operational Statement: The system must provide interactive visual charts and trend tables comparing the 20-day historical modal rate trend per commodity across markets, computing 20-day moving averages, 20-day highs/lows, and price velocity.
  • Data Attributes: Historical Date Range, Commodity Filter, Market Filter, 20-Day SMA (Simple Moving Average), Price Spread.
  • Validation Rules: Calculations must dynamically update upon new observation save. Execution time \le 500\text{ms}.

BRD-FR-004: Procurement Price Variance Alert vs. Modal Rate

  • Owning Module: Market Desk & Procurement
  • Primary Persona: Purchase Manager
  • Priority: P1
  • Operational Statement: When booking a purchase sauda, the system must compare the offered trade rate against the latest modal clearing rate for that commodity/mandi. If the offered rate exceeds the modal rate by >5\%, the system must display an inline warning and require confirmation.
  • Data Attributes: Offered Rate, Benchmark Modal Rate, Variance %.
  • Validation Rules: Informational alert only; does not hard-block procurement unless configured in company policy.

5.2 Module 2: Mandi Procurement & Auction Purchases (Sauda)

BRD-FR-005: Mandi Auction & Direct Purchase Sauda Booking

  • Owning Module: Procurement
  • Primary Persona: Procurement Executive / Purchase Manager
  • Priority: P0
  • Operational Statement: The system must record purchase contracts (saudas) negotiated in mandi auctions or directly with suppliers. Each sauda must capture supplier code, sourcing market, commodity, variety, trade rate (₹/Qtl), estimated bag count, and booked quantity in MT. The system must support multi-truck partial delivery: a sauda may be fulfilled across multiple trucks/GRNs over consecutive delivery days, tracking cumulative received MT and remaining balance MT until fully fulfilled.
  • Data Attributes: Sauda ID (PUR-YYYYMM-xxx), Sauda Date, Supplier ID, Sourcing Mandi, Commodity, Variety, Booked Qty MT, Estimated Bags, Trade Rate (₹/Qtl), Gross Value INR, Cumulative Received MT, Remaining Balance MT, Status.
  • Validation Rules: Supplier must be an active master record. Booked MT must be > 0. Trade rate must be > 0. Gross value must equal \text{Booked MT} \times 10 \times \text{Rate}. Status remains Partially Received until cumulative received MT reaches booked MT (within tolerance) or explicitly closed by Purchase Manager.
  • Failure / Exception Flow: If supplier is deactivated or blacklisted, booking must be blocked.

BRD-FR-006: Supplier Credit Terms & Due Date Computation

  • Owning Module: Procurement & Finance
  • Primary Persona: Purchase Manager / Accounts Executive
  • Priority: P0
  • Operational Statement: The system must automatically compute the supplier payment due date by adding the supplier's contractual credit days (e.g., 7, 15, or 21 days) to the sauda or GRN receipt date.
  • Data Attributes: Supplier Credit Days, Transaction Date, Computed Due Date, Payment Status (Pending, Paid).
  • Validation Rules: Default credit days inherited from Supplier master; editable only by Purchase Manager.

BRD-FR-007: Mandi Cess & Statutory Levies Apportioning

  • Owning Module: Procurement & Finance
  • Primary Persona: Accounts Executive
  • Priority: P1
  • Operational Statement: The system must calculate statutory mandi cess (e.g., 1.5% APMC market fee + 0.2% Nirashrit fee) based on the gross sauda value and append it to the total procurement cost.
  • Data Attributes: Mandi Cess Rate %, Cess Amount INR, Total Landed Procurement Cost INR.
  • Validation Rules: Configurable per commodity and market jurisdiction.

5.3 Module 3: Inward Weighbridge & Goods Receipt (GRN)

BRD-FR-008: Inward Vehicle Gate Entry & Verification

  • Owning Module: Goods Receipt
  • Primary Persona: Yard Supervisor
  • Priority: P0
  • Operational Statement: Upon vehicle arrival at the godown, the Yard Supervisor must log gate entry linking the vehicle registration number and driver details to an active booked sauda.
  • Data Attributes: Gate Entry ID, Inward Date/Time, Vehicle Reg No, Driver Name, Contact No, Linked Sauda ID, Supplier Name, Gate Pass No.
  • Validation Rules: Linked sauda must be in state Booked.

BRD-FR-009: Weighbridge Gross & Tare Weighment Logging

  • Owning Module: Goods Receipt
  • Primary Persona: Yard Supervisor
  • Priority: P0
  • Operational Statement: The system must record dual-phase weighbridge measurements for incoming trucks: (1) Gross Weighment (truck + commodity) upon arrival, and (2) Tare Weighment (empty truck) after unloading.
  • Data Attributes: Gross Weight kg, Gross Timestamp, Tare Weight kg, Tare Timestamp, Gross Net Weight kg (Gross - Tare), Weighbridge Slip No.
  • Validation Rules: \text{Gross Weight} > \text{Tare Weight} > 0. Weighbridge slip number mandatory.
  • Failure / Exception Flow: If Tare Weight \ge Gross Weight, system must hard-block submission with an error.

BRD-FR-010: Bag Tare Deduction (Bardana Katai) & Final Net MT

  • Owning Module: Goods Receipt
  • Primary Persona: Yard Supervisor
  • Priority: P0
  • Operational Statement: The system must deduct the weight of packaging bags from the gross commodity weight using the defined tare deduction factor (default 1.0 kg/gunny bag) to calculate true Net Payable MT.
  • Data Attributes: Physical Bag Count, Packaging Type (Gunny/Jute, HDPE/Plastic), Bag Tare Deduction Rate kg/bag, Total Bag Tare kg, Final Net Weight MT.
  • Validation Rules: Formula: \text{Net MT} = (\text{Gross kg} - \text{Tare kg} - (\text{Bags} \times \text{Bag Tare Rate})) / 1000. Net MT must be > 0.

BRD-FR-011: Weighment Tolerance & Transit Shortage Verification

  • Owning Module: Goods Receipt
  • Primary Persona: Yard Supervisor / Purchase Manager
  • Priority: P0
  • Operational Statement: The system must compare the Final Net Weighbridge MT against the Booked Sauda MT. If shortage exceeds 0.5\%, the system must flag a Transit Shortage Warning and adjust the final payable amount to the actual net received weight.
  • Data Attributes: Shortage MT, Shortage Value INR, Variance %, Shortage Status (Normal, Disputed).
  • Validation Rules: If shortage exceeds 2.0\%, the GRN requires mandatory Purchase Manager approval before stock posting.

BRD-FR-012: Goods Receipt Note (GRN) Posting & Warehouse Stack Placement

  • Owning Module: Goods Receipt & Inventory
  • Primary Persona: Yard Supervisor
  • Priority: P0
  • Operational Statement: Upon weighment completion, the system must generate a formal GRN document, allocate the physical goods to a specific warehouse/godown and stack location, credit the warehouse stock book, and mint an inward Commodity Lot.
  • Data Attributes: GRN ID (GRN-YYYYMM-xxx), Receiving Warehouse ID, Stack/Chamber No, Accepted Bags, Accepted Net MT.
  • Validation Rules: GRN submission atomically updates inventory and creates Lot record in state Under QC.

5.4 Module 4: Quality Inspection & Lot Control

BRD-FR-013: Mandatory Lot & Batch Identity Generation

  • Owning Module: Quality & Inventory
  • Primary Persona: Yard Supervisor / Quality Officer
  • Priority: P0
  • Operational Statement: The system must automatically generate a globally unique, immutable Lot ID (LOT-YYYYMM-xxx) for every inward consignment processed through a GRN.
  • Data Attributes: Lot ID, Inward Date, Origin Market, Supplier ID, Commodity, Variety, Receiving Warehouse, Net MT, Bag Count, Quality Status.
  • Validation Rules: Initial status must be Under QC. Lot ID must be permanent and traceable through all sales and dispatches.

BRD-FR-014: Inward Quality Inspection Parameter Recording

  • Owning Module: Quality Control
  • Primary Persona: Quality Officer
  • Priority: P0
  • Operational Statement: The Quality Officer must log laboratory/physical test parameters for the lot: Moisture %, Foreign Matter / Dust %, Admixture (other grains) %, Damaged / Discolored %, and Weevil count.
  • Data Attributes: Inspection Date, Quality Officer ID, Moisture %, Foreign Matter %, Admixture %, Damaged %, Weevil Infestation (None, Mild, Severe), Assigned Commercial Grade (FAQ, Premium, Below FAQ).
  • Validation Rules: Percentage values must be between 0.00\% and 100.00\%.

BRD-FR-015: Quality Deduction / Rebate Calculation

  • Owning Module: Quality Control & Finance
  • Primary Persona: Quality Officer / Accounts Executive
  • Priority: P1
  • Operational Statement: If moisture or foreign matter exceeds standard contract baselines (e.g., standard moisture baseline 10.0%), the system must automatically compute a quality price deduction (e.g., ₹10 deduction per quintal for each 0.5% moisture above baseline).
  • Data Attributes: Base Contract Rate ₹/Qtl, Quality Penalty Rate ₹/Qtl, Adjusted Final Rate ₹/Qtl, Net Purchase Adjustment INR.
  • Validation Rules: Deductions cannot reduce rate below 50% of base rate without partner authorization.

BRD-FR-016: Finite State Machine Enforcement for QC Hold vs. Released

  • Owning Module: Quality Control
  • Primary Persona: Quality Officer
  • Priority: P0
  • Operational Statement: The system must enforce strict FSM transitions on the Lot record. If moisture >12\% or foreign matter >2\%, the lot must be transitioned to QC Hold. A lot on QC Hold is programmatically blocked from sales order allocation and dispatch loading.
  • Data Attributes: Previous Status, New Status (QC Hold, Released), Hold Reason, Action Plan (Drying, Cleaning, Re-testing), Release Timestamp.
  • Validation Rules: Only users with Quality Officer or Partner roles can transition a lot from QC Hold to Released. System must hard-block dispatch of unreleased lots.

BRD-FR-017: Lot Splitting & Blending Traceability

  • Owning Module: Quality & Inventory
  • Primary Persona: Yard Supervisor / Quality Officer
  • Priority: P1
  • Operational Statement: The system must support splitting a parent lot into sub-lots (e.g., when dividing a consignment across two warehouses) or blending multiple lots, maintaining parent-child lineage in the traceability graph.
  • Data Attributes: Parent Lot ID, Child Lot ID(s), Split Qty MT, Split Bag Count, Linage Tree.
  • Validation Rules: Sum of child lot quantities must exactly equal parent quantity deducted.

5.5 Module 5: Multi-Godown Warehouse Inventory

BRD-FR-018: Multi-Godown Dual-Unit Stock Ledger

  • Owning Module: Inventory
  • Primary Persona: Yard Supervisor / Management
  • Priority: P0
  • Operational Statement: The system must maintain a real-time, double-entry stock ledger tracking commodity positions across warehouses (WH-01 Neemuch Main Yard, WH-02 Neemuch North Godown, WH-03 Mandsaur Transit Godown, WH-04 Indore Buffer Depot). For each commodity, variety, and grade, it must maintain Opening Stock MT, Received MT, Dispatched MT, Closing Stock MT, and physical Bag counts. The system must support Periodic Physical Stock Audits: recording physical tally counts against book balances and generating supervisor-authorized Stock Adjustment Vouchers capturing natural storage loss/gain (ghat / nami due to moisture evaporation or seasonal humidity) or handling spillage with mandatory reason codes.
  • Data Attributes: Stock Entry ID, Date, Warehouse ID, Commodity, Variety, Grade, Opening MT, Inward MT, Outward MT, Closing MT, Bag Delta, Closing Bags, Physical Count MT, Adjustment Variance MT, Variance Reason Code (Moisture Loss / Ghat, Handling Spillage, Bag Burst, Seasonal Humidity Gain).
  • Validation Rules: Closing stock MT and bags must never be negative (\ge 0). Adjustments exceeding \pm 1.0\% of godown balance require mandatory Partner electronic sign-off.

BRD-FR-019: Godown Capacity & Volume Utilization Tracking

  • Owning Module: Inventory
  • Primary Persona: Yard Supervisor / Partner
  • Priority: P0
  • Operational Statement: The system must track the physical storage capacity of each warehouse in Metric Tonnes and calculate real-time percentage utilization:
    \text{Utilisation \%} = \frac{\text{Current Closing Stock (MT)}}{\text{Storage Capacity (MT)}} \times 100
  • Data Attributes: Warehouse ID, Name, City, Capacity MT, Current Stock MT, Utilisation %.
  • Validation Rules: Warning status triggered when Utilisation exceeds 85%.

BRD-FR-020: Godown-to-Godown Internal Stock Transfer

  • Owning Module: Inventory & Logistics
  • Primary Persona: Yard Supervisor / Logistics Coordinator
  • Priority: P0
  • Operational Statement: The system must support recording stock transfers between godowns (e.g., from Mandsaur Transit Godown to Neemuch Main Yard), logging origin outward deduction, in-transit state, destination weighment, and destination inward credit.
  • Data Attributes: Transfer ID, Origin Warehouse, Destination Warehouse, Commodity, Lot ID, Transfer Qty MT, Transfer Bags, Vehicle Reg No, Transit Status.
  • Validation Rules: Outward and inward entries must reconcile within \pm 0.2\% transfer tolerance.

5.6 Module 6: Customer Sales Contracts & Orders

BRD-FR-021: Customer Sales Contract Booking

  • Owning Module: Sales
  • Primary Persona: Sales Manager / Sales Executive
  • Priority: P0
  • Operational Statement: The system must record customer sales orders/contracts specifying customer code, destination city, customer segment (Wholesale, Processor, Institutional, Distributor), commodity, variety, grade, contracted quantity in MT, contract rate in ₹/Qtl, and delivery timeline.
  • Data Attributes: Sales Order ID (SAL-YYYYMM-xxx), Order Date, Customer ID, Destination City, Commodity, Variety, Grade, Contract Qty MT, Contract Rate ₹/Qtl, Total Sales Value INR, Payment Terms, Status.
  • Validation Rules: Total Sales Value must equal \text{Contract Qty MT} \times 10 \times \text{Rate ₹/Qtl}.

BRD-FR-022: Customer Credit Limit & Pre-Order Exposure Verification

  • Owning Module: Sales & Finance
  • Primary Persona: Sales Manager / Accounts Executive
  • Priority: P0
  • Operational Statement: Prior to confirming a sales order, the system must evaluate the customer's current outstanding receivables plus the value of the new order against their sanctioned credit limit.
  • Data Attributes: Sanctioned Credit Limit INR, Current Outstanding INR, New Order Value INR, Projected Exposure INR, Projected Exposure Ratio %.
  • Validation Rules: If Projected Exposure Ratio >80\%, display inline warning. If Projected Exposure Ratio >100\%, system must prevent order confirmation unless authorized by Partner.

BRD-FR-023: Sales Order Inventory Allocation

  • Owning Module: Sales & Inventory
  • Primary Persona: Sales Manager / Yard Supervisor
  • Priority: P0
  • Operational Statement: The Sales Manager must allocate specific available inventory lot(s) from a warehouse to a confirmed sales order. The system must verify that selected lots are in Released state and have sufficient unreserved balance.
  • Data Attributes: Sales Order ID, Allocated Lot ID, Allocated Qty MT, Allocated Bags, Warehouse ID.
  • Validation Rules: Allocation fails if Lot status is QC Hold or Under QC, or if available lot unreserved MT < allocated MT.

5.7 Module 7: Outbound Logistics & Dispatch Board

BRD-FR-024: Outbound Dispatch Board Console

  • Owning Module: Logistics
  • Primary Persona: Logistics Coordinator
  • Priority: P0
  • Operational Statement: The system must provide a visual dispatch management board displaying scheduled, loading, and in-transit consignments, matching confirmed sales orders to allocated warehouse lots and transport vehicles.
  • Data Attributes: Dispatch ID (DISP-YYYYMM-xxx), Dispatch Date, Linked Sales Order ID, Customer Name, Destination City, Commodity, Dispatch Qty MT, Assigned Vehicle Reg No, Driver Details, Status (Scheduled, Loading, In Transit, Delivered).
  • Validation Rules: Dispatch cannot be created without an approved sales order and assigned vehicle.

BRD-FR-025: Outbound Weighbridge & Dispatch Bilty/Manifest

  • Owning Module: Logistics & Weighbridge
  • Primary Persona: Yard Supervisor / Logistics Coordinator
  • Priority: P0
  • Operational Statement: The system must capture outward weighbridge weights for loaded dispatch trucks (Tare truck before loading, Gross truck after loading), verify loaded weight against order MT, and generate a printable transport manifest / Bilty.
  • Data Attributes: Dispatch ID, Outward Tare kg, Outward Gross kg, Net Loaded MT, Loaded Bag Count, Transporter Bilty No, e-Way Bill No.
  • Validation Rules: Net loaded MT must match allocated order MT within \pm 1.0\% loading tolerance.

BRD-FR-026: In-Transit Tracking & Proof of Delivery (POD)

  • Owning Module: Logistics
  • Primary Persona: Logistics Coordinator
  • Priority: P0
  • Operational Statement: The system must track dispatch states from In Transit to Delivered. Upon consignee receipt, the Logistics Coordinator logs confirmation date, destination weighment, and uploads POD document reference. If destination weighment or quality parameters reveal a transit shortage or damage acknowledged by the buyer, the system must allow recording a Consignee Shortage Note and automatically generating a compensating Sales Credit Note against the customer ledger without altering the immutable outbound dispatch manifest.
  • Data Attributes: Transit Status, Departure Date/Time, Expected Delivery Date, Actual Delivery Date, Destination Weighbridge Net MT, Transit Loss MT, Consignee Acknowledgement Note, POD Ref, Credit Note ID (if applicable).
  • Validation Rules: Setting status to Delivered triggers automatic generation of finalized Sales Invoice. Consignee shortage deductions exceeding 2.0% require mandatory Sales Manager approval before issuing Credit Note.

5.8 Module 8: Fleet & Vehicle Management

BRD-FR-027: Transport Fleet Registry

  • Owning Module: Logistics & Fleet
  • Primary Persona: Logistics Coordinator
  • Priority: P1
  • Operational Statement: The system must maintain a registry of transport trucks (owned and contract carriers) including registration number, vehicle model, gross payload capacity in MT, ownership type (Own vs Contract), insurance/fitness expiry dates, and operational status (Available, On Route, Maintenance).
  • Data Attributes: Vehicle Reg No, Make/Model, Payload Capacity MT, Ownership Type, Transporter Name, Status, Fitness Expiry Date.
  • Validation Rules: Vehicles with status Maintenance cannot be assigned to dispatches.

5.9 Module 9: Customer Receivables & Exposure Management

BRD-FR-028: Customer Ledger & Aging Statement

  • Owning Module: Finance
  • Primary Persona: Accounts Executive / Sales Manager
  • Priority: P0
  • Operational Statement: The system must maintain an immutable party sub-ledger for each customer, debiting finalized sales invoices, crediting payment receipts, and presenting a real-time outstanding balance and aging schedule (0–7 days, 8–15 days, 16–30 days, >30 days).
  • Data Attributes: Customer ID, Posting Date, Voucher Type (Sales Invoice, Payment Receipt), Voucher No, Debit Amount INR, Credit Amount INR, Running Outstanding INR.
  • Validation Rules: Sub-ledger entries are immutable; corrections require credit/debit adjustment vouchers.

BRD-FR-029: Automated Customer Credit Exposure Watch & Threshold Alert

  • Owning Module: Finance & Alerts
  • Primary Persona: Accounts Executive / Partner
  • Priority: P0
  • Operational Statement: The system must continuously recompute the customer exposure ratio (\text{Outstanding} / \text{Credit Limit}). If exposure >80\%, the account must be automatically tagged with a visual Watch badge, and an operational warning alert generated on the Executive Dashboard.
  • Data Attributes: Customer Code, Customer Name, Sanctioned Credit Limit INR, Outstanding INR, Exposure %, Risk Flag (Normal, Watch, Critical).
  • Validation Rules: Evaluated in real time upon every sales invoice post and payment receipt post.

BRD-FR-030: Credit Breach Dispatch Lock & Partner Override

  • Owning Module: Sales & Finance
  • Primary Persona: Partner / Managing Director
  • Priority: P0
  • Operational Statement: If a customer's outstanding receivables exceed 100% of their sanctioned credit limit, all pending dispatches for that customer must be locked. Only a Partner user can record an explicit electronic approval override with mandatory justification notes to release the lock.
  • Data Attributes: Lock Status (Active, Overridden), Override Approved By, Override Reason, Timestamp.
  • Validation Rules: Override action permanently logged in audit trail.

5.10 Module 10: Payments, Payables & Expense Vouchers

BRD-FR-031: Customer Payment Receipt Posting

  • Owning Module: Finance
  • Primary Persona: Accounts Executive
  • Priority: P0
  • Operational Statement: The system must record customer payments capturing payment date, customer code, received amount in INR, payment instrument mode (NEFT, RTGS, Cheque, Cash, UPI), bank reference/UTR number, and payment status (Pending Clearance, Cleared, Bounced). The system must enforce automatic reversal upon Cheque/Instrument Bounce: if an instrument status transitions to Bounced, the system must immediately reverse the credit entry on the customer sub-ledger, restore the previous outstanding debt, recompute exposure ratio %, reinstate credit locks if exposure >100\%, and trigger an urgent financial alert.
  • Data Attributes: Receipt ID (PAY-YYYYMM-xxx), Date, Customer ID, Amount INR, Payment Mode, UTR/Cheque No, Bank Name, Clearance Status, Bounce Reason, Reversal Voucher ID.
  • Validation Rules: Amount must be > 0. Credit applied to customer ledger immediately upon Cleared status. Reversal action generates immutable audit trail entry and notifies Accounts Executive and Sales Manager.

BRD-FR-032: Supplier Payables Aging & Balance Snapshots

  • Owning Module: Finance
  • Primary Persona: Accounts Executive / Partner
  • Priority: P0
  • Operational Statement: The system must track supplier payables arising from accepted GRNs, applying supplier credit days, generating aging schedules, and providing daily aggregate payables snapshots.
  • Data Attributes: Supplier ID, GRN No, Invoice Amount INR, Due Date, Days Overdue, Payment Status (Unpaid, Partially Paid, Paid).
  • Validation Rules: Automated calculation of due date based on GRN date + credit days.

BRD-FR-033: Mandi Operating Expense Classification & Recording

  • Owning Module: Finance
  • Primary Persona: Accounts Executive
  • Priority: P1
  • Operational Statement: The system must record operational expenses incurred in mandi and godown operations categorizing entries under: Labor / Hamali (loading/unloading), Freight / Cartage, Weighbridge Fees, Godown Rent, Mandi Cess, Pest Control/Fumigation, and Office Expenses.
  • Data Attributes: Expense ID (EXP-YYYYMM-xxx), Date, Category, Amount INR, Payee / Vendor, Linked Consignment / Sauda (if applicable), Payment Mode, Status.
  • Validation Rules: Expense vouchers must balance against cash/bank ledger accounts.

5.11 Module 11: Real-Time Operational Alerts & Executive Analytics

BRD-FR-034: Real-Time Operational Alerts Engine

  • Owning Module: Management & Alerts
  • Primary Persona: Partner / Operations Supervisor
  • Priority: P0
  • Operational Statement: The system must evaluate active business data and publish automated proactive alerts across four critical categories:
    1. QC Pending Alert: Lots in state Under QC for >24 hours or currently on QC Hold.
    2. Warehouse Capacity Alert: Godowns exceeding 85% storage capacity utilization.
    3. Credit Risk Alert: Customer accounts exceeding 80% or 100% of sanctioned credit limit.
    4. Active Procurement Window Alert: Mandis with open buying orders during active trading hours.
  • Data Attributes: Alert ID, Severity (Info, Warning, Critical), Category, Title, Detail Text, Timestamp, Dismissed Status.
  • Validation Rules: Evaluated synchronously upon transaction mutations and refreshed periodically.

BRD-FR-035: Executive Control Centre Dashboard

  • Owning Module: Management
  • Primary Persona: Partner / Managing Director
  • Priority: P0
  • Operational Statement: The system must provide a unified operational dashboard displaying real-time metrics: Total Stock on Hand (MT), Total Active Stock Lines, Intraday Purchase Value INR, Intraday Sales Revenue INR, Total Customer Receivables INR, Top 10 Stock Lines by Volume, Top Recent Sales, and Warehouse Utilization Barometers.
  • Data Attributes: KPI Metric Cards, Warehouse Position Table, Top Stock Grid, Recent Sales Feed, Active Alerts Feed.
  • Validation Rules: Dashboard must load within \le 1.5\text{s}.

BRD-FR-036: 20-Day Consolidated Trading Trend Reporting

  • Owning Module: Management & Reporting
  • Primary Persona: Partner / Managing Director
  • Priority: P0
  • Operational Statement: The system must compile daily management snapshots across a rolling 20-day trading window, tabulating: Date, Purchases MT, Sales MT, Closing Stock MT, Total Receivables INR, and Total Payables INR.
  • Data Attributes: Daily Snapshot Array (Date, Purchases MT, Sales MT, Stock MT, Receivables INR, Payables INR).
  • Validation Rules: Dynamically calculated from transaction ledgers; sub-second query performance.

5.12 Cross-Cutting & Governance Modules

BRD-FR-037: Agricultural Commodity Master Data Management

  • Owning Module: Master Data
  • Primary Persona: System Administrator
  • Priority: P0
  • Operational Statement: Maintain authoritative master catalogs for: Commodities (Chana, Soybean, Mustard, Wheat, Coriander, Cumin, Fenugreek, Groundnut, Isabgol, Jaggery, Maize, Turmeric), Varieties per commodity (e.g., Lokwan, Pusa, Eagle/Badami), and Commercial Quality Grades (FAQ, Premium, Below FAQ).
  • Data Attributes: Commodity Code, Commodity Name, Category (Grains, Pulses, Oilseeds, Spices), Varieties List, Standard Bag Weight kg.
  • Validation Rules: Commodity code must be unique; cannot delete commodities with active stock ledger entries.

BRD-FR-038: Trading Counterparty Masters (Suppliers, Customers & Godowns)

  • Owning Module: Master Data
  • Primary Persona: System Administrator / Accounts Executive
  • Priority: P0
  • Operational Statement: Maintain registries for: (1) Suppliers (Code, Name, City, Segment, Credit Days: 7/15/21), (2) Customers (Code, Name, City, Segment, Credit Limit INR, Contact), and (3) Godowns/Warehouses (Code, Name, City, Capacity MT).
  • Data Attributes: Entity Code, Name, Address, GSTIN/PAN, Bank Details, Status (Active, Inactive).
  • Validation Rules: Tax IDs validated where applicable.

BRD-FR-039: Tenant Data Isolation

  • Owning Module: Architecture & Security
  • Primary Persona: System Administrator
  • Priority: P0
  • Operational Statement: Each independent trading enterprise is a tenant; its branches and godowns operate within that tenant boundary. Users and transactions must be associated with the correct tenant, and access to one tenant’s business data must not expose another tenant’s data. The isolation implementation must conform to the active technology profile.
  • Data Attributes: Tenant ID, Tenant Name, Tenant Status, Tenant Administrator, Branch and Godown IDs.
  • Validation Rules: Tenant context must be enforced on every applicable business operation and verified for cross-tenant data access.

BRD-FR-040: Role-Based Access Control (RBAC) & Permission Scoping

  • Owning Module: Security
  • Primary Persona: System Administrator
  • Priority: P0
  • Operational Statement: Access to business records and actions must be governed by role-based permissions for the roles defined in this PRD: Tenant Administrator, Mandi Buyer, Purchase Manager, Yard Supervisor, Quality Officer, Sales Executive, Sales Manager, Logistics Coordinator, Accounts Executive, Partner / MD, and System Administrator.
  • Data Attributes: Role Name, Resource/Action Permission Matrix (Read, Write, Create, Delete, Submit, Cancel, Amend).
  • Validation Rules: Segregation of duties enforced: Quality Officers cannot edit prices; Yard Supervisors cannot confirm sales; Sales Executives cannot override credit locks.

BRD-FR-041: Immutable Transaction Audit Logging

  • Owning Module: Governance
  • Primary Persona: System Administrator
  • Priority: P0
  • Operational Statement: Submitted business records (GRNs, Sales Orders, Dispatches, Payment Receipts) must preserve an auditable history. Corrections must not silently rewrite the business history. The system must record user ID, timestamp, and the changed values for governed mutations.
  • Data Attributes: Audit Trail Log ID, Document Type, Document Name, Modified By, Modified Timestamp, Field Diff JSON.
  • Validation Rules: Audit history cannot be deleted or modified through normal application operations.

BRD-FR-042: Tenant Provisioning and Lifecycle Management

  • Owning Module: Platform Administration
  • Primary Persona: System Administrator
  • Priority: P0
  • Operational Statement: Public self-service tenant signup is out of scope for v1. An authorized platform administrator must create and configure each tenant, assign its initial Tenant Administrator, and activate, suspend, or close the tenant through a controlled lifecycle. Tenant lifecycle changes must not silently delete or expose business records.
  • Data Attributes: Tenant ID, Tenant Name, Lifecycle Status, Created/Updated Timestamps, Tenant Administrator, Lifecycle Actor and Reason.
  • Acceptance Intent: Each lifecycle transition is authorized, recorded, and reflected consistently across application access, API requests, and scheduled work. Closed/suspended tenant data handling follows the retention and deletion policy approved for the service.

BRD-FR-043: Tenant Membership and Role Administration

  • Owning Module: Identity & Access Management
  • Primary Persona: Tenant Administrator
  • Priority: P0
  • Operational Statement: A person may hold active memberships in multiple tenants. A Tenant Administrator must be able to add, deactivate, and assign approved business roles to users within their own tenant. A tenant administrator must not manage users or roles belonging to another tenant. Platform-level administrators and tenant-level administrators must have distinct permissions.
  • Data Attributes: User ID, Tenant ID, Membership Status, Role Assignments, Changed By, Changed At.
  • Acceptance Intent: Users receive no tenant access without an active membership and role assignment; membership changes take effect on subsequent authorized operations and are auditable.

BRD-FR-044: Verified Tenant Context for Every Operation

  • Owning Module: Identity & Access Management
  • Primary Persona: All authenticated users
  • Priority: P0
  • Operational Statement: The service must derive the effective tenant context from the authenticated user’s verified tenant membership. A client-supplied tenant identifier alone must never grant or switch tenant access. A user associated with multiple tenants must explicitly select the active tenant after sign-in; the service verifies that membership and its role for every request before permitting action in that tenant.
  • Data Attributes: Authenticated Subject, Effective Tenant ID, Membership, Role Claims, Request/Correlation ID.
  • Acceptance Intent: Missing, invalid, or unauthorized tenant context is denied by default; the same checks apply to REST APIs and non-interactive operations.

BRD-FR-045: End-to-End Tenant Resource Isolation

  • Owning Module: Platform Security
  • Primary Persona: All users; System Administrator for platform controls
  • Priority: P0
  • Operational Statement: Tenant isolation must apply to all tenant-owned records and derived resources, including database reads and writes, API lookups, search/report results, exports, uploaded files, cache entries, and queued/background work. Cross-tenant access attempts must fail closed and must not reveal whether another tenant’s resource exists.
  • Data Attributes: Tenant ID on tenant-owned resources; resource owner; access decision; actor; timestamp; correlation ID.
  • Acceptance Intent: Automated negative tests demonstrate that users, crafted identifiers, concurrent requests, reused database connections, and background jobs cannot read or mutate another tenant’s resources. Database roles and policies must not allow normal application paths to bypass the configured row-level security controls.

BRD-FR-046: Controlled Privileged Support Access

  • Owning Module: Platform Security & Operations
  • Primary Persona: System Administrator
  • Priority: P0
  • Operational Statement: Platform support must not imply routine unrestricted access to tenant business data. Support staff have no standing access to tenant business data. Ordinary exceptional access requires approval by that tenant’s Tenant Administrator for a specific support case and a limited duration. For an urgent incident, a designated platform security administrator may grant a break-glass access window of at most one hour, with a recorded reason, immediate audit alert, and notice to the tenant administrator within one business day. All access is recorded for tenant and platform security review.
  • Data Attributes: Support Actor, Tenant ID, Reason/Case Reference, Approval, Start/End Time, Resources Accessed, Audit Event.
  • Acceptance Intent: Privileged access can be granted and revoked through a controlled workflow; all such access is attributable and reviewable. Ordinary access requires tenant-admin approval; emergency break-glass access follows the one-hour limit and notification controls above.

5.5 Module 13: Privacy Operations & DPDP Support

  • Owning Module: Privacy Operations
  • Primary Persona: Tenant Administrator; System Administrator for platform-controlled processing
  • Priority: P0
  • Operational Statement: The service must allow each responsible Data Fiduciary to determine and approve the processing purpose, applicable lawful basis, and privacy notice for its processing, then document personal-data categories, purpose, basis, notice version, and accountable contact. Tenant firms own these decisions for trading data; the ATB operator records them separately for its own account, security, and service processing. Privacy controls cover every natural person whose personal data is processed in tenant or platform contexts, whether or not that person has an application account. Where consent is the applicable basis, the service must capture evidence of the notice and consent, support withdrawal, and record resulting processing restrictions. Tenant and platform processing contexts must remain distinguishable.
  • Data Attributes: Processing Purpose ID, Data Category, Responsible Entity/Role, Processing Basis, Notice Version, Consent Status and Timestamp, Withdrawal Timestamp, Contact.
  • Acceptance Intent: Personal data processing purposes and notices are attributable to the responsible Data Fiduciary; consent-dependent processing can be stopped or adjusted following a verified withdrawal, subject to applicable lawful retention or other legal obligations.

BRD-FR-048: Data Principal Rights & Grievance Case Management

  • Owning Module: Privacy Operations
  • Primary Persona: Tenant Administrator; System Administrator for platform-controlled processing
  • Priority: P0
  • Operational Statement: The service must support receipt, identity verification, routing, tracking, response, and evidence retention for Data Principal requests and grievances concerning access to information, correction, erasure, consent withdrawal, grievance redressal, and nomination, as applicable, including for individuals who do not hold application accounts. Requests must be routed to the responsible Data Fiduciary and handled within the applicable statutory or approved contractual time limit. A request channel must be available without requiring a general customer or supplier portal account.
  • Data Attributes: Request ID, Data Principal Identifier, Tenant/Platform Scope, Request Type, Verification Evidence, Responsible Fiduciary, Received/Due/Resolved Timestamps, Disposition, Response Evidence.
  • Acceptance Intent: Requests are not silently lost or fulfilled against the wrong tenant; authorized operators can track deadlines, exceptions, approvals, and completion evidence while preserving tenant isolation.

BRD-FR-049: Personal Data Breach Response Coordination

  • Owning Module: Privacy Operations & Security Operations
  • Primary Persona: System Administrator; Tenant Administrator for tenant-scoped incidents
  • Priority: P0
  • Operational Statement: The service must support recording, triaging, investigation, impact assessment, remediation, and notification coordination for suspected or confirmed personal-data breaches. The platform operator must be able to identify affected tenants and notify the responsible tenant Data Fiduciary promptly when acting as its Data Processor. The workflow must support applicable notification content and deadlines to affected Data Principals and the Data Protection Board, including phased or subsequently amended statutory requirements.
  • Data Attributes: Incident ID, Detection Time, Affected Data/Tenants/Principals, Processor/Fiduciary Roles, Severity, Timeline, Evidence, Mitigation, Notifications and Delivery Status.
  • Acceptance Intent: Each incident has an accountable owner and audit trail; the responsible Data Fiduciary can assemble required facts and evidence for notifications and demonstrate completion within applicable deadlines.
  • Owning Module: Privacy Operations & Data Governance
  • Primary Persona: Tenant Administrator; System Administrator for platform-controlled processing
  • Priority: P0
  • Operational Statement: Use four internal sensitivity levels—Public, Internal, Confidential, and Restricted—with a separate personal-data flag and processing-purpose tag; these are product handling labels, not statutory DPDP classifications. The responsible Data Fiduciary must approve retention schedules by personal-data category and processing purpose after legal/accounting review (tenant firms for trading data; ATB operator for its own account, security, and service data). Authorized operators must be able to apply these schedules by tenant/platform responsibility and applicable legal obligation. The service must support correction, erasure or irreversible de-identification when required, legal holds and statutory retention exceptions, and deletion handling for derived copies and processors, including backups according to the approved schedule. Statutory processing-log retention requirements must be represented separately from general business-record retention.
  • Data Attributes: Data Category, Purpose, Responsible Fiduciary, Retention Rule, Trigger Date, Legal Basis/Exception, Hold Status, Erasure/De-identification Evidence, Processor Completion.
  • Acceptance Intent: Data is not erased while an applicable hold or mandatory retention obligation applies; once all approved purposes and legal exceptions expire, erasure is trackable across applicable system copies and contracted processors.

BRD-FR-051: Data Processor & Subprocessor Governance

  • Owning Module: Platform Governance
  • Primary Persona: System Administrator
  • Priority: P0
  • Operational Statement: The platform operator must maintain an inventory of processors and subprocessors used for tenant personal data, their processing purpose and location, applicable safeguards and contractual obligations, and status of due diligence. The operator must support tenant Data Fiduciaries with information and operational assistance needed for security safeguards, Data Principal requests, breach response, retention, and erasure obligations.
  • Data Attributes: Processor/Subprocessor, Processing Purpose, Data Categories, Processing Location, Contract/Safeguard Reference, Due-Diligence Status, Incident/Request Assistance Record.
  • Acceptance Intent: Processor and subprocessor relationships are identifiable and reviewable; support actions are attributable and consistent with documented tenant instructions and applicable contractual safeguards.

BRD-FR-052: Tenant Operating Policy Configuration & Audit

  • Owning Module: Tenant Business Administration
  • Primary Persona: Partner / Managing Director; authorized tenant functional managers
  • Priority: P0
  • Operational Statement: The service must provide tenant-scoped configuration for the provisional operating thresholds listed in §6.2, including market-price variance, weighment shortage, bag tare/packing, commodity quality grading/deductions, credit exposure, warehouse capacity/adjustments/transfers, dispatch tolerances, and alert timing. Policies must support commodity, grade, contract, or other applicable scope and effective dates where needed. Only roles authorized in the tenant permission model may change them; changes must record actor, timestamp, reason, prior value, and new value. Seed values remain provisional. Before each affected live workflow is enabled for a tenant, that tenant’s Partner/Managing Director or delegated authorized business owner must review and confirm or edit every applicable threshold. Missing or unreviewed thresholds block only the affected risk-sensitive workflow. Confirmed policies are versioned with an effective date and changes are audited.
  • Data Attributes: Tenant ID, Policy Type, Scope (Commodity/Grade/Contract), Value, Unit, Effective From/To, Changed By/At, Reason, Prior Value.
  • Acceptance Intent: One tenant’s policy never changes another tenant’s behavior. Applicable policy versions can be identified for every governed transaction; unauthorized or unaudited changes are rejected. Candidate values are never silently treated as universally validated rules; the affected workflow remains disabled for a tenant until its authorized business owner confirms or edits the applicable values.

6. Non-Functional Requirements & Constraints (BRD-NFR-xxx)

NFR ID Requirement Area Statement & Quantitative Metric Priority
BRD-NFR-001 Commercial Calculation Integrity Dual-unit mathematical conversions (\text{Value} = \text{MT} \times 10 \times \text{Rate}_{\text{Qtl}}) and bag tare deductions must maintain decimal precision to 3 decimal places for weight and 2 decimal places for currency without rounding drift. P0
BRD-NFR-002 UI Rendering Performance Web views, forms, and executive dashboards must achieve page load rendering times \le 1.5\text{ seconds} on standard broadband (10 Mbps). P0
BRD-NFR-003 API Latency SLAs Standard resource CRUD endpoints and list filter queries must achieve response latencies \le 250\text{ ms} (p95) under normal operating load. P0
BRD-NFR-004 High-Volume Reporting SLA 20-day trading trend snapshots and multi-godown stock position reports must generate in \le 1.0\text{ second} for a tenant with historical ledgers containing \ge 50,000 transaction rows. P0
BRD-NFR-005 Programmatic FSM Invariant Protection Finite State Machines for Lot Quality (Under QC \rightarrow QC Hold / Released) and Outbound Dispatches must be enforced in backend domain logic, preventing client-side or API bypass. P0
BRD-NFR-006 Tenant Data Isolation Tenant data must remain isolated according to the row-level security model configured in tech-profile.yaml; unauthorized cross-tenant access must be prevented and tested. P0
BRD-NFR-007 Offline Sandbox Testability Configured identity, payment, and messaging integration adapters must provide deterministic local mocks capable of offline, reproducible verification without external network access. P0
BRD-NFR-008 Automated Test Coverage Budgets Code must meet UP-AI differentiated coverage budgets: \ge 95\% statement/branch coverage for backend domain services and FSMs, \ge 90\% for sandbox adapters, and \ge 80\% for frontend components. P0
BRD-NFR-009 Application Security Assurance The v1 launch is India-first and must support compliance with India’s Digital Personal Data Protection Act, 2023 and the DPDP Rules applicable at production launch. Supporting tenants subject to other jurisdictions requires a separate legal and privacy assessment before onboarding. Application-security verification must target OWASP ASVS v5.0.0 Level 2. Applicable requirements must be mapped to verification evidence; any non-applicable requirement or exception must be documented with rationale and an accountable owner. Authentication, session handling, authorization, input validation, secure configuration, and sensitive-data protections in transit and at rest must be verified before production release. The compliance design must account for phased commencement and be revalidated against current official notifications before release. P0
BRD-NFR-010 Tenant Isolation Assurance Tenant isolation must fail closed across synchronous and asynchronous paths, including APIs, database connections, exports, files, caches, scheduled jobs, and support tooling. Automated tests must include cross-tenant negative cases and privileged-role bypass cases. P0
BRD-NFR-011 Availability and Recoverability Production service availability must be at least 99.9% per month, measured 24/7. Recovery time objective (RTO) must be no more than 4 hours and recovery point objective (RPO) no more than 15 minutes. Backups must be encrypted, taken daily, support point-in-time recovery, and be retained for 35 days. Restore exercises must be performed quarterly and their results recorded before production release. P0
BRD-NFR-012 Capacity and Tenant Fairness The initial production capacity-planning envelope is 50 tenant firms, up to 25 named users per tenant, and 250 concurrent active users across the service. Report performance must be validated with at least 50,000 ledger rows for a tenant. Load-test the platform for 200 core business documents per tenant per operating day and a 5× peak-hour burst, across the approved tenant/user envelope. This is a provisional capacity-planning scenario, not a customer usage cap. No fixed business-document quota is imposed by this planning envelope. Per-tenant resource use must be observable, with configurable early warnings near the tested fair-share budget. Under contention, the service may apply backpressure or temporarily throttle resource-intensive reports and bulk exports to protect service levels, while preserving and safely reporting the outcome of accepted core business transactions. Numeric fair-share budgets and alert thresholds must be set from architecture/load-test evidence. P0
BRD-NFR-013 Operational Observability Production operations must provide service-level and tenant-scoped health, error, latency, and workload signals with actionable alerts. Logs and telemetry must carry tenant/correlation context where authorized and must exclude secrets and unnecessary sensitive business data. P0
BRD-NFR-014 Data Governance and Retention The service must define and enforce four internal sensitivity levels (Public, Internal, Confidential, Restricted), with personal-data and processing-purpose tags applied independently, alongside purpose-aware retention, Data Principal request handling, export, correction, erasure, and legal-hold handling, including tenant closure, in support of applicable DPDP obligations and other applicable laws. These internal labels do not represent statutory DPDP categories. Each responsible Data Fiduciary must approve retention durations by category and purpose after legal/accounting review. The system must preserve applicable statutory minimums and legal holds, and support erasure when purposes and retention obligations end. Backup, processing-log, and audit-data retention and access must follow the approved policy and applicable statutory periods. P0

6.1 Active Technology Constraints

The business requirements must be implemented using the active tech-profile.yaml: modular monolith; Python/FastAPI backend with SQLAlchemy, Alembic, and REST/OpenAPI; React/TypeScript frontend with Zustand and Tailwind/shadcn, using a Node.js frontend toolchain; Keycloak with OIDC/PKCE and JWT bearer tokens; RBAC/ABAC authorization; PostgreSQL with row-level security for tenant isolation; and Valkey for cache/streams. The profile configures deterministic sandboxes for identity, payment, and messaging. Frontend unit/component testing uses Vitest and browser E2E uses Playwright. These implementation constraints supersede conflicting technology references in the supplied backup PRD. The Node.js version is not specified in the profile.

6.2 Candidate Values Requiring Domain Review

The stakeholder accepted the reference values below as configurable seed candidates, scoped by tenant and, where applicable, commodity or contract. They are not universal business rules. Each tenant’s Partner/Managing Director or delegated authorized business owner must review and confirm or edit applicable values before the affected workflow is enabled; changes must be effective-dated and audited under BRD-FR-052.

Area Candidate value from reference Validation needed
Mandi price variance Warn when offered price is more than 5% above modal price. Confirm benchmark and warning threshold.
Inward shortage Warn above 0.5% variance; require Purchase Manager approval above 2.0%. Confirm tolerance and approval authority.
Bag tare and packing Default tare: 1.0 kg per gunny/jute bag and 0.2 kg per HDPE/plastic bag; nominal bags 50 kg or 100 kg. Confirm packaging types, tare policy, and commercial treatment.
Quality grading Example baseline moisture 10%; example deduction ₹10/Qtl per 0.5% excess; hold above 12% moisture or 2% foreign matter. Confirm per-commodity/contract thresholds, calculation, and release authority.
Credit exposure Warning above 80%; hard block above 100%; Partner/MD override. Confirm exposure formula, limits, and override policy.
Warehouse/inventory Capacity warning above 85%; partner sign-off for adjustments above 1%; inter-godown transfer tolerance ±0.2%. Confirm capacity basis, stock-loss controls, and transfer tolerance.
Dispatch/delivery Outward load tolerance ±1%; Sales Manager approval for customer shortage above 2%. Confirm weighment and claim rules.
Alerts and performance QC pending alert after 24 hours; UI ≤1.5 s; API p95 ≤250 ms; reports ≤1 s at 50,000 rows. Confirm operating hours, data volume, measurement conditions, and service targets.
Platform availability and recovery 99.9% monthly 24/7 availability; RTO ≤4 hours; RPO ≤15 minutes; encrypted daily backups with point-in-time recovery, 35-day retention, and quarterly restore exercises. Validate the hosting design and restore evidence against the approved targets before production.
Platform scale Planning envelope: 50 tenants, 25 named users per tenant, 250 concurrent users service-wide; 200 business documents per tenant per operating day with a 5× peak-hour burst; reports at 50,000 ledger rows per tenant. Validate through load tests; set numeric per-tenant resource limits and refine estimates with pilot/operating data.
Security/compliance level India DPDP Act and the Rules applicable at production launch are in v1 scope; OWASP ASVS v5.0.0 Level 2 is the verification target. Confirm remaining legal/data-role mappings and validate the target against the current regulatory and threat context before production.

Coverage budgets, test dimensions, and test levels are governed by the active technology profile and UP-AI process rather than the backup PRD.

6.3 Multi-Tenant Platform Security and Operations References


7. Scope Boundaries & Explicit Anti-Scope

7.1 In Scope for Version 1.0 (MVP)

  • All 52 functional features (BRD-FR-001 through BRD-FR-052) and 14 NFRs across the 11 reference operational areas plus tenant platform and privacy/security capabilities.
  • Application architecture and technology implementation as configured in tech-profile.yaml.
  • Complete operational workflows matching the RamDayal prototype demonstration dataset.
  • Responsive web UI accessible on desktop and mobile godown tablets.
  • Automated multi-path test suites (\ge 95\% domain coverage) and 21-sheet Excel QA Workbook compilation.

7.2 Explicit Anti-Scope (Deferred to Future Releases)

  • Direct ERP/accounting platform integration: External ERP or accounting-ledger integrations are deferred unless separately approved.
  • Hardware Serial Weighbridge Drivers: Manual entry and supervisor verification of weighbridge tickets; direct COM port/IP serial driver ingestion deferred.
  • Continuous GPS Vehicle Telematics: Vehicle transit state managed via Dispatch Board FSM; live satellite map streaming deferred.
  • National e-NAM Bidding API: Electronic auction bidding with national government portals deferred.
  • Multi-Currency / Forex Settlement: Transactions strictly denominated in Indian National Rupees (INR / ₹).
  • Lab Spectrometry Hardware Ingestion: Quality Officer enters physical test parameters manually after inspection.
  • External customer/supplier self-service access: Customer and supplier records are managed internally; external logins and portals are deferred. Rights requests must still be accepted through an appropriate published contact/request channel.
  • Non-India jurisdiction onboarding: Defer onboarding tenants subject to other jurisdictions until a separate legal and privacy assessment is completed.
  • Intentional processing of under-18s’ personal data: No child-directed or intentional under-18 data processing use case is planned for v1; any such intended processing requires legal/privacy assessment and approved controls before baseline.

8. Requirements Traceability Root Matrix

Module Granular Feature IDs Priority Candidate Use-Case Group (ID to be minted at Stage 5)
Market Desk BRD-FR-001–BRD-FR-004 P0 / P1 Market intelligence and price tracking
Procurement (Sauda) BRD-FR-005–BRD-FR-007 P0 / P1 Mandi purchase booking and supplier terms
Goods Receipt (GRN) BRD-FR-008–BRD-FR-012 P0 Inward weighbridge and godown intake
Quality & Lots BRD-FR-013–BRD-FR-017 P0 / P1 Lot inspection, disposition, and traceability
Warehouse Inventory BRD-FR-018–BRD-FR-020 P0 Stock ledger, capacity, and transfers
Sales Orders BRD-FR-021–BRD-FR-023 P0 Sales contracts, credit check, and allocation
Logistics & Dispatch BRD-FR-024–BRD-FR-026 P0 Outbound dispatch and delivery confirmation
Fleet Management BRD-FR-027 P1 Vehicle registry and availability
Customer Receivables BRD-FR-028–BRD-FR-030 P0 Customer ledger and credit controls
Payments & Expenses BRD-FR-031–BRD-FR-033 P0 / P1 Payment receipts, payables, and expenses
Alerts & Dashboard BRD-FR-034–BRD-FR-036 P0 Operational alerts and management analytics
Master Data & Business Security BRD-FR-037–BRD-FR-041 P0 Master data, business roles, and transaction audit
Tenant Platform & Isolation BRD-FR-042–BRD-FR-046 P0 Tenant lifecycle, membership, isolation, and support access
Privacy Operations & DPDP Support BRD-FR-047–BRD-FR-051 P0 Processing transparency, Data Principal requests, breach response, retention, and processor governance
Tenant Operating Policy Configuration BRD-FR-052 P0 Tenant-scoped, authorized, effective-dated configuration and audit of operational thresholds