# AGNET API E2E Flow Report

Generated: 2026-06-27T16:03:53.308Z

## Summary

| Metric | Count |
|--------|-------|
| Passed | 10 |
| Failed | 0 |
| Skipped | 2 |

## Execution Log

| Step | Phase | Method | Path | Status | ms |
|------|-------|--------|------|--------|-----|
| F01 | auth | POST | /api/auth/otp | pass | 1 |
| F02 | auth | POST | /api/auth/verify | pass | 0 |
| F03 | auth | GET | /api/auth/me | pass | 0 |
| F04 | onboarding | POST | /api/onboarding | pass | 0 |
| F05 | onboarding | GET | /api/onboarding/{id} | pass | 0 |
| F06 | onboarding | PATCH | /api/onboarding/{id}/steps/{step} | pass | 1 |
| F07 | onboarding | POST | /api/onboarding/{id}/submit | pass | 0 |
| F08 | scoring | GET | /api/onboarding/{id}/status | pass | 1 |
| F09 | scoring | GET | /api/scoring/satellite-image | pass | 0 |
| F11 | reference | GET | /api/reference/options | pass | 1 |
| F14 | internal | GET | worker:/api/model-status | skip | 0 |
| F13 | internal | POST | worker:/api/analyze | skip | 0 |

## DB ↔ API Sync Matrix

| DB | API | Transform |
|----|-----|-----------|
| ScoringRun.totalScore | OnboardingStatusResponse.score | 0–1000 integer |
| ScoringRun.decision | OnboardingStatusResponse.eligibilityOutcome | eligible|conditional|not_eligible |
| ScoringRun.rulesResult.reasonCodes | OnboardingStatusResponse.reasonCodes | RC_* array |
| ScoringRun.rulesResult.scoringMeta | OnboardingStatusResponse.scoringMeta | nested object |
| FinanceCase.publicCaseId | OnboardingStatusResponse.financeCaseId | AGN-FIN-* |
| FinanceCase.status | OnboardingStatusResponse.financeCaseStatus | enum |
| OnboardingSession.stepData.SCORING | StepScoringData | wizard persist |
| ScoringAudit.inputSnapshotHash | — | SHA-256 of stepData (immutable) |
| ScoringAudit.outputSnapshot | scoringMeta (redacted) | append-only audit |
| FinanceCase.notes (JSON) | FinanceModule.riskPd/riskRating | dashboard enrich |
| FarmerProfile.publicFarmerId | identity.farmerId | AGID-FMR-* |
| FarmerProfile.displayName | identity.farmName | string |
| KycRecord.photoUrl | identity.ekyc.photoUrl | uri |
| KycRecord.dob | identity.ekyc.dob | YYYY-MM-DD |
| KycRecord.pinflMasked | identity.ekyc.aadhaarMasked | masked PII |
| User.phone | identity.ekyc.mobileMasked | masked phone |
| LandParcel.geometry | identity.gis.polygonGeoJson | GeoJSON Polygon |
| LandParcel.areaHa | identity.gis.areaHa | number |
| LandParcel.centroid | identity.gis.lat/lng | WGS84 |
| Document[] (land) | identity.landEvidence[] | name,type,verified |
| YieldHistory | identity.yieldHistory[] | year,yieldTHa,crop |
| EligibilityRuleResult[] | identity.compliance[] | key,label,passed |
| ScoringRun.totalScore | finance.eligibilityScore | normalized /100 |
| FinanceCase.routedInstitution | finance.routedInstitution | name,priority,isBestMatch |
| FinanceCase.slaDueAt | finance.sla | remainingHours,totalHours,dueAt |
| InstitutionMatch[] | finance.bankMatches[] | name,score,status |
| Document[] (finance) | finance.documents[] | name,status |
| FinanceCase.statusHistory | finance.stages[] | label,completed |
| CatalogAggregate | inputs.kpis | seed,fertiliser,equipment,vouchers,inTransit |
| Supplier.rating | inputs.suppliers[] | name,logoUrl,rating |
| ProductCatalog | inputs.catalog[] | category,items |
| InputVoucher | inputs.voucher | VoucherDetail |
| DeliveryShipment | inputs.delivery | DeliveryTracking |