requestNSupply
@nmi-agro/fdm-source / fdm-calculator/src / requestNSupply
Function: requestNSupply()
requestNSupply(
input):Promise<NSupplyResult>
Defined in: fdm-calculator/src/mineralization/nsupply.ts:57
Calls POST /bemestingsplan/nsupply with the pre-built request body and
returns the parsed N supply curve as an NSupplyResult.
This is the uncached version. In most cases you should use getNSupply
which adds DB-backed caching via withCalculationCache.
Error handling:
| HTTP status | Thrown error |
|---|---|
| 401 / 403 | NmiApiError(status, "API-sleutel niet geconfigureerd of verlopen.") |
| 422 | NmiApiError(422, "Onvoldoende bodemgegevens...") |
| 503 | NmiApiError(503, "NMI API is tijdelijk niet beschikbaar.") |
| other 4xx/5xx | NmiApiError(status, "Er is een fout opgetreden...") |
| invalid JSON | Error("Ongeldig antwoord van NMI API: ...") |
Parameters
input
Pre-assembled input bundle including the request body, field metadata, chosen method, and data completeness assessment.
Returns
Promise<NSupplyResult>
A fully populated NSupplyResult.
Throws
NmiApiError on API or HTTP errors.
Throws
Error if the response body fails Zod validation.