2.0 KiB
2.0 KiB
Module Planning: Supplier/Farmer Management
Overview
This module expands the basic member information into a full profile for producers (farmers/suppliers). It allows the system to track where products come from, verify farmer credentials, and manage relationships with cooperatives.
Data Models
FarmerProfile
Extended details for a producer.
id(Primary Key)hashkey(String, Unique)user_id(Foreign Key tousers)organization_id(Foreign Key toorganizations/cooperatives, nullable)farm_name(String)farm_location(Point/Coordinates or Text)main_crops(JSON/Array of strings)verification_status(Enum:UNVERIFIED,PENDING,VERIFIED,REJECTED)certification_details(JSON)created_by(Foreign Key tousers)updated_by(Foreign Key tousers)is_active(Boolean)
FarmerProductMapping
Links farmers to the specific products they supply to stores.
farmer_id(Foreign Key tofarmer_profiles)product_id(Foreign Key toproducts)supply_capacity(Decimal/Unit)harvest_season(String)
Core Workflows
- Farmer Registration: Capturing the detailed "Member Information" as seen in the README.
- Profile Verification: Admin review of submitted documents and farm location.
- Product Sourcing: Linking products in the store to their original farmer sources for traceability.
API Endpoints (Proposed)
| Endpoint | Method | Description |
|---|---|---|
/api/farmers |
GET | List all farmers (filtered by org/admin) |
/api/farmers |
POST | Register a new farmer profile |
/api/farmers/{hashkey} |
GET | Get farmer details |
/api/farmers/{hashkey}/verify |
PATCH | Update verification status |
UI Components (Vue)
- FarmerProfileEdit.vue: Comprehensive form for farmer details.
- FarmerDirectory.vue: Searchable list of registered farmers.
- VerificationDashboard.vue: Admin interface for approving farmer applications.