-- ABS-60230 / ABS-61651

------------------- DELIVERYPOINT -------------------
ALTER TABLE DELIVERYPOINT ADD (LOCKERFEEDSCAN NUMBER DEFAULT 0 NOT NULL 
            CONSTRAINT LOCKERFEEDSCAN_VALID1_1 CHECK (LOCKERFEEDSCAN IN (0,1))) ;

COMMENT ON COLUMN DELIVERYPOINT.LOCKERFEEDSCAN
IS '0 = no
1 = yes';

------------------- LOCKER -------------------
ALTER TABLE LOCKER ADD (LOCKERTRACKINGID VARCHAR2(24) NULL);

------------------- STAY -------------------
INSERT INTO STAY
  (STAY_ID, STAYTYPE, STAYNR, SYSTEMUSER_ID, TIMESTAMP, FACTORYDESCRIPTION)
  VALUES
  (SEQ_STAY.NEXTVAL, 1, 42,  GETMINSYSTEMUSER(), SYSDATE, 'Locker Fed');
COMMIT;

INSERT INTO STAY_DESC
 (STAY_ID, LANGUAGE_ID, DESCRIPTION, SYSTEMUSER_ID, TIMESTAMP)
SELECT S.STAY_ID, L.LANGUAGE_ID, S.FACTORYDESCRIPTION, GETMINSYSTEMUSER(), SYSDATE 
FROM STAY S, LANGUAGES L
WHERE L.TRANSLATEDESCRIPTION = 'Y'
AND S.STAYTYPE = 1 AND S.STAYNR = 42;
COMMIT;

------------------- CUSTOMERINTERNETOPTIONS  ------------------- 
ALTER TABLE CUSTOMERINTERNETOPTIONS ADD (GASALOCKERFEEDSCAN NUMBER DEFAULT 0 NOT NULL
                                        CONSTRAINT GASALOCKERFEEDSCAN_VALID1_1 CHECK (GASALOCKERFEEDSCAN IN (0,1,2,3)));
                                        
COMMENT ON COLUMN CUSTOMERINTERNETOPTIONS.GASALOCKERFEEDSCAN IS
'0 = no (default) 
1 = yes using Primary_ID
2 = yes using Secondary_ID
3 = yes using Primary and SecondaryID’s';                                      

------------------- TRANSACTIONTYPE ------------------- 
INSERT INTO TRANSACTIONTYPE
  (TRANSACTIONTYPE_ID, FACTORYDESCRIPTION, SYSTEMUSER_ID, TIMESTAMP)
VALUES(110,
         'Placed in Locker',
         GETMINSYSTEMUSER(),
         SYSDATE);
COMMIT;

INSERT INTO TRANSACTIONTYPE_DESC
  (TRANSACTIONTYPE_ID, LANGUAGE_ID, DESCRIPTION, SYSTEMUSER_ID, TIMESTAMP)
  SELECT TT.TRANSACTIONTYPE_ID,
         GETMINLANGUAGE(),
         TT.FACTORYDESCRIPTION,
         GETMINSYSTEMUSER(),
         SYSDATE
    FROM TRANSACTIONTYPE TT
    WHERE TT.TRANSACTIONTYPE_ID = 110;
COMMIT;
