@welldot/utils

getPumpInstalledAt

Returns the pump installed in the well at instant: the entry with installedat <= instant and no removedat or removedat > instant (latest installed if several overlap). Use it to link a record dated in the past (e.g. a water sample collected at the pump) to the pump in place then.

getPumpInstalledAt(well, instant): PumpInstallation | undefined

Returns the pump installed in the well at instant: the entry with installed_at <= instant and no removed_at or removed_at > instant (latest installed if several overlap). Use it to link a record dated in the past (e.g. a water sample collected at the pump) to the pump in place then.

Parameters

well

Well

The well.

instant

string | Date

RFC 3339 instant (or a Date).

Returns

PumpInstallation | undefined

The installation in place at instant, or undefined.