@welldot/utils
getPermitStatus
Derives the status of a permit (.well v2.3), evaluated on today (a local calendar date at the well site), in order:
getPermitStatus(
well,permit,today?):PermitStatus|undefined
Derives the status of a permit (.well v2.3), evaluated on today (a local
calendar date at the well site), in order:
- A stored administrative
statusother thangranted(requested,suspended,revoked,denied,withdrawn) is returned as-is. - Another permit
supersedesit →superseded. todayis before its start date →not_yet_valid.valid_untilis absent, ortodayis on or before it →active.renewal_requested_atis on or beforevalid_until→active_pending_renewal.- Otherwise →
expired.
Returns undefined when permit is an id that does not resolve.
Parameters
well
Well
permit
string | Permit
today?
string = ...
Returns
PermitStatus | undefined