40 KiB
Product Requirements Document (PRD / URS) — Agriculture Trading Backoffice (Phase 2)
| Field | Value |
|---|---|
| Document | PRD_Phase2_Specification.md |
| Product | Agriculture Trading Backoffice (ATB) — Phase 2 Expansion |
| Version | 2.0.0-draft |
| Author | Antigravity AI Systems Architect |
| Governing Process | UP-AI v1.5 |
| Parent Baseline | PRD_Specification.md (v1.0.0, Features BRD-FR-001–BRD-FR-052) |
| Scope Baseline | Mandi Yard Realism, Bardana Ledger, APMC Compliance, Rural Farmer Economics, Godown Processing, and Fiduciary Agency |
| Status | Proposed Phase 2 Baseline |
| Date | 2026-10-17 |
1. Executive Summary & Phase 2 Strategic Objectives
1.1 The Business Need for Phase 2
Phase 1 established an exceptionally strong software foundation for multi-tenant wholesale trading: dual-unit commercial arithmetic (\text{₹/Qtl} \leftrightarrow \text{MT} \leftrightarrow \text{Bags}), two-phase weighbridge intake, gated QC hold/release invariants, double-entry stock ledgers, customer credit exposure hard-locks, and DPDP privacy compliance.
However, real-world field deployment across Tier-1 APMC Mandis (such as Neemuch, Mandsaur, Ratlam, Kota, and Indore) revealed that physical agricultural commodity operations require deeper indigenous capabilities that cannot be accommodated by standard B2B wholesale assumptions:
- Packaging Bag (Bardana) Volatility: Packaging gunny and HDPE bags represent millions of rupees in operational working capital and packaging inventory. Phase 1 treated bags merely as a tare weight deduction factor (
1.0\text{ kg}), ignoring bag stock balances, bag wear and tear, and commercial packaging terms (Bardana Sahit vs. Bardana Alag). - APMC Regulatory Enforcement (Anugya Patra): Physical transport of agricultural commodities outside the mandi boundary without a statutory Mandi Samiti Transit Permit (Anugya Patra / Form M) results in truck impoundment and 5x–10x tax penalties.
- Rural Farmer Economics & Onboarding Realism: Smallholder farmers (Kisans) are legally exempt from PAN requirements under Section 139A / Rule 114B of the Income Tax Act (declaring Form 60) and are entitled to same-day or 24-hour statutory settlement under State APMC Acts. Mandatory corporate B2B payment terms and PAN constraints in Phase 1 prevented live farmer onboarding.
- Fiduciary Commission Agency (Kachha Arhatiya) Separation: Many mandi firms operate dual divisions: (a) Commission Agency where they never own the commodity but liquidate it on behalf of farmers, and (b) Merchant Trading where they purchase onto their own balance sheet. Phase 1 forced all intake into proprietary inventory.
- Post-Harvest Godown Conditioning (Sukhai & Chhanai): Freshly harvested grain arrives with variable moisture (14–16%) and impurities (chaff, mud, stones). Godowns perform sun-drying, mechanical grading, and blending across bulk heaps, generating natural shrinkage (Ghat) and commercial byproducts (churi, tukdi, dust).
- Agri-Tax Withholding Compliance: High-turnover traders are mandated to deduct Section 194Q TDS (
0.1\%) on purchases exceeding ₹50 Lakhs and collect Section 206C(1H) TCS, alongside paying GST under Reverse Charge Mechanism (RCM) on Goods Transport Agency (GTA) freight.
1.2 Phase 2 Architectural Blueprint
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ ATB Phase 2 Comprehensive Operating Chain │
└─────────────────────────────────────────────────────────────────────────────────────────┘
MANDI YARD INGRESS
│
┌──────────────────────────────┴──────────────────────────────┐
▼ ▼
[Kachha Arhatiya Flow] [Proprietary Merchant Flow]
Fiduciary Auction Clearing Direct Sauda / Yard Purchase
│ │
▼ ▼
Auction Slip (Bikri Parcha) Inward Gate Entry & Weighbridge
• Gross Realization • Gross / Tare Weighment
• Deduct Hamali / Tolai • Bardana Katai Tare Deduction
• Deduct Farmer Advance (Paishgi) • Farmer Form 60 / KYC Intake
• Net Same-Day Cash/IMPS Payout │
│ ▼
Commission (Arhat) Invoiced to Buyer Godown Intake & Bulk Heap Pooling
│ • Raw Consignment Stack / Heap
│ • Multi-Lot Quality Assay
│ │
│ ▼
│ Godown Processing Work Orders
│ • Sun-Drying (Sukhai & Ghat)
│ • Mechanical Sieving (Chhanai)
│ • Finished Grade + Byproducts
│ │
├──────────────────────────────┬──────────────────────────────┘
│ │
▼ ▼
Bardana Packaging Ledger WDRA Accredited Warehouses
• New/Old Jute & HDPE Stock • e-NWR Electronic Receipts
• Bardana Sahit vs. Alag • Bank Lien & WHR Pledge Loans
• Silaee/Chhapaee Labor • Gated Dispatch Clearance
│ │
└──────────────┬───────────────┘
│
▼
COMMERCIAL OUTBOUND
│
┌──────────────┴──────────────┐
▼ ▼
Direct Processor Sales Broker (Dalal) Intermediation
• Contract Quota Allocation • Dalal Sauda Chitthi
• Section 194Q TDS / 206C TCS • Commission Sub-Ledger
│ │
└──────────────┬──────────────┘
│
▼
STATUTORY TRANSIT DISPATCH
• Mandi Samiti Anugya Patra (Form M)
• Tax-Paid Shulk Chhukta Certificate
• e-Way Bill & Bilty Manifest
• Outward Weighbridge & Consignee POD
2. Updated User Personas & Role Classes
In addition to the 11 personas baselined in Phase 1, Phase 2 formalizes three specialized operational personas:
| Persona | Role / Designation | Core Responsibilities & Authority in Phase 2 |
|---|---|---|
| Kachha Arhatiya Desk | Commission Agent Lead | Facilitates mandi yard auctions for farmers; records auction realization; issues statutory Bikri Parcha; manages farmer advance accounts (Paishgi Khata); disburses same-day farmer proceeds; bills buyer commission (Arhat). |
| Mandi Compliance Officer | Statutory Liaison | Manages Mandi Samiti regulatory relations; generates and tracks official transit permits (Anugya Patra / Form M); reconciles single-point mandi tax balances (Shulk Chhukta); compiles statutory monthly/fortnightly returns (Form 8 / Form R). |
| Godown Processing Supervisor | Mill / Conditioning Lead | Oversees post-harvest conditioning; initiates and executes batch processing work orders (Sun-Drying / Sukhai, Mechanical Sieving / Chhanai, and Blending); reconciles natural moisture shrinkage (Ghat Loss); records finished grain grades and byproduct inventory. |
3. Mathematical & Commercial Calculation Standards (Phase 2 Additions)
3.1 Bardana (Packaging Bag) Commercial Accounting Standard
-
Bag Packing Standard Commercial Options:
- Bardana Sahit (Bags Included): The quoted commodity rate (₹/Qtl) includes the bag. The buyer pays no additional fee for bags, and the seller incurs the bag cost into landed COGS.
\text{Invoice Net} = \text{Net Commodity MT} \times 10 \times \text{Rate (₹/Qtl)} - Bardana Alag (Bags Extra): The commodity rate is quoted strictly for loose grain; bags are billed separately as a line-item asset.
\text{Invoice Total} = (\text{Net MT} \times 10 \times \text{Rate}_{\text{Qtl}}) + (\text{Bag Count} \times \text{Agreed Bag Rate (₹/Bag)}) - Bardana Wapsi (Bags Returned): The buyer or farmer brings their own bags, which must be decanted (Khali Karna) and physically returned, or rented with a refundable bag security deposit.
- Bardana Sahit (Bags Included): The quoted commodity rate (₹/Qtl) includes the bag. The buyer pays no additional fee for bags, and the seller incurs the bag cost into landed COGS.
-
Handling, Stitching & Stencil Marking Labor Apportioning:
\text{Packaging Labor INR} = \text{Bag Count} \times (\text{Rate}_{\text{Bharaee}} + \text{Rate}_{\text{Silaee}} + \text{Rate}_{\text{Chhapaee}})
3.2 Corrective Refraction Table Standard (Quality Karda without Double-Deduction)
To resolve the Phase 1 mathematical defect where moisture was simultaneously deducted from tonnage and debited as a monetary penalty:
- Weight Allowance (Karda / Physical Deduction):
Applicable for foreign matter, dirt, and excess moisture that physically evaporates or is sieved out:
\text{Weight Deduction (MT)} = \text{Consignment MT} \times \left(\frac{\max(0, \text{Foreign Matter \%} - \text{Tolerance \%})}{100}\right)\text{Billable Weight (MT)} = \text{Consignment MT} - \text{Weight Deduction (MT)} - Commercial Price Discount (Bhav Katauti / Rebate):
Applicable when quality parameters (e.g. slight discoloration or weevil damage) lower the commercial grade but do not alter the physical billable mass:
\text{Rate Discount (₹/Qtl)} = \text{Excess Parameter \%} \times \text{Scheduled Discount Rate (₹/Qtl per \%)}\text{Adjusted Rate (₹/Qtl)} = \text{Base Contract Rate (₹/Qtl)} - \text{Rate Discount (₹/Qtl)} - Net Payable Invariant:
Under no circumstances may a cash rebate voucher be debited against a payable that has already had its tonnage truncated for the same parameter.\text{Final Payable INR} = \text{Billable Weight (MT)} \times 10 \times \text{Adjusted Rate (₹/Qtl)}
3.3 Statutory Direct Tax Withholding Engine (Section 194Q & 206C(1H))
-
Section 194Q TDS Rule:
- Applicable if Tenant's Gross Business Turnover
> ₹10.0\text{ Crores}in the preceding financial year. - Triggered when cumulative aggregate purchases from a single supplier exceed
₹50.0\text{ Lakhs}in the current financial year. - Calculation:
\text{TDS Base INR} = \max\left(0, \text{Cumulative Purchases} + \text{Current Invoice} - ₹5,000,000\right) - \text{Prior Subjected Purchases}\text{TDS Deduction INR} = \text{TDS Base INR} \times 0.001 \quad (0.10\% \text{ if PAN available; } 5.0\% \text{ if PAN absent})
- Applicable if Tenant's Gross Business Turnover
-
Section 206C(1H) TCS Rule:
- Applicable to sellers with turnover
> ₹10.0\text{ Crores}receiving consideration> ₹50.0\text{ Lakhs}from a buyer where 194Q was not deducted by the buyer.\text{TCS Collected INR} = \text{Receipt Base INR} \times 0.001 \quad (0.10\%)
- Applicable to sellers with turnover
3.4 Bikri Parcha (Farmer Auction Slip) Net Settlement Formula
\text{Gross Realization INR} = \text{Auction Weight (MT)} \times 10 \times \text{Auction Clearing Rate (₹/Qtl)}
\text{Net Farmer Payable INR} = \text{Gross Realization} - \text{Hamali} - \text{Tolai} - \text{Mandi Cess (if payable by farmer)} - \text{Advance Repayment} - \text{Interest}
4. Phase 2 Granular Feature Inventory (BRD-FR-053 through BRD-FR-075)
4.1 Module 14: Bardana (Packaging Bags) Inventory & Commercial Sub-Ledger
BRD-FR-053: Bardana Stock Ledger & Multi-Godown Bag Balance Tracking
- Owning Module: Packaging & Inventory
- Primary Persona: Yard Supervisor / Godown Keeper
- Priority: P0
- Operational Statement: The system must maintain an independent, real-time double-entry stock ledger for physical packaging bags across godowns, segregated by bag type (
NEW_JUTE_50KG,OLD_JUTE_50KG,NEW_JUTE_100KG,HDPE_50KG,PP_25KG). The ledger must record Opening Bags, Inward Received Bags (from new bag purchases or decanted farmer intake), Outward Dispatched Bags (loaded on dispatch trucks), Damaged / Burst Bags, and Closing Balance. - Data Attributes: Bag Transaction ID, Date, Godown ID, Bag Type, Transaction Type (
PURCHASE_RECEIPT,FARMER_DECANTED,DISPATCH_PACKED,BURST_WRITEOFF,INTER_GODOWN_TRANSFER), Inward Count, Outward Count, Damaged Count, Closing Count. - Validation Rules: Closing balance must be
\ge 0. Burst or damaged bag write-offs exceeding50bags in a single transaction require Yard Supervisor authorization.
BRD-FR-054: Commercial Packaging Terms Engine (Bardana Sahit vs. Bardana Alag)
- Owning Module: Sales & Procurement
- Primary Persona: Purchase Manager / Sales Manager
- Priority: P0
- Operational Statement: All purchase saudas and sales contracts must capture the commercial packaging condition:
BARDANA_SAHIT(Bags Included in commodity rate).BARDANA_ALAG(Bags charged separately; requires bag type and rate per bag in ₹).BARDANA_WAPSI(Farmer/Buyer bags returned; tracks pending return count). The commercial engine must automatically calculate the total packaging charge and append it to the financial voucher.
- Data Attributes: Packaging Term Code, Bag Type, Bag Unit Rate INR, Total Bags Billed, Total Packaging Amount INR, Return Due Date (if Wapsi).
- Validation Rules: If
BARDANA_ALAGis selected, Bag Unit Rate must be> 0.00.
BRD-FR-055: Bagging, Machine Stitching & Stencil Marking Labor Apportioning
- Owning Module: Warehouse & Finance
- Primary Persona: Yard Supervisor / Accounts Executive
- Priority: P1
- Operational Statement: The system must record labor and handling expenses incurred in bagging operations, categorized under: Bag Filling (Bharaee), Machine Mouth Stitching (Silaee), Stencil Marking (Chhapaee), and Stacking (Chakki Lagana). The system must compute total packaging labor per lot and apportion it to the landed inventory cost.
- Data Attributes: Consignment ID, Bag Count, Filling Rate/Bag, Stitching Rate/Bag, Marking Rate/Bag, Total Packaging Labor INR, Labor Contractor ID.
- Validation Rules: Apportioned packaging labor atomically debits inventory valuation and credits the Labor Contractor payable ledger.
4.2 Module 15: APMC Mandi Samiti Statutory Transit Permits & Compliance
BRD-FR-056: Statutory Transit Permit (Anugya Patra / Form M) Generation & Tracking
- Owning Module: Mandi Compliance & Logistics
- Primary Persona: Mandi Compliance Officer / Logistics Coordinator
- Priority: P0
- Operational Statement: The system must record and generate official Mandi Samiti Transit Permits (Anugya Patra / Form M / Form 9) required for physical movement of agricultural commodities outside the mandi boundary. The permit must capture the issuing Mandi Samiti code, permit serial number, vehicle registration number, commodity, variety, net weight in MT, bag count, destination city, validity start timestamp, and validity expiry timestamp.
- Data Attributes: Permit Number, Mandi Samiti Name, Issuance Timestamp, Validity Window Hours (e.g. 24h/48h), Vehicle Reg No, Commodity ID, Dispatch MT, Bag Count, Destination Mandi/City, Consignee Name, Checkpost Endorsement Status.
- Validation Rules: No outbound vehicle carrying agricultural commodities can transition to
In Transitwithout a recorded active Anugya Patra number. Expiry timestamp must be strictly greater than issuance timestamp.
BRD-FR-057: Single-Point Mandi Tax (Shulk Chhukta) Balance Ledger
- Owning Module: Mandi Compliance & Finance
- Primary Persona: Mandi Compliance Officer / Accounts Executive
- Priority: P0
- Operational Statement: Under state APMC laws, Mandi Tax (Mandi Shulk) is paid only once upon first purchase in the market area. The system must maintain a running "Mandi Tax Paid" balance ledger. When inward lots are purchased with mandi cess deposited, their volume credits the Tax-Paid Balance. When goods are sold or dispatched for inter-state trade, the dispatched tonnage is deducted from the Tax-Paid Balance, generating a statutory Shulk Chhukta endorsement on the invoice and transit pass, exempting the consignment from double taxation.
- Data Attributes: Commodity ID, Mandi Jurisdiction, Inward Tax-Paid MT, Dispatched Tax-Paid MT, Closing Tax-Paid MT Balance, Fee Receipt Reference.
- Validation Rules: If an outward dispatch exceeds the available Tax-Paid MT balance, the system must trigger a
Mandi Cess Liability Alertand calculate the additional market fee payable on the deficit.
BRD-FR-058: Fortnightly / Monthly Statutory Mandi Samiti Return Filing (Form 8 / Form R)
- Owning Module: Mandi Compliance
- Primary Persona: Mandi Compliance Officer
- Priority: P1
- Operational Statement: The system must compile statutory periodic returns required by APMC Mandi Samitis (such as Form 8 / Form R in MP/Rajasthan). The report must tabulate: (1) Total inward auction arrivals in MT, (2) Total purchases from farmers, (3) Total gross value INR, (4) Statutory Mandi Shulk deposited INR, (5) Nirashrit / Welfare cess deposited INR, (6) Outward dispatches with Anugya Patra references, and (7) Month-end closing stock in godowns.
- Data Attributes: Return Period (Fortnightly / Monthly), Mandi Board Code, Total Inward MT, Total Value INR, Mandi Fee Paid INR, Cess Paid INR, Total Outward MT, Closing Stock MT.
- Validation Rules: Report figures must reconcile 100% against the stock ledger and financial journals.
4.3 Module 16: Rural Farmer Onboarding & Direct Mandi Settlement Engine
BRD-FR-059: Rural Farmer Master Profiling & Statutory Tax Exemption (Form 60 / KYC)
- Owning Module: Master Data & Compliance
- Primary Persona: Procurement Executive / Accounts Executive
- Priority: P0
- Operational Statement: The system must support onboarding agricultural farmers who do not possess a PAN card, in full compliance with Section 139A and Rule 114B of the Income Tax Act. The farmer master profile must support: (1) Form 60 declaration recording, (2) Aadhaar Number (tokenized/masked), (3) Kisan Credit Card (KCC) account or Bank passbook upload, and (4) Village / Tehsildar / Girdawari land record reference.
- Data Attributes: Farmer ID, Full Name, Father's Name, Village, Tehsil, District, Mobile Number, Tax Compliance Type (
PAN_PROVIDED,FORM_60_DECLARED), PAN (optional if Form 60 selected), Form 60 Reference No, Bank Account No (optional for cash payouts below statutory limit), IFSC, Land Holding Acres. - Validation Rules: If
FORM_60_DECLAREDis selected,pan_numberis optional. Full address and mobile number are mandatory.
BRD-FR-060: Auction Bikri Parcha Generation & Statutory Self-Invoicing (CGST Sec 31(3)(f))
- Owning Module: Procurement & Invoicing
- Primary Persona: Mandi Buyer / Accounts Executive
- Priority: P0
- Operational Statement: When purchasing agricultural produce directly from unregistered farmers in mandi auctions, the system must generate the official Bikri Parcha (Sale Slip) and statutory Self-Purchase Invoice (mandated under Section 31(3)(f) of the CGST Act). The slip must detail: Auction Lot No, Farmer Details, Commodity, Bag Count, Gross Weighbridge Weight, Tare Bag Deduction, Net Billable Weight, Agreed Auction Rate (₹/Qtl), Gross Realization, Statutory Labor Deductions (Hamali/Tolai), and Net Amount Payable.
- Data Attributes: Parcha ID (
PAR-YYYYMM-xxx), Auction Date, Farmer ID, Vehicle/Trolley No, Gross Weight kg, Tare Bags kg, Net Weight MT, Auction Rate ₹/Qtl, Gross Amount INR, Hamali Deduction INR, Tolai Deduction INR, Net Payable INR, Self-Invoice Number. - Validation Rules: Farmer Bikri Parcha must be issued within
2\text{ hours}of auction weighment completion.
BRD-FR-061: Immediate / 24-Hour Farmer Disbursement & Cash Payout Voucher Controls
- Owning Module: Finance & Payments
- Primary Persona: Accounts Executive / Partner
- Priority: P0
- Operational Statement: In compliance with Section 37/38 of State APMC Acts requiring farmer settlement within 24 hours of auction, the system must support immediate payout execution via:
- Direct Bank IMPS/NEFT transfer with immediate UTR capture.
- Cash Payout Voucher (restricted strictly to statutory cash payment ceiling of ₹10,000 per farmer per day under Section 40A(3) of the Income Tax Act, or the applicable APMC cash limit). The system must display an alert for any unpaid farmer parcha exceeding 24 hours.
- Data Attributes: Disbursement ID, Parcha ID, Payment Mode (
IMPS,NEFT,CASH_VOUCHER), Amount INR, Bank UTR No / Cash Voucher No, Disbursement Timestamp, Farmer Signature / Acknowledgment Ref. - Validation Rules: Cash payout voucher must not exceed ₹10,000 per farmer per day unless explicitly exempted under Rule 6DD(e) for direct agricultural produce purchase. Any unpaid parcha
>24\text{ hours}triggers aCritical APMC Compliance Warning.
BRD-FR-062: Pre-Harvest Farmer Advance (Paishgi / Khata) Ledger & Auction Netting
- Owning Module: Finance & Counterparty Accounting
- Primary Persona: Accounts Executive / Kachha Arhatiya
- Priority: P1
- Operational Statement: The system must maintain a personal ledger for farmers receiving pre-harvest seasonal cash or input advances (Paishgi). When the farmer brings grain for mandi auction, the system must present the outstanding advance balance and allow the operator to net the advance and accrued simple interest against the gross auction proceeds on the Bikri Parcha.
- Data Attributes: Advance ID, Farmer ID, Advance Date, Principal Amount INR, Agreed Interest Rate % p.a., Accrued Interest INR, Netting Amount INR, Remaining Loan Balance INR.
- Validation Rules: Netting amount cannot exceed gross farmer auction realization. Netting requires explicit farmer electronic/manual acknowledgment.
4.4 Module 17: Fiduciary Commission Agency Operations (Kachha Arhatiya)
BRD-FR-063: Dual Operating Persona Separation (Merchant vs. Commission Agent)
- Owning Module: Architecture & Platform Governance
- Primary Persona: Tenant Administrator / Partner
- Priority: P0
- Operational Statement: The platform must allow each tenant firm to operate in dual commercial modes: (1) Proprietary Merchant Trading (inventory ownership, stock ledger posting, purchase & sales contracts), and (2) Fiduciary Commission Agency (Kachha Arhatiya) (agency clearing, no inventory title, farmer-to-buyer clearing, and commission revenue). Transactions in agency mode must never credit the tenant's inventory stock ledger or inflate company sales turnover.
- Data Attributes: Operating Division (
PROPRIETARY_TRADING,COMMISSION_AGENCY), Transaction Mode, Revenue Classification. - Validation Rules: Agency clearing transactions must post to Agency Clearing Accounts, not to Commercial Inventory or Trade Turnover accounts.
BRD-FR-064: Non-Title Mandi Auction Clearing & Agency Commission (Arhat) Accounting
- Owning Module: Commission Agency & Finance
- Primary Persona: Kachha Arhatiya Desk / Accounts Executive
- Priority: P0
- Operational Statement: In agency mode, the system must record the auction matching: Seller (Farmer)
\leftrightarrowCommodity\leftrightarrowRate\leftrightarrowBuyer (Third-Party Merchant / Miller). The system must issue a Bikri Parcha to the farmer and a Purchase Bill to the buyer, adding statutory Commission (Arhat — e.g. 1.5%–2.0% payable by the buyer), Mandi Tax, and Hamali. - Data Attributes: Agency Deal ID, Auction Lot ID, Farmer ID, Buyer ID, Commodity, Net MT, Rate ₹/Qtl, Gross Goods Value INR, Arhat Commission % & INR, Mandi Cess %, Total Billed to Buyer INR, Net Remitted to Farmer INR.
- Validation Rules: Goods value is a pass-through; only the Commission Amount (Arhat) is recognized as company revenue.
4.5 Module 18: Post-Harvest Godown Processing, Bulk Heaps & Repacking
BRD-FR-065: Bulk Heap Godown Stacking & Composite Quality Blending
- Owning Module: Warehouse & Inventory
- Primary Persona: Godown Processing Supervisor / Quality Officer
- Priority: P0
- Operational Statement: The system must allow pooling multiple inward GRN lots into a common godown chamber or bulk heap (Dheri / Ganj). Upon merging lots into a bulk heap, the system must atomically calculate the weighted-average quality assay parameters (Moisture %, Foreign Matter %, Damaged Grain %) and assign a new composite Parent Lot ID to the heap.
- Data Attributes: Heap ID, Warehouse Chamber ID, Commodity ID, Variety, Input Lot IDs Array, Total Mass MT, Total Bags, Weighted Moisture %, Weighted Foreign Matter %, Composite Grade.
- Validation Rules: Sum of input lot quantities must exactly equal total heap mass. Input lots transition to
MERGED_INTO_HEAPstatus.
BRD-FR-066: Godown Conditioning Work Orders: Sun-Drying (Sukhai) & Shrinkage (Ghat Loss)
- Owning Module: Godown Operations & Inventory
- Primary Persona: Godown Processing Supervisor
- Priority: P0
- Operational Statement: The system must record Sun-Drying (Sukhai) or mechanical aeration work orders for high-moisture crop lots. The work order must record: Input Lot ID, Input Weight MT, Input Moisture %, Output Dried Weight MT, and Output Moisture %. The system must verify the physical shrinkage against standard moisture evaporation formulas and record the weight delta as
Moisture Loss / Sukhai Ghatin the stock ledger. - Data Attributes: Drying Work Order ID, Godown ID, Input Lot ID, Pre-Drying MT, Pre-Moisture %, Post-Drying MT, Post-Moisture %, Moisture Loss MT, Loss %, Evaporation Variance Status (
NORMAL,EXCESS_INVESTIGATION). - Validation Rules: Post-drying moisture must be strictly less than pre-drying moisture. If actual weight loss exceeds theoretical moisture loss by
>1.0\%, the order requires mandatory Partner sign-off.
BRD-FR-067: Mechanical Cleaning & Sieving Work Orders (Chhanai / Grading) with Byproduct Accounting
- Owning Module: Godown Operations & Inventory
- Primary Persona: Godown Processing Supervisor
- Priority: P0
- Operational Statement: The system must support mechanical cleaning and grading work orders (Chhanai / Grading). The order must consume raw uncleaned lot(s) and yield:
- Cleaned FAQ/Premium Grade Grain Lot (Primary Finished Good).
- Commercial Byproducts: Broken Grains / Small Seeds (Churi / Tukdi) Lot.
- Non-Commercial Waste / Dust (Kuda / Chhilka) Write-off.
- Data Attributes: Cleaning Order ID, Input Lot ID, Input MT, Cleaned Lot ID, Cleaned MT, Cleaned Grade, Byproduct Lot ID, Byproduct MT, Waste Weight MT, Total Mass Balance Reconciled Flag.
- Validation Rules: Mass conservation invariant:
\text{Input MT} = \text{Cleaned MT} + \text{Byproduct MT} + \text{Waste MT}. Stock ledger atomically credits cleaned lots and byproducts while debiting raw lots.
4.6 Module 19: Agricultural Direct & Indirect Tax Compliance
BRD-FR-068: Section 194Q TDS Threshold Tracking & Automatic Tax Withholding
- Owning Module: Finance & Tax Compliance
- Primary Persona: Accounts Executive
- Priority: P0
- Operational Statement: The system must continuously track cumulative aggregate purchases per supplier within each financial year (April 1 to March 31). Once cumulative purchases exceed ₹50.0 Lakhs, the system must automatically deduct
0.10\%TDS (under Section 194Q of the Income Tax Act) from all subsequent purchase payments/vouchers (or5.0\%if the supplier lacks a valid PAN and is not Form 60 exempt), posting the deduction to the statutory TDS Payable Ledger. - Data Attributes: Supplier ID, Financial Year, Cumulative Purchase Value INR, Threshold Exceeded Status (
BELOW_THRESHOLD,ACTIVE_TDS), Current Invoice TDS Base INR, TDS Rate %, Withheld TDS Amount INR, TDS Challan Ref. - Validation Rules: TDS deduction is applied atomically upon invoice/GRN clearance or advance payment, whichever is earlier.
BRD-FR-069: Section 206C(1H) TCS Collection & Pan-India Turnover Monitoring
- Owning Module: Finance & Tax Compliance
- Primary Persona: Accounts Executive
- Priority: P1
- Operational Statement: For tenants liable under Section 206C(1H), the system must track cumulative customer payment receipts in the financial year. Upon receipts from a buyer exceeding ₹50.0 Lakhs, the system must prompt or append
0.10\%TCS onto subsequent sales invoices/receipts (where buyer confirms 194Q is not deducted), crediting the statutory TCS Payable Ledger. - Data Attributes: Customer ID, FY Cumulative Receipts INR, TCS Triggered Flag, TCS Rate %, TCS Billed INR.
- Validation Rules: TCS entries reconcile with quarterly Form 27EQ returns.
BRD-FR-070: Goods Transport Agency (GTA) Freight & GST Reverse Charge Mechanism (RCM)
- Owning Module: Finance & Logistics
- Primary Persona: Accounts Executive
- Priority: P1
- Operational Statement: Inward and outward transport freight paid to Goods Transport Agencies (GTAs) without forward charge invoice must be subjected to GST Reverse Charge Mechanism (
5.0\%GST under RCM). The system must compute the RCM liability (2.5% CGST + 2.5% SGST or 5% IGST) on freight vouchers, debiting the RCM Input Tax Credit (ITC) ledger and crediting the RCM GST Output Payable ledger. - Data Attributes: Freight Voucher ID, Transporter ID, Transporter GSTIN, Consignment Note / Bilty No, Freight Amount INR, RCM GST Rate (5%), RCM CGST INR, RCM SGST INR, RCM IGST INR.
- Validation Rules: RCM entries automatically map to GSTR-3B Table 3.1(d) and Table 4(A)(3).
4.7 Module 20: Collateral Management, Warehouse Receipts (e-NWR) & Bank Pledge Financing
BRD-FR-071: Electronic Negotiable Warehouse Receipt (e-NWR) Intake & Tracking
- Owning Module: Inventory & Finance
- Primary Persona: Accounts Executive / Partner
- Priority: P0
- Operational Statement: When commodity lots are deposited into accredited third-party warehouses (such as WDRA-registered godowns, MPWLC, CWC, StarAgri, or NCML), the system must record the deposit details and map the issued electronic Negotiable Warehouse Receipt (e-NWR) from repositories (CCRL / NERL).
- Data Attributes: Receipt ID, e-NWR Number, Repository (
CCRL,NERL), Accredited Warehouse Name & WDRA Reg No, Commodity ID, Deposited MT, Deposited Bags, Quality Assay Certificate No, Storage Expiry Date. - Validation Rules: e-NWR number must be unique and validated against repository format.
BRD-FR-072: Bank Lien Marking, Pledge Loan Disbursal & Gated Release Invariants
- Owning Module: Inventory, Finance & Risk
- Priority: P0
- Primary Persona: Partner / Managing Director
- Operational Statement: The system must record bank pledge financing against e-NWR receipts. When a bank (e.g. HDFC, SBI, ICICI) sanctions a commodity pledge loan (typically 70–80% of valuation), the system must mark a Hard Bank Lien on the linked inventory lot(s). The system must enforce a strict programmatic invariant: zero allocation or dispatch of bank-pledged stock until an authorized electronic Lien Release Certificate with bank loan repayment reference is posted by the Partner.
- Data Attributes: Lien ID, Linked e-NWR No, Financing Bank Name, Sanctioned Loan INR, Disbursed Loan INR, Interest Rate %, Lien Status (
PLEDGED_TO_BANK,LIEN_RELEASED), Release Reference No, Released By, Released Timestamp. - Validation Rules: Any API or UI attempt to allocate or dispatch a lot in state
PLEDGED_TO_BANKmust fail closed with aHard Security Lien Violation.
4.8 Module 21: Commercial Broker (Dalal) Intermediation & Brokerage Contracts
BRD-FR-073: Commercial Broker (Dalal) Master Directory & Sauda Chitthi Confirmation
- Owning Module: Master Data & Sales
- Primary Persona: Sales Manager / Purchase Manager
- Priority: P1
- Operational Statement: The system must maintain a registry of commercial Mandi Brokers (Dalals), capturing Broker Code, Name, Market Yard, Mobile Number, PAN, and Default Brokerage Terms (₹/Bag or % of trade value). When booking purchase saudas or sales contracts mediated by a broker, the system must link the Broker ID and generate a printable Dalal Sauda Chitthi (Broker Confirmation Slip).
- Data Attributes: Broker ID, Broker Name, Mandi Yard, Contact No, Brokerage Mode (
PER_BAG,PERCENTAGE), Brokerage Rate, Linked Sauda ID / Sales Order ID, Sauda Chitthi No, Broker Confirmation Date. - Validation Rules: Brokerage terms must be locked at the time of sauda confirmation.
BRD-FR-074: Brokerage Commission Sub-Ledger & Delivery-Linked Payout Triggers
- Owning Module: Finance
- Primary Persona: Accounts Executive
- Priority: P1
- Operational Statement: The system must maintain a sub-ledger for each broker. Brokerage commission must accrue upon contract confirmation but must be gated against payout until the consignment has reached
DELIVEREDstatus and consignee payment or delivery proof is acknowledged. - Data Attributes: Brokerage Voucher ID, Broker ID, Contract ID, Dispatch ID, Accrued Amount INR, Payout Status (
ACCRUED_PENDING_DELIVERY,CLEARED_FOR_PAYMENT,DISBURSED), Payment Voucher No. - Validation Rules: Brokerage cannot transition to
CLEARED_FOR_PAYMENTif the linked dispatch is disputed or in shortage litigation.
4.9 Module 22: Corrective Realignment of Phase 1 Core Calculations
BRD-FR-075: Refraction Table-Driven Quality Deductions without Double-Deduction
- Owning Module: Quality Control & Finance
- Primary Persona: Quality Officer / Purchase Manager
- Priority: P0
- Operational Statement: The system must remediate the Phase 1 quality rebate engine by decoupling physical weight haircuts from monetary rate discounts. The system must utilize tenant-configured commodity Refraction Tables. Excess moisture and foreign matter must either deduct physical billable weight or deduct contract rate per quintal, but never compound both for the same excess percentage.
- Data Attributes: Commodity ID, Variety, Refraction Mode (
WEIGHT_ALLOWANCE,RATE_DISCOUNT), Threshold Baseline %, Penalty Factor, Computed Net MT, Computed Net Rate ₹/Qtl, Net Payable INR. - Validation Rules: Net Payable INR must equal
\text{Computed Net MT} \times 10 \times \text{Computed Net Rate (₹/Qtl)}. Double-deduction of moisture is mathematically blocked by backend invariant assertions.
5. Non-Functional Requirements & Constraints for Phase 2 (BRD-NFR-015–BRD-NFR-020)
| NFR ID | Requirement Area | Statement & Quantitative Metric | Priority |
|---|---|---|---|
BRD-NFR-015 |
Low-Connectivity Godown Offline Caching | Mobile tablet views used in remote mandi yards and godowns must cache master catalogs (farmers, commodities, godowns, bag types) and allow queuing inward gate entries and weighment slips offline in IndexedDB, auto-syncing with the backend within \le 3\text{ seconds} of network restoration with conflict-free deterministic deduplication. |
P0 |
BRD-NFR-016 |
Statutory Permit (Anugya Patra) Generation Latency | Official Mandi Samiti Transit Permit (Anugya Patra) documents, barcode generation, and dispatch bilty manifests must render and compile into printable PDF format in \le 2.0\text{ seconds} at p95 under peak yard dispatch concurrency. |
P0 |
BRD-NFR-017 |
Multi-Subledger Double-Entry Consistency | Dual-mode transactions (Agency Clearing vs. Proprietary Merchant) must guarantee transactional ACID boundaries across the four financial sub-ledgers (Inventory Stock, Party Accounts, Bardana Ledger, and Tax Withholding Ledger); partial ledger mutations upon unhandled failure must fail closed with 100\% zero ledger drift. |
P0 |
BRD-NFR-018 |
High-Turnover Agri-Tax Audit Logging | Every calculation and withholding event for Section 194Q TDS, Section 206C(1H) TCS, and GST RCM must preserve an immutable audit trail capturing invoice base, cumulative FY counterparty turnover watermark, applicable tax rate, and exemption reason codes for statutory tax audit defense. | P0 |
BRD-NFR-019 |
Bank Pledge Collateral Lock Integrity | The bank lien state on inventory lots (PLEDGED_TO_BANK) must be enforced at both the SQLAlchemy ORM layer and PostgreSQL database row-level trigger level, mathematically preventing any API route, bulk SQL update, or background allocation worker from reserving or dispatching pledged collateral. |
P0 |
BRD-NFR-020 |
Dynamic Refraction Table Config Performance | Evaluation of commodity-specific quality refraction rules, moisture evaporation formulas, and tiered karda penalties across bulk heaps must execute in \le 50\text{ ms} during inward intake and processing work order posting. |
P1 |
6. Phase 2 Traceability Root Matrix
| Phase 2 Module | Feature IDs | Priority | Proposed Phase 2 Use Cases |
|---|---|---|---|
| Bardana Packaging Ledger | BRD-FR-053–BRD-FR-055 |
P0 / P1 | UC-027: Bardana Packaging Inventory & Handling Commercials |
| APMC Mandi Compliance | BRD-FR-056–BRD-FR-058 |
P0 / P1 | UC-028: Statutory Mandi Transit Permits (Anugya Patra) & Tax Clearance |
| Rural Farmer Settlement | BRD-FR-059–BRD-FR-062 |
P0 / P1 | UC-029: Rural Farmer Onboarding, Bikri Parcha & 24h Settlement Engine |
| Kachha Arhatiya Agency | BRD-FR-063–BRD-FR-064 |
P0 | UC-030: Fiduciary Mandi Agency Clearing & Arhat Commission Accounting |
| Godown Processing | BRD-FR-065–BRD-FR-067 |
P0 | UC-031: Godown Bulk Heaps, Drying (Sukhai) & Grading (Chhanai) Orders |
| Agri-Tax Withholding | BRD-FR-068–BRD-FR-070 |
P0 / P1 | UC-032: Agricultural Tax Compliance (TDS 194Q, TCS 206C(1H), GST RCM) |
| Collateral Management | BRD-FR-071–BRD-FR-072 |
P0 | UC-033: Warehouse Receipts (e-NWR) & Bank Pledge Loan Financing |
| Broker Intermediation | BRD-FR-073–BRD-FR-074 |
P1 | UC-034: Mandi Broker (Dalal) Registry, Sauda Chitthi & Commissions |
| Calculation Realignment | BRD-FR-075 |
P0 | UC-035: Refraction-Based Quality Deductions & Invariant Realignment |
7. Approval & Next Steps
This document establishes the authoritative User Requirements Specification for ATB Phase 2. Upon stakeholder disposition:
- Register
CR-004(Phase 2 Requirements Baseline & Invariant Realignment) inproject_sdlc/00_process_control/change_request_register.md. - Generate Use Case specifications (
UC-027throughUC-035) underproject_sdlc/03_requirements/use_cases/. - Derive System Requirements Specifications (
SRS-P2-xxx) in Stage 8. - Update Stage 9 HLD/LLD designs and database schema migrations in Alembic.