Based on your specification, here is a structured **System Requirements & Functional Architecture Document** for the Dairy Supply Chain Platform. It organizes the system by operational tiers, user roles, permission boundaries, and core workflows. ## 1. User Roles & Permission Matrix | Role | Access Level | Primary Responsibilities | |—|—|—| | **Platform Admin** | System-Wide | System limits, credit caps, global user management | | **MCC Admin** | Station Level | Manage MCC staff accounts, PIN security | | **MCC Attendant** | Station Level | Farmer registration, daily milk reception logging | | **Farmer** | Personal Portal | View 14-day delivery ledger and personal profile | | **Milk Supplier** | Enterprise Portal | Manage Loaders & Milk Men, view bulk stock and bookings | | **Milk Loader** | Operational | Quality testing input, volume loading, transport dispatch | | **Milk Man** | Sales & Logistics | Order confirmation, credit assessment, payment collection | | **City Dairy Owner** | Buyer Portal | Self-registration, order management, credit tracking | | **Dairy Credit Bureau** | Financial Authority | Financial record tracking, credit rating ledger | | **UNDATA Admin** | Governance | Quality assurance oversight, policy enforcement, dispute resolution | | **Ministry Admin** | Governmental | Strategic reforms, platform-wide messaging/communications | ## 2. Core Functional Requirements by Dashboard ### A. Milk Collection Centre (MCC) Module * **MCC Admin Operations:**    * Creates MCC user accounts tied to a mandatory **6-digit security PIN** for quick authentication. * **MCC Attendant Operations:**    * Registers individual farmers with verified phone numbers and personal contact information. * **Farmer Portal:**    * Read-only dashboard displaying profile details and a **14-day rolling delivery table**:      * Date | Farmer Name | Liters Supplied | Daily Aggregate Total * **Aggregation Engine:**    * Calculates total daily volume (V) and aggregated quality score (Q).    * Triggers an automated **”Ready for Booking”** signal visible on all Milk Suppliers’ dashboards once daily collection closes. ### B. Milk Supplier Module * **Sub-Account Management:**    * Suppliers create and manage accounts for **Milk Loaders** and **Milk Men** under their organization.    * Full administrative visibility into Loader test logs, Milk Man sales, and outstanding balances. ### C. Field & Logistics Module (Milk Loaders & Milk Men) #### 1. Milk Loader Workflow 1. **Quality Testing:** Performs lab/field testing at the MCC and enters the **Quality Testing Report**. 2. **Platform Visibility:** Test reports instantly broadcast across the platform (visible to Suppliers and Loaders). 3. **Loading & Dispatch:** Measures volume in liters during truck loading and confirms dispatch to destination centers (e.g., Kampala). #### 2. Milk Man Workflow 1. **Order Processing:** Receives order requests and sends formal confirmations to registered City Dairies via automated push notifications. 2. **Credit Check:** Queries the **Dairy Credit Bureau** engine to inspect a dairy’s financial score and debt history prior to approving credit terms. 3. **Terms Determination:** Selects **Cash on Delivery (COD)** or **Credit Line** based on bureau score. 4. **Ledger Maintenance:** Registers partial/full payments and issued credit. Ledger entries are stored in encrypted private ledgers for each individual dairy account. ### D. Buyer Module (City Dairies) * **Self-Registration:**    * Direct onboarding requiring **National Identification Number (NIN)**, phone number, and verified email address. * **Buyer Dashboard:**    * Real-time view of current outstanding credit balance, available credit limit, payment history, and order dispatch statuses. ## 3. Financial & System Governance Layer “` [Platform Admin] —> Sets Credit Limits —> [City Dairy Account]                                                      |                                            Exceeds Credit Cap?                                                      |                                      +—————+—————+                                      |                               |                                   ( YES )                         ( NO )                                      |                               |                         System locks new credit          Order approved by                         & alerts all Suppliers               Milk Man “` * **Dairy Credit Bureau:**    * Central financial tracking body maintaining non-repudiable transaction records platform-wide. * **Platform Administrators:**    * Assign maximum credit caps for each City Dairy.    * **Automated Circuit Breaker:** When a dairy touches or exceeds its credit cap, the platform issues an instant broadcast alert to all Milk Suppliers and locks further credit orders for that account. ## 4. Oversight & Government Dashboards ### A. UNDATA Governance Dashboard * **Quality Assurance:** Direct access to raw testing reports across all MCCs for auditing. * **Policy Monitoring:** Verification that pricing, volume reporting, and testing align with standard industry regulations. * **Dispute Resolution Module:** Structured ticketing system to mediate conflicts between suppliers, loaders, and city dairies. ### B. Ministry of Agriculture (Dairy Department) Dashboard * **Cross-Platform Messaging Suite:**    * *Real-time Chat Channel:* Direct messaging across all platform user categories.    * *Ministerial Broadcast Channel:* Dedicated announcement feed for broadcasting official regulatory directives. * **Reform Analytics:** Macro-level dashboard monitoring daily national milk output, quality trends, and financial health metrics across the dairy sector.