RESERVATIONSTATUSHISTORY

This table contains the status history of a reservation.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
STATUSCODE tinyint Default = 0 Status of the reservation.
STATUSDATE datetime
COMMENTS nvarchar(500) Default = '' Comments related to the reservation status history.
DATEADDED datetime Default = getdate() Indicates the date this record was added.
DATECHANGED datetime Default = getdate() Indicates the date this record was last changed.
TS timestamp Timestamp.
TSLONG bigint (Computed) yes CONVERT(bigint, TS) Numeric representation of the timestamp.
STATUS nvarchar(31) (Computed) yes CASE [STATUSCODE] WHEN 0 THEN N'Pending' WHEN 1 THEN N'Complete' WHEN 2 THEN N'Tentative' WHEN 3 THEN N'Confirmed' WHEN 4 THEN N'Finalized' WHEN 5 THEN N'Cancelled' WHEN 6 THEN N'Contract Sent' WHEN 7 THEN N'Contract Received' WHEN 8 THEN N'Contract Marked Not Sent' WHEN 9 THEN N'Contract Marked Not Received' WHEN 10 THEN N'Final Count Marked Not Received' WHEN 11 THEN N'Final Count Received' WHEN 12 THEN N'Order balance sent' WHEN 13 THEN N'Order balance marked not sent' END Provides a translation for the 'STATUSCODE' field.
STATUSDATEWITHOFFSET datetimeoffset yes

Foreign Keys

Foreign Key Field Type Null Notes Description
RESERVATIONID uniqueidentifier RESERVATION.ID The reservation in which the reservation status history belongs.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_RESERVATIONSTATUSHISTORY_DATEADDED DATEADDED yes
IX_RESERVATIONSTATUSHISTORY_DATECHANGED DATECHANGED
PK_RESERVATIONSTATUSHISTORY ID yes yes

Triggers

Trigger Name Description
TR_RESERVATIONSTATUSHISTORY_AUDIT_UPDATE
TR_RESERVATIONSTATUSHISTORY_AUDIT_DELETE