Skip to main content

Function: removeCultivation()

removeCultivation(fdm, principal_id, b_lu): Promise<void>

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

Alpha

Removes a cultivation and its related sowing and termination records from the database.

The function first verifies that the principal has permission to perform the removal, then executes a transaction that deletes the cultivation's termination, sowing, and main records. An error is thrown if the cultivation does not exist or if the deletion fails.

Parameters

fdm

any

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

principal_id

any

b_lu

any

The unique identifier of the cultivation to remove.

Returns

Promise<void>

A Promise that resolves once the removal is complete.

Throws

If the cultivation is not found or the deletion operation fails.