Skip to main content

Function: getHarvests()

getHarvests(fdm, principal_id, b_lu, timeframe?): Promise<HarvestType[]>

Defined in: fdm-core/src/harvest.ts:192

Retrieves harvest details for a specified cultivation.

This function verifies that the requesting principal has permission to access the cultivation's harvest data, then fetches all harvest records in descending order by harvest date. Each record is enriched with additional details via a simplified query.

Parameters

fdm

any

The FDM instance providing the connection to the database. The instance can be created with createFdmServer.

principal_id

any

Identifier for the principal requesting the harvest details.

b_lu

any

Identifier of the cultivation.

timeframe?

Timeframe

Returns

Promise<HarvestType[]>

A promise that resolves with an array of detailed harvest information.

Throws

If access is denied or if an error occurs during data retrieval.