leadtime_range

8 rows


Description

Booking lead-time bands (in days) for the advance_book / lead_time report segments. Must be a gap-free, non-overlapping partition with exactly one open-ended top band; maintained through rpc.masterfile_leadtime_range_get / _save. Values outside every band are folded into the reports’ id = 999999 / ‘Others/Unknown’ row.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
from_days int4 10 null

Inclusive lower bound, and the id the insight reports emit for this band. Lead time is legitimately negative when a booking is created after arrival, so the lowest band should start at a negative value to catch those; the lowest band must start at 0 or below.

to_days int4 10 √ null

Inclusive upper bound. NULL means open-ended: exactly one band (the highest) may be open-ended.

label text 2147483647 null

Display name of the band, returned by fn_leadtime_range(). Must be unique. The values ‘others’, ‘other’ and ‘unknown’ are reserved – see age_range.label.

seq int4 10 0

Unused. See age_range.seq.

Indexes

Constraint Name Type Sort Column(s)
pk_leadtime_range Primary key Asc from_days

Check Constraints

Constraint Name Constraint
chk_leadtime_range_bounds ((to_days IS NULL) OR (to_days >= from_days))

Relationships