Restrictions API
The Restrictions API allows a third-party external interface to distribute updates to the OPERA Rate Restrictions. The updated Rate Restrictions are stored in the Restrictions "as-is" without any intermediate calculations.
The RESERVATION_RESTRICTIONS view has the following structure.
Field  | 
Data Format  | 
Notes  | 
RESERVATION_RESTRICTION_ID  | 
NUMBER  | 
The primary key for this table.  | 
RESORT  | 
VARCHAR2(20)  | 
The property that the restriction record belongs to.  | 
RATE_CODE  | 
VARCHAR2(20)  | 
The Rate Code for which this restriction belongs to.  | 
ROOM_CATEGORY  | 
VARCHAR2(20)  | 
The Room Category for which this restriction applies.  | 
RESTRICTION_TYPE  | 
VARCHAR2(20)  | 
The type of this restriction. Valid values 'S_CLOSE', 'S_OPEN', 'D_OPEN', 'S_MINLOS', 'D_CLOSE', 'A_OPEN', 'A_CLOSE', 'A_MINLOS', 'S_MAXLOS', 'A_MAXLOS', 'S_HURDLE', 'LOS_RESTRICTION', 'ADVBOOK_MIN', 'ADVBOOK_MAX'  | 
LOS_UNITS  | 
NUMBER  | 
The length of stay for this reservation. This is used for the Minimum Length of Stay, Soft Close, etc.  | 
BEGIN_DATE  | 
DATE  | 
The beginning date of this restriction.  | 
END_DATE  | 
DATE  | 
The ending date of this restriction.  | 
DAY1  | 
VARCHAR2(1)  | 
A flag indicating whether or not this restriction should apply on Sunday. (Y/N)  | 
DAY2  | 
VARCHAR2(1)  | 
A flag indicating whether or not this restriction should apply on Monday. (Y/N)  | 
DAY3  | 
VARCHAR2(1)  | 
A flag indicating whether or not this restriction should apply on Tuesday. (Y/N)  | 
DAY4  | 
VARCHAR2(1)  | 
A flag indicating whether or not this restriction should apply on Wednesday. (Y/N)  | 
DAY5  | 
VARCHAR2(1)  | 
A flag indicating whether or not this restriction should apply on Thursday. (Y/N)  | 
DAY6  | 
VARCHAR2(1)  | 
A flag indicating whether or not this restriction should apply on Friday. (Y/N)  | 
DAY7  | 
VARCHAR2(1)  | 
A flag indicating whether or not this restriction should apply on Saturday. (Y/N)  | 
SEASON_CODE  | 
VARCHAR2(20)  | 
The Season Code during which the restrictions are valid.  | 
RATE_CLASS  | 
VARCHAR2(20)  | 
The Rate Class for which the restriction applies.  | 
RATE_CATEGORY  | 
VARCHAR2(20)  | 
The Rate Category for which the restriction applies.  | 
RATE_TIER  | 
VARCHAR2(20)  | 
The Rate Tier for which the restriction applies.  | 
ROOM_CLASS  | 
VARCHAR2(20)  | 
The Room Class for which the restriction applies.  | 
HURDLE_RATE  | 
NUMBER  | 
Not applicable  | 
INACTIVE_DATE  | 
DATE  | 
The date the restriction was marked as inactive.  | 
YIELD_CREATED_YN  | 
VARCHAR2(1)  | 
A flag indicating whether or not the restriction is a Yield Management Restriction. (Y/N)  | 
LOS1_YN  | 
VARCHAR2(1)  | 
LOS1 Restriction. (Y/N)  | 
LOS2_YN  | 
VARCHAR2(1)  | 
LOS2 Restriction. (Y/N)  | 
LOS3_YN  | 
VARCHAR2(1)  | 
LOS3 Restriction. (Y/N)  | 
LOS4_YN  | 
VARCHAR2(1)  | 
LOS4 Restriction. (Y/N)  | 
LOS5_YN  | 
VARCHAR2(1)  | 
LOS5 Restriction. (Y/N)  | 
LOS6_YN  | 
VARCHAR2(1)  | 
LOS6 Restriction. (Y/N)  | 
LOS7_YN  | 
VARCHAR2(1)  | 
LOS7 Restriction. (Y/N)  | 
ALLOTMENT_HEADER_ID  | 
NUMBER  | 
The primary key of the Business Block reservation.  | 
CLEAR_PREVIOUS_YN  | 
VARCHAR2(1)  | 
Clear the previous restrictions for that date. (Y/N)  | 
INSERT_USER  | 
NUMBER  | 
User ID that created the record.  | 
INSERT_DATE  | 
DATE  | 
Date that the record was created.  | 
UPDATE_USER  | 
NUMBER  | 
If the record has been modified, then this is the User ID that modified the record.  | 
UPDATE_DATE  | 
DATE  | 
If the record has been modified, then this is the Date that the record was modified.  | 
GDS_ON_REQUEST  | 
VARCHAR2(1)  | 
Not Applicable  | 
GDS_HOST  | 
VARCHAR2(20)  | 
Not Applicable  | 
YIELDABILITY  | 
VARCHAR2(20)  | 
Contains a condition for a Yield Status of the Rate Code. Values: N - Non-Yieldable Y - Yieldable S - Stay Pattern  | 
DECLARE
  s varchar2(2000);
  rec reservation_restrictions%rowtype;
  i integer;
BEGIN
  pms_p.initialize('<USERNAME>','<PASSWORD>','<PROPERTY_CODE>');
  rec.resort:=pms_p.resort;
  rec.begin_date:=pms_p.business_date;
  rec.end_date:=pms_p.business_date+1;
  rec.day1:='Y';
  rec.day2:='Y';
  rec.day3:='Y';
  rec.day4:='Y';
  rec.day5:='Y';
  rec.day6:='Y';
  rec.day7:='Y';
  rec.rate_code:='APPLE';
  rec.room_category:='';
  rec.restriction_type:='S_CLOSE';
  rec.los1_yn:='N';
  rec.los2_yn:='N';
  rec.los3_yn:='N';
  rec.los4_yn:='N';
  rec.los5_yn:='N';
  rec.los6_yn:='N';
  rec.los7_yn:='N';
  rec.clear_previous_yn:='Y';
  i:=int_pmsrates.SetRateRestriction(recRestriction => rec,
                                     vroomtype => 'DLX');
  COMMIT;
  IF s IS NOT null THEN
    dbms_output.put_line('ERROR: '||s);
  END IF;
END;