Skip to main content

Function: getCultivations()

getCultivations(fdm, principal_id, b_id, timeframe?): Promise<getCultivationType[]>

Defined in: fdm-core/src/cultivation.ts:390

Alpha

Retrieves all cultivations associated with a specific field.

This function verifies that the requesting principal has read access to the field, then queries the database and returns an array of cultivation records.

Parameters

fdm

any

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

principal_id

any

Identifier of the principal requesting access.

b_id

any

Identifier of the field.

timeframe?

Timeframe

Optional timeframe to filter cultivations by start and end dates.

Returns

Promise<getCultivationType[]>

A Promise resolving to an array of cultivation details.

Throws

If the principal does not have read permission or if the database query fails.