ASAgriSense/Docs/EUDR Compliance

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.

#ConditionDescriptionSource module
1identity_verifiedFarmer record has a verified national ID (Ghana Card or CNI) and a photo.Farmer Registry
2farm_mappedAt least one farm with at least one plot polygon (or centroid for ≤ 4ha) has been captured.Farm Mapping
3risk_assessedA deforestation risk assessment has been completed for all plots.Deforestation Risk
4risk_clearedAll assessed plots have a risk level of low or medium (or a valid approved override).Deforestation Risk
5baseline_survey_completedA Farmer Baseline survey response has been submitted for this farmer.Survey System

Compliance status values#

StatusMeaning
compliantAll 5 conditions pass. Farmer is EUDR-eligible.
partialSome conditions pass but not all. Action required before DDS.
non_compliantNo conditions pass, or a critical condition (risk_cleared) fails. Farmer cannot be included in a DDS.

Report outputs#

FormatPrimary use
PDFHuman-readable compliance report. Includes farmer details, map thumbnails, and assessment summaries.
CSVMachine-readable bulk export. All farmers with their compliance status and condition breakdown.
GeoJSONGeospatial export of all farm polygons with compliance attributes. For GIS tools and DDS submissions.
JSONStructured 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#

PackageTypeKey exports
@repo/feature-eudr-complianceBackendServices: compliance-record, report-generator, audit-log, evidence-package
@repo/feature-eudr-compliance-webFrontendCompliance status table, report download UI, evidence package builder
@repo/eudr-compliance-contractsSharedComplianceStatus type, ComplianceCondition type, DDS report schema

API routes#

RouteNotes
/api/complianceRead compliance records; trigger recompute.
/api/audit-logRead audit log entries by org, farmer, or event type.