openapi: 3.1.0 info: title: ACM Farm Service API description: API documentation for ACM Farm Service license: name: Apache 2.0 url: https://springdoc.org version: 1.0.0 servers: - url: http://localhost description: Generated server url security: - bearerAuth: [] tags: - name: Address description: Address lookup and import operations paths: /api/v1/plots/{id}: get: tags: - plot-controller operationId: getPlot parameters: - name: id in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponsePlotResponse" put: tags: - plot-controller operationId: updatePlot parameters: - name: id in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: "#/components/schemas/PlotRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponsePlotResponse" delete: tags: - plot-controller operationId: deletePlot parameters: - name: id in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseVoid" /api/v1/farms/{farmId}: get: tags: - farm-controller operationId: getFarmDetail parameters: - name: farmId in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseFarmResponse" put: tags: - farm-controller operationId: updateFarm parameters: - name: farmId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: "#/components/schemas/FarmUpdateRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseFarmResponse" delete: tags: - farm-controller operationId: deleteFarm parameters: - name: farmId in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseString" /api/v1/farms/{farmId}/certification/scope: put: tags: - certification-controller operationId: updateScope parameters: - name: farmId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: "#/components/schemas/UpdateCertificationScopesRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseListCertificationScopeResponse" /api/v1/farms/{farmId}/certification/items/{itemId}: put: tags: - certification-controller operationId: updateItemStatus parameters: - name: farmId in: path required: true schema: type: integer format: int32 - name: itemId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: "#/components/schemas/UpdateCertificationItemRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseString" /api/v1/certification-corrective-actions/{actionId}: put: tags: - certification-audit-controller operationId: updateCorrectiveAction parameters: - name: actionId in: path required: true schema: type: integer format: int64 requestBody: content: application/json: schema: $ref: "#/components/schemas/CreateCorrectiveActionRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseCorrectiveActionResponse" /api/v1/certification-corrective-actions/{actionId}/review: put: tags: - certification-audit-controller operationId: reviewCorrectiveAction parameters: - name: actionId in: path required: true schema: type: integer format: int64 requestBody: content: application/json: schema: $ref: "#/components/schemas/ReviewCorrectiveActionRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseCorrectiveActionResponse" /api/v1/certification-audits/{auditId}/start: put: tags: - certification-audit-controller operationId: startAudit parameters: - name: auditId in: path required: true schema: type: integer format: int64 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseCertificationAuditResponse" /api/v1/certification-audits/{auditId}/complete: put: tags: - certification-audit-controller operationId: completeAudit parameters: - name: auditId in: path required: true schema: type: integer format: int64 requestBody: content: application/json: schema: $ref: "#/components/schemas/CompleteAuditRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseCertificationAuditResponse" /api/v1/plots: get: tags: - plot-controller operationId: listAllPlots responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseListPlotResponse" post: tags: - plot-controller operationId: createPlotForCurrentFarmer requestBody: content: application/json: schema: $ref: "#/components/schemas/PlotRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponsePlotResponse" /api/v1/plots/bulk-geojson: post: tags: - plot-geo-json-controller operationId: getBulkPlotGeoJson requestBody: content: application/json: schema: type: array items: type: integer format: int64 required: true responses: "200": description: OK content: '*/*': schema: type: object additionalProperties: $ref: "#/components/schemas/PlotGeoJsonDto" /api/v1/internal/plots/bulk: post: tags: - internal-plot-controller operationId: getBulkPlots requestBody: content: application/json: schema: type: array items: type: integer format: int64 required: true responses: "200": description: OK content: '*/*': schema: type: object additionalProperties: $ref: "#/components/schemas/PlotInternalDto" /api/v1/internal/farms/batch: post: tags: - internal-farm-controller operationId: getFarmsByIds requestBody: content: application/json: schema: type: array items: type: integer format: int32 required: true responses: "200": description: OK content: '*/*': schema: type: array items: $ref: "#/components/schemas/FarmSummaryDto" /api/v1/farms: get: tags: - farm-controller operationId: getMyFarms parameters: - name: keyword in: query required: false schema: type: string - name: active in: query required: false schema: type: boolean - name: page in: query required: false schema: type: integer format: int32 - name: size in: query required: false schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseObject" post: tags: - farm-controller operationId: createFarm requestBody: content: application/json: schema: $ref: "#/components/schemas/FarmCreateRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseFarmResponse" /api/v1/farms/{farmId}/plots: get: tags: - plot-controller operationId: listPlotsByFarm parameters: - name: farmId in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseListPlotResponse" post: tags: - plot-controller operationId: createPlot parameters: - name: farmId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: "#/components/schemas/PlotRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponsePlotResponse" /api/v1/farms/{farmId}/documents: get: tags: - farm-document-controller operationId: list parameters: - name: farmId in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseListFarmDocumentResponse" post: tags: - farm-document-controller operationId: create parameters: - name: farmId in: path required: true schema: type: integer format: int32 - name: X-User-Id in: header required: false schema: type: integer format: int64 requestBody: content: application/json: schema: $ref: "#/components/schemas/FarmDocumentCreateRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseFarmDocumentResponse" /api/v1/farms/{farmId}/documents/upload: post: tags: - farm-document-controller operationId: upload parameters: - name: farmId in: path required: true schema: type: integer format: int32 - name: X-User-Id in: header required: false schema: type: integer format: int64 requestBody: content: application/json: schema: type: object properties: file: type: string format: binary required: - file responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseString" /api/v1/farms/{farmId}/certification/issue: post: tags: - certification-audit-controller operationId: issueCertificate parameters: - name: farmId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: "#/components/schemas/IssueCertificateRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseString" /api/v1/farms/{farmId}/certification/export-dossier: post: tags: - certification-controller operationId: exportDossier parameters: - name: farmId in: path required: true schema: type: integer format: int32 - name: X-User-Id in: header required: false schema: type: integer format: int64 - name: diaryClientProvider in: query required: true schema: $ref: "#/components/schemas/ObjectProviderSeasonProductionDiaryClient" - name: documentServiceProvider in: query required: true schema: $ref: "#/components/schemas/ObjectProviderFarmDocumentService" - name: currentUserServiceProvider in: query required: true schema: $ref: "#/components/schemas/ObjectProviderCurrentUserService" requestBody: content: application/json: schema: $ref: "#/components/schemas/ExportDossierRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseFarmDocumentResponse" /api/v1/farms/{farmId}/certification/audits: get: tags: - certification-audit-controller operationId: getAudits parameters: - name: farmId in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseListCertificationAuditResponse" post: tags: - certification-audit-controller operationId: scheduleAudit parameters: - name: farmId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: "#/components/schemas/CreateAuditRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseCertificationAuditResponse" /api/v1/farms/{farmId}/certification/apply: post: tags: - certification-controller operationId: applyCertification parameters: - name: farmId in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseString" /api/v1/certification-nonconformities/{nonconformityId}/corrective-actions: post: tags: - certification-audit-controller operationId: createCorrectiveAction parameters: - name: nonconformityId in: path required: true schema: type: integer format: int64 requestBody: content: application/json: schema: $ref: "#/components/schemas/CreateCorrectiveActionRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseCorrectiveActionResponse" /api/v1/certification-corrective-actions/{actionId}/submit: post: tags: - certification-audit-controller operationId: submitCorrectiveAction parameters: - name: actionId in: path required: true schema: type: integer format: int64 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseCorrectiveActionResponse" /api/v1/certification-audits/{auditId}/nonconformities: post: tags: - certification-audit-controller operationId: recordNonconformity parameters: - name: auditId in: path required: true schema: type: integer format: int64 requestBody: content: application/json: schema: $ref: "#/components/schemas/CreateNonconformityRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseNonconformityResponse" /api/v1/admin/farms/{farmId}/documents/{documentId}/verify: patch: tags: - certification-audit-controller operationId: verifyDocument parameters: - name: farmId in: path required: true schema: type: integer format: int32 - name: documentId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: "#/components/schemas/VerifyDocumentRequest" required: true responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseString" /api/v1/locations/wards: get: tags: - location-controller operationId: getWardsByProvince parameters: - name: provinceId in: query required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: type: array items: $ref: "#/components/schemas/WardResponse" /api/v1/locations/provinces: get: tags: - location-controller operationId: getAllProvinces responses: "200": description: OK content: '*/*': schema: type: array items: $ref: "#/components/schemas/ProvinceResponse" /api/v1/internal/users/{userId}/farms/ids: get: tags: - internal-plot-controller operationId: getFarmIdsByUserId parameters: - name: userId in: path required: true schema: type: integer format: int64 responses: "200": description: OK content: '*/*': schema: type: array items: type: integer format: int32 /api/v1/internal/plots/{id}: get: tags: - internal-plot-controller operationId: getPlotInternal parameters: - name: id in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/PlotInternalDto" /api/v1/internal/farms/{farmId}: get: tags: - internal-farm-controller operationId: getFarmDetail_1 parameters: - name: farmId in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/FarmDetailDto" /api/v1/internal/farms/{farmId}/certification: get: tags: - internal-farm-controller operationId: getFarmCertification parameters: - name: farmId in: path required: true schema: type: integer format: int32 - name: standardCode in: query required: false schema: type: string default: VIETGAP-PLANTING-2026 - name: seasonId in: query required: false schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/CertificationInfoDto" /api/v1/farms/{farmId}/documents/expiring: get: tags: - farm-document-controller operationId: expiring parameters: - name: farmId in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseListFarmDocumentResponse" /api/v1/farms/{farmId}/certification: get: tags: - certification-controller operationId: getCertificationDetails parameters: - name: farmId in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseCertificationDetailsResponse" /api/v1/farms/{farmId}/certification/nonconformities: get: tags: - certification-audit-controller operationId: getNonconformities parameters: - name: farmId in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseListNonconformityResponse" /api/v1/admin/certification-audits: get: tags: - certification-audit-controller operationId: getAllAudits responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseListCertificationAuditResponse" /api/v1/admin/certification-applications: get: tags: - certification-audit-controller operationId: getApplications responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseListCertificationApplicationResponse" /api/v1/addresses/wards/{id}: get: tags: - Address summary: Get ward by ID description: Get a single ward by its ID operationId: getWard parameters: - name: id in: path required: true schema: type: integer format: int32 responses: "200": description: Success content: '*/*': schema: $ref: "#/components/schemas/ApiResponseWardResponse" "404": description: Ward not found content: '*/*': schema: $ref: "#/components/schemas/ApiResponseWardResponse" /api/v1/addresses/stats: get: tags: - Address summary: Get address statistics description: "Get count of countries, provinces, and wards" operationId: getStats responses: "200": description: Success content: '*/*': schema: $ref: "#/components/schemas/ApiResponseAddressStats" /api/v1/addresses/provinces: get: tags: - Address summary: List all provinces description: Get list of all provinces with optional filters operationId: listProvinces parameters: - name: keyword in: query description: Optional keyword to search by province name required: false schema: type: string - name: type in: query description: "Optional type filter: 'thanh-pho' (city) or 'tinh' (province)" required: false schema: type: string responses: "200": description: Success content: '*/*': schema: $ref: "#/components/schemas/ApiResponseListProvinceResponse" /api/v1/addresses/provinces/{provinceId}/wards: get: tags: - Address summary: List wards by province description: Get list of wards for a specific province operationId: listWardsByProvince parameters: - name: provinceId in: path required: true schema: type: integer format: int32 - name: keyword in: query description: Optional keyword to search by ward name required: false schema: type: string responses: "200": description: Success content: '*/*': schema: $ref: "#/components/schemas/ApiResponseListWardResponse" "404": description: Province not found content: '*/*': schema: $ref: "#/components/schemas/ApiResponseListWardResponse" /api/v1/addresses/provinces/{id}: get: tags: - Address summary: Get province by ID description: Get a single province by its ID operationId: getProvince parameters: - name: id in: path required: true schema: type: integer format: int32 responses: "200": description: Success content: '*/*': schema: $ref: "#/components/schemas/ApiResponseProvinceResponse" "404": description: Province not found content: '*/*': schema: $ref: "#/components/schemas/ApiResponseProvinceResponse" /api/v1/farms/{farmId}/documents/{id}: delete: tags: - farm-document-controller operationId: delete parameters: - name: farmId in: path required: true schema: type: integer format: int32 - name: id in: path required: true schema: type: integer format: int32 responses: "200": description: OK content: '*/*': schema: $ref: "#/components/schemas/ApiResponseVoid" components: schemas: Coordinate: type: object properties: x: type: number format: double "y": type: number format: double z: type: number format: double valid: type: boolean coordinate: $ref: "#/components/schemas/Coordinate" m: type: number format: double CoordinateSequence: type: object properties: dimension: type: integer format: int32 measures: type: integer format: int32 CoordinateSequenceFactory: type: object Envelope: type: object properties: "null": type: boolean diameter: type: number format: double width: type: number format: double area: type: number format: double height: type: number format: double maxX: type: number format: double minX: type: number format: double minY: type: number format: double maxY: type: number format: double Geometry: type: object properties: envelope: $ref: "#/components/schemas/Geometry" factory: $ref: "#/components/schemas/GeometryFactory" userData: type: object length: type: number format: double empty: type: boolean valid: type: boolean simple: type: boolean precisionModel: $ref: "#/components/schemas/PrecisionModel" interiorPoint: $ref: "#/components/schemas/Point" numPoints: type: integer format: int32 boundary: $ref: "#/components/schemas/Geometry" coordinates: type: array items: $ref: "#/components/schemas/Coordinate" centroid: $ref: "#/components/schemas/Point" coordinate: $ref: "#/components/schemas/Coordinate" rectangle: type: boolean numGeometries: type: integer format: int32 dimension: type: integer format: int32 geometryType: type: string srid: type: integer format: int32 area: type: number format: double boundaryDimension: type: integer format: int32 envelopeInternal: $ref: "#/components/schemas/Envelope" GeometryFactory: type: object properties: precisionModel: $ref: "#/components/schemas/PrecisionModel" coordinateSequenceFactory: $ref: "#/components/schemas/CoordinateSequenceFactory" srid: type: integer format: int32 PlotRequest: type: object properties: userId: type: integer format: int64 farmId: type: integer format: int32 plotName: type: string area: type: number minimum: 0.0 soilType: type: string boundaryGeoJson: type: string parentPlotId: type: integer format: int32 polygon: $ref: "#/components/schemas/Geometry" status: type: string enum: - AVAILABLE - ACTIVE - IN_USE - IDLE - FALLOW - MAINTENANCE required: - plotName Point: type: object properties: envelope: $ref: "#/components/schemas/Geometry" factory: $ref: "#/components/schemas/GeometryFactory" userData: type: object coordinates: type: array items: $ref: "#/components/schemas/Coordinate" empty: type: boolean "y": type: number format: double x: type: number format: double simple: type: boolean numPoints: type: integer format: int32 boundary: $ref: "#/components/schemas/Geometry" coordinate: $ref: "#/components/schemas/Coordinate" dimension: type: integer format: int32 geometryType: type: string boundaryDimension: type: integer format: int32 coordinateSequence: $ref: "#/components/schemas/CoordinateSequence" length: type: number format: double valid: type: boolean precisionModel: $ref: "#/components/schemas/PrecisionModel" interiorPoint: $ref: "#/components/schemas/Point" centroid: $ref: "#/components/schemas/Point" rectangle: type: boolean numGeometries: type: integer format: int32 srid: type: integer format: int32 area: type: number format: double envelopeInternal: $ref: "#/components/schemas/Envelope" PrecisionModel: type: object properties: scale: type: number format: double type: $ref: "#/components/schemas/Type" floating: type: boolean maximumSignificantDigits: type: integer format: int32 offsetY: type: number format: double offsetX: type: number format: double Type: type: object ApiResponsePlotResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: $ref: "#/components/schemas/PlotResponse" data: $ref: "#/components/schemas/PlotResponse" generatedAt: type: string PlotResponse: type: object properties: id: type: integer format: int32 farmId: type: integer format: int32 farmName: type: string plotName: type: string area: type: number soilType: type: string boundaryGeoJson: type: string parentPlotId: type: integer format: int32 status: type: string enum: - AVAILABLE - ACTIVE - IN_USE - IDLE - FALLOW - MAINTENANCE FarmUpdateRequest: type: object properties: name: type: string provinceId: type: integer format: int32 wardId: type: integer format: int32 area: type: number minimum: 0.0 latitude: type: number maximum: 90.0 minimum: -90.0 longitude: type: number maximum: 180.0 minimum: -180.0 active: type: boolean ApiResponseFarmResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: $ref: "#/components/schemas/FarmResponse" data: $ref: "#/components/schemas/FarmResponse" generatedAt: type: string FarmResponse: type: object properties: id: type: integer format: int32 farmName: type: string name: type: string ownerUsername: type: string userId: type: integer format: int64 provinceId: type: integer format: int32 provinceName: type: string wardId: type: integer format: int32 wardName: type: string area: type: number latitude: type: number longitude: type: number active: type: boolean ScopeItem: type: object properties: seasonId: type: integer format: int32 registeredAreaHa: type: number minimum: 0.0001 required: - registeredAreaHa - seasonId UpdateCertificationScopesRequest: type: object properties: scopes: type: array items: $ref: "#/components/schemas/ScopeItem" maxItems: 50 minItems: 0 required: - scopes ApiResponseListCertificationScopeResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: type: array items: $ref: "#/components/schemas/CertificationScopeResponse" data: type: array items: $ref: "#/components/schemas/CertificationScopeResponse" generatedAt: type: string CertificationScopeResponse: type: object properties: id: type: integer format: int32 seasonId: type: integer format: int32 plotId: type: integer format: int32 plotName: type: string cropId: type: integer format: int32 cropName: type: string varietyId: type: integer format: int32 varietyName: type: string registeredAreaHa: type: number expectedYieldKg: type: number UpdateCertificationItemRequest: type: object properties: status: type: string evidenceUrl: type: string notes: type: string ApiResponseString: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: type: string data: type: string generatedAt: type: string CreateCorrectiveActionRequest: type: object properties: planDescription: type: string evidenceUrls: type: array items: type: string appliesFromSeasonId: type: integer format: int32 ApiResponseCorrectiveActionResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: $ref: "#/components/schemas/CorrectiveActionResponse" data: $ref: "#/components/schemas/CorrectiveActionResponse" generatedAt: type: string CorrectiveActionResponse: type: object properties: id: type: integer format: int64 nonconformityId: type: integer format: int64 planDescription: type: string evidenceUrls: type: array items: type: string appliesFromSeasonId: type: integer format: int32 submittedByUserId: type: integer format: int64 submittedAt: type: string format: date-time reviewedByUserId: type: integer format: int64 reviewResult: type: string reviewNote: type: string reviewedAt: type: string format: date-time createdAt: type: string format: date-time ReviewCorrectiveActionRequest: type: object properties: result: type: string reviewNote: type: string required: - result ApiResponseCertificationAuditResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: $ref: "#/components/schemas/CertificationAuditResponse" data: $ref: "#/components/schemas/CertificationAuditResponse" generatedAt: type: string CertificationAuditResponse: type: object properties: id: type: integer format: int64 recordId: type: integer format: int32 farmId: type: integer format: int32 farmName: type: string standardCode: type: string complianceScore: type: number recordStatus: type: string auditType: type: string scheduledDate: type: string format: date auditorUserId: type: integer format: int64 auditorOrgName: type: string status: type: string interviewNotes: type: string sampleCollectionNotes: type: string conductedAt: type: string format: date-time createdAt: type: string format: date-time nonconformities: type: array items: $ref: "#/components/schemas/NonconformityResponse" NonconformityResponse: type: object properties: id: type: integer format: int64 auditId: type: integer format: int64 checklistItemId: type: integer format: int32 severity: type: string description: type: string status: type: string createdAt: type: string format: date-time correctiveActions: type: array items: $ref: "#/components/schemas/CorrectiveActionResponse" CompleteAuditRequest: type: object properties: result: type: string interviewNotes: type: string sampleCollectionNotes: type: string required: - result PlotGeoJsonDto: type: object properties: plotId: type: integer format: int64 plotName: type: string boundary: type: object additionalProperties: type: object PlotInternalDto: type: object properties: id: type: integer format: int32 plotName: type: string plotArea: type: number farmId: type: integer format: int32 farmName: type: string ownerUserId: type: integer format: int64 farmActive: type: boolean FarmSummaryDto: type: object properties: id: type: integer format: int32 name: type: string provinceName: type: string wardName: type: string area: type: number FarmCreateRequest: type: object properties: farmName: type: string provinceId: type: integer format: int32 wardId: type: integer format: int32 area: type: number minimum: 0.0 latitude: type: number maximum: 90.0 minimum: -90.0 longitude: type: number maximum: 180.0 minimum: -180.0 active: type: boolean required: - area - farmName - provinceId - wardId FarmDocumentCreateRequest: type: object properties: title: type: string documentType: type: string description: type: string fileUrl: type: string issuedDate: type: string format: date expiryDate: type: string format: date required: - documentType - title ApiResponseFarmDocumentResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: $ref: "#/components/schemas/FarmDocumentResponse" data: $ref: "#/components/schemas/FarmDocumentResponse" generatedAt: type: string FarmDocumentResponse: type: object properties: id: type: integer format: int32 farmId: type: integer format: int32 documentType: type: string documentTypeLabel: type: string title: type: string description: type: string fileUrl: type: string issuedDate: type: string format: date expiryDate: type: string format: date isExpired: type: boolean isExpiringSoon: type: boolean verificationStatus: type: string verifiedByName: type: string createdAt: type: string format: date-time updatedAt: type: string format: date-time IssueCertificateRequest: type: object properties: certificateNumber: type: string issuedDate: type: string format: date expiryDate: type: string format: date certificateDocumentId: type: integer format: int32 required: - certificateNumber - expiryDate - issuedDate ExportDossierRequest: type: object properties: seasonIds: type: array items: type: integer format: int32 ObjectProviderSeasonProductionDiaryClient: type: object properties: object: $ref: "#/components/schemas/SeasonProductionDiaryClient" ifUnique: $ref: "#/components/schemas/SeasonProductionDiaryClient" ifAvailable: $ref: "#/components/schemas/SeasonProductionDiaryClient" SeasonProductionDiaryClient: type: object FarmDocumentService: type: object ObjectProviderFarmDocumentService: type: object properties: object: $ref: "#/components/schemas/FarmDocumentService" ifUnique: $ref: "#/components/schemas/FarmDocumentService" ifAvailable: $ref: "#/components/schemas/FarmDocumentService" CurrentUserService: type: object properties: currentUserId: type: integer format: int64 currentRole: type: string currentUserFullName: type: string ObjectProviderCurrentUserService: type: object properties: object: $ref: "#/components/schemas/CurrentUserService" ifUnique: $ref: "#/components/schemas/CurrentUserService" ifAvailable: $ref: "#/components/schemas/CurrentUserService" CreateAuditRequest: type: object properties: auditType: type: string scheduledDate: type: string format: date auditorUserId: type: integer format: int64 auditorOrgName: type: string required: - auditType - scheduledDate CreateNonconformityRequest: type: object properties: checklistItemId: type: integer format: int32 severity: type: string description: type: string required: - description - severity ApiResponseNonconformityResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: $ref: "#/components/schemas/NonconformityResponse" data: $ref: "#/components/schemas/NonconformityResponse" generatedAt: type: string VerifyDocumentRequest: type: object properties: status: type: string note: type: string required: - status ApiResponseListPlotResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: type: array items: $ref: "#/components/schemas/PlotResponse" data: type: array items: $ref: "#/components/schemas/PlotResponse" generatedAt: type: string WardResponse: type: object properties: id: type: integer format: int32 name: type: string slug: type: string type: type: string nameWithType: type: string provinceId: type: integer format: int32 ProvinceResponse: type: object properties: id: type: integer format: int32 name: type: string slug: type: string type: type: string nameWithType: type: string FarmDetailDto: type: object properties: id: type: integer format: int32 name: type: string provinceName: type: string wardName: type: string area: type: number latitude: type: number longitude: type: number averageRating: type: number format: double userId: type: integer format: int64 CertificationInfoDto: type: object properties: certificationName: type: string certificationType: type: string status: type: string issuedDate: type: string format: date expiryDate: type: string format: date complianceScore: type: number certificateNumber: type: string scopeMatched: type: boolean scopes: type: array items: $ref: "#/components/schemas/CertificationScopeResponse" missingMandatoryEvidenceCount: type: integer format: int32 missingEvidenceItems: type: array items: $ref: "#/components/schemas/MissingEvidenceItem" MissingEvidenceItem: type: object properties: itemCode: type: string category: type: string description: type: string ApiResponseObject: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: type: object data: type: object generatedAt: type: string ApiResponseListFarmDocumentResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: type: array items: $ref: "#/components/schemas/FarmDocumentResponse" data: type: array items: $ref: "#/components/schemas/FarmDocumentResponse" generatedAt: type: string ApiResponseCertificationDetailsResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: $ref: "#/components/schemas/CertificationDetailsResponse" data: $ref: "#/components/schemas/CertificationDetailsResponse" generatedAt: type: string CertificationDetailsResponse: type: object properties: recordId: type: integer format: int32 farmId: type: integer format: int32 standardCode: type: string standardName: type: string complianceScore: type: number status: type: string appliedAt: type: string format: date-time certifiedAt: type: string format: date-time expiryDate: type: string format: date auditorNotes: type: string scopes: type: array items: $ref: "#/components/schemas/CertificationScopeResponse" items: type: array items: $ref: "#/components/schemas/CertificationItemDetail" isEligible: type: boolean certificateNumber: type: string nextPeriodicReviewDate: type: string format: date publishedAt: type: string format: date-time missingMandatoryEvidenceCount: type: integer format: int32 missingEvidenceItems: type: array items: $ref: "#/components/schemas/MissingEvidenceItem" CertificationItemDetail: type: object properties: id: type: integer format: int32 itemCode: type: string category: type: string description: type: string isMandatory: type: boolean weightPct: type: number dataSourceType: type: string dataSourceQuery: type: string status: type: string evidenceUrl: type: string notes: type: string checkedAt: type: string format: date-time ApiResponseListNonconformityResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: type: array items: $ref: "#/components/schemas/NonconformityResponse" data: type: array items: $ref: "#/components/schemas/NonconformityResponse" generatedAt: type: string ApiResponseListCertificationAuditResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: type: array items: $ref: "#/components/schemas/CertificationAuditResponse" data: type: array items: $ref: "#/components/schemas/CertificationAuditResponse" generatedAt: type: string ApiResponseListCertificationApplicationResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: type: array items: $ref: "#/components/schemas/CertificationApplicationResponse" data: type: array items: $ref: "#/components/schemas/CertificationApplicationResponse" generatedAt: type: string CertificationApplicationResponse: type: object properties: recordId: type: integer format: int32 farmId: type: integer format: int32 farmName: type: string standardCode: type: string standardName: type: string scopes: type: array items: $ref: "#/components/schemas/CertificationScopeResponse" complianceScore: type: number status: type: string appliedAt: type: string format: date-time nextPeriodicReviewDate: type: string format: date expiryDate: type: string format: date ApiResponseWardResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: $ref: "#/components/schemas/WardResponse" data: $ref: "#/components/schemas/WardResponse" generatedAt: type: string AddressStats: type: object properties: provinceCount: type: integer format: int64 wardCount: type: integer format: int64 ApiResponseAddressStats: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: $ref: "#/components/schemas/AddressStats" data: $ref: "#/components/schemas/AddressStats" generatedAt: type: string ApiResponseListProvinceResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: type: array items: $ref: "#/components/schemas/ProvinceResponse" data: type: array items: $ref: "#/components/schemas/ProvinceResponse" generatedAt: type: string ApiResponseListWardResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: type: array items: $ref: "#/components/schemas/WardResponse" data: type: array items: $ref: "#/components/schemas/WardResponse" generatedAt: type: string ApiResponseProvinceResponse: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: $ref: "#/components/schemas/ProvinceResponse" data: $ref: "#/components/schemas/ProvinceResponse" generatedAt: type: string ApiResponseVoid: type: object properties: status: type: integer format: int32 code: type: string message: type: string result: type: object data: type: object generatedAt: type: string securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT