📚 Technical Documentation
1. Project Overview
The Farmers Portal is a specialized produce incentive and tax-alignment platform. It formalizes agricultural transactions by linking them to FIRS e-Invoice standards.
2. User Roles & Workflows
🚜 Farmer Portal
Registered via NIN/BVN. Issued a unique FRIS Farmer ID. Claims are automated; no tech required from the farmer.
🏢 Buyer (Wholesaler) Portal
Businesses register with their TIN. They record purchases, generate FIRS-compliant receipts, and earn Reporting Commissions and Tax Credits.
3. Technical Architecture
- Backend: PHP 8.x with PDO
- Database: MySQL (Relational)
- Security: BCRYPT Hashing, Prepared Statements
Key Database Tables
| Table | Description |
|---|---|
farmers |
KYC data, BVN/NIN, and FRIS IDs. |
buyers |
Wholesaler business data and TINs. |
crops |
HS Codes (Nigeria Customs) and incentive rates. |
sales_transactions |
Master record of every produce sale. |
5. Field Operations: "No-Paperwork" Flow
Step 1: Farmer shows physical ID card (QR code).
Step 2: Buyer scans code via smartphone.
Step 3: Buyer enters Qty/Price.
Step 4: Farmer receives SMS confirmation.
6. Incentive Calculations
Farmer (Cash)
Quantity × Rate/Bag
Example: 100 bags × ₦300 = ₦30,000
Buyer (Commissions)
Total Value × 0.5%
Example: ₦1M × 0.5% = ₦5,000
Buyer (Tax Savings)
5% EDTI Tax Credit + 7.5% VAT Audit Immunity.