Module 7
EUDR Compliance & Reporting
Purpose#
Aggregates data from all other SMS modules to compute a per-farmer EUDR compliance status and generate report outputs suitable for Due Diligence Statement (DDS) submission. This module is read-only with respect to all other modules — it aggregates, never modifies, source data.
Downstream dependency
This module must be built last among feature modules. It depends on all five modules (1–6) having data to aggregate. Design the compliance record as a cache that can be recomputed on demand.
5 compliance conditions#
A farmer is compliant when all five conditions are met. Partial compliance means some conditions pass. Non-compliant means none or critically few pass.
| # | Condition | Description | Source module |
|---|---|---|---|
| 1 | identity_verified | Farmer record has a verified national ID (Ghana Card or CNI) and a photo. | Farmer Registry |
| 2 | farm_mapped | At least one farm with at least one plot polygon (or centroid for ≤ 4ha) has been captured. | Farm Mapping |
| 3 | risk_assessed | A deforestation risk assessment has been completed for all plots. | Deforestation Risk |
| 4 | risk_cleared | All assessed plots have a risk level of low or medium (or a valid approved override). | Deforestation Risk |
| 5 | baseline_survey_completed | A Farmer Baseline survey response has been submitted for this farmer. | Survey System |
Compliance status values#
| Status | Meaning |
|---|---|
| compliant | All 5 conditions pass. Farmer is EUDR-eligible. |
| partial | Some conditions pass but not all. Action required before DDS. |
| non_compliant | No conditions pass, or a critical condition (risk_cleared) fails. Farmer cannot be included in a DDS. |
Report outputs#
| Format | Primary use |
|---|---|
| Human-readable compliance report. Includes farmer details, map thumbnails, and assessment summaries. | |
| CSV | Machine-readable bulk export. All farmers with their compliance status and condition breakdown. |
| GeoJSON | Geospatial export of all farm polygons with compliance attributes. For GIS tools and DDS submissions. |
| JSON | Structured data export for EU Trade Single Window (DDS) submission format. |
Audit log#
The compliance module owns an append-only cross-module audit log. Every significant data change across SMS (farmer status change, polygon edit, risk override, survey completion, remediation update) writes an entry to the audit log. Entries are:
- →Immutable — cannot be deleted or updated.
- →Scoped to org_id (multi-tenant isolation).
- →Include: event type, entity ID, actor (Clerk user ID), timestamp, before/after values.
- →Included in EUDR evidence packages.
- →Viewable by District Managers and above.
Packages#
| Package | Type | Key exports |
|---|---|---|
@repo/feature-eudr-compliance | Backend | Services: compliance-record, report-generator, audit-log, evidence-package |
@repo/feature-eudr-compliance-web | Frontend | Compliance status table, report download UI, evidence package builder |
@repo/eudr-compliance-contracts | Shared | ComplianceStatus type, ComplianceCondition type, DDS report schema |
API routes#
| Route | Notes |
|---|---|
| /api/compliance | Read compliance records; trigger recompute. |
| /api/audit-log | Read audit log entries by org, farmer, or event type. |