Description
To support the full data exchange lifecycle with RVO EDI-Crop, we need to implement the mutation flow. This allows users to not only read but also create, update, and terminate crop field registrations.
The mutation process is a multi-step asynchronous flow involving several RVO services.
Objectives
- Implement the
MuterenBedrijfspercelen request (CRPRQBM).
- Support polling for processing status via
OpvragenProcesvoortgang.
- Support retrieval of validation results and proposed geometry changes via
OpvragenValidatieresultaat.
- Implement the formalization (commitment) flow using
OphalenTanVolgnummer and FormaliserenOpgave.
- Provide a way to cancel pending requests via
AnnulerenOpgave.
- Automate the transformation of GeoJSON (WGS84) to RVO-compatible GML (RD New).
- Allow users to supply raw GML (RD New) directly if they perform their own transformations.
RVO Flow Overview
- Submit:
MuterenBedrijfspercelen -> returns TicketID.
- Poll:
OpvragenProcesvoortgang(TicketID) -> wait for status GEVALIDEERD (Validation complete) or terminal error.
- Validate:
OpvragenValidatieresultaat(TicketID) -> check for FATAAL or FOUT messages.
- Authorize:
OphalenTanVolgnummer() -> returns SequenceNumber.
- Commit:
FormaliserenOpgave(TicketID, SequenceNumber, TanCode).
Proposed Implementation Tasks
1. Type Definitions (src/types.ts)
2. SOAP Builders (src/soap/builder.ts)
3. Geometry Utilities (src/utils/geometry.ts)
4. Response Transformers (src/transformers/mutation.ts)
5. Client Methods (src/client.ts)
6. Verification & Documentation
Technical Notes
- Namespaces: Ensure each request uses the appropriate RVO namespace (e.g.,
http://www.minez.nl/ws/edicrop/1.0/MuterenBedrijfspercelen).
- Cause Codes: Map Insert/Update to
'A' (Active) and Delete to 'D' (Delete) within the CropFieldCause tag (Request). Note that the Validation Response uses different numeric codes (ChangeTypeCode).
- RD New: Coordinates in the GML must be transformed to EPSG:28992 and formatted with exactly 4 decimals (e.g.,
155000.1234 463000.5678) to meet the 0.1mm precision requirement.
Description
To support the full data exchange lifecycle with RVO EDI-Crop, we need to implement the mutation flow. This allows users to not only read but also create, update, and terminate crop field registrations.
The mutation process is a multi-step asynchronous flow involving several RVO services.
Objectives
MuterenBedrijfspercelenrequest (CRPRQBM).OpvragenProcesvoortgang.OpvragenValidatieresultaat.OphalenTanVolgnummerandFormaliserenOpgave.AnnulerenOpgave.RVO Flow Overview
MuterenBedrijfspercelen-> returnsTicketID.OpvragenProcesvoortgang(TicketID)-> wait for statusGEVALIDEERD(Validation complete) or terminal error.OpvragenValidatieresultaat(TicketID)-> check forFATAALorFOUTmessages.OphalenTanVolgnummer()-> returnsSequenceNumber.FormaliserenOpgave(TicketID, SequenceNumber, TanCode).Proposed Implementation Tasks
1. Type Definitions (
src/types.ts)MutationAction('I', 'U', 'D').CropFieldMutationinterface (properties + geometry OR gml).RvoProcessStatusCodeunion type with all codes from Bijlage D (e.g.,GEVALIDEERD,GEPUBLICEERD).2. SOAP Builders (
src/soap/builder.ts)buildMuterenRequestwith support forFieldandCropFieldnesting.gml(raw) andgeometry(convert).CRPRQBM,CRPRQPV,CRPRQFB,CRPRQOT,CRPRQAN).3. Geometry Utilities (
src/utils/geometry.ts)transformCoordinatesToRD(WGS84 to EPSG:28992).convertGeoJSONToGMLto generate RVO-compliant XML snippets for Polygons and MultiPolygons.4. Response Transformers (
src/transformers/mutation.ts)5. Client Methods (
src/client.ts)muterenBedrijfspercelen(options)opvragenProcesvoortgang(ticketId)opvragenValidatieresultaat(ticketId)ophalenTanVolgnummer(farmId?)formaliserenOpgave(ticketId, sequenceNumber, tanCode)annulerenOpgave(ticketId)6. Verification & Documentation
examples/mutate-bedrijfspercelen-tvs.ts).Technical Notes
http://www.minez.nl/ws/edicrop/1.0/MuterenBedrijfspercelen).'A'(Active) and Delete to'D'(Delete) within theCropFieldCausetag (Request). Note that the Validation Response uses different numeric codes (ChangeTypeCode).155000.1234 463000.5678) to meet the 0.1mm precision requirement.