requestDyna
@nmi-agro/fdm-source / fdm-calculator/src / requestDyna
Function: requestDyna()
requestDyna(
input):Promise<DynaResult>
Defined in: fdm-calculator/src/mineralization/dyna.ts:66
Calls POST /bemestingsplan/dyna with the pre-built request body and
returns the parsed DYNA simulation result as a DynaResult.
This is the uncached version. In most cases you should use getDyna
which adds DB-backed caching via withCalculationCache.
The response body uses snake_case field names which are transformed to
camelCase by dynaResponseDataSchema during validation.
Error handling:
| HTTP status | Thrown error |
|---|---|
| 400 | NmiApiError(400, "Er is een fout opgetreden bij de DYNA-berekening. ...") — e.g. duplicate year or missing b_lu |
| 422 | NmiApiError(422, "Onvoldoende gegevens voor DYNA-berekening.") |
| 503 | NmiApiError(503, "NMI API is tijdelijk niet beschikbaar.") |
| other 4xx/5xx | NmiApiError(status, "Er is een fout opgetreden...") |
| invalid JSON | Error("Ongeldig DYNA-antwoord van NMI API: ...") |
Parameters
input
Pre-assembled input bundle: field id, API key, and the fully-formed DYNA request body (built by buildDynaRequest).
Returns
Promise<DynaResult>
A DynaResult with daily simulation data, nitrogen balance, and optional recommendations.
Throws
NmiApiError on API or HTTP errors.
Throws
Error if the response body fails Zod validation.