-- ABS-52338/ ABS-67601

-- WEBUSER table --
ALTER TABLE WEBUSER ADD (ALLOWMOVECLIENT NUMBER DEFAULT 0 NOT NULL
                                         CONSTRAINT ALLOWMOVECLIENT_VALID1_1 CHECK (ALLOWMOVECLIENT IN (0, 1)));

COMMENT ON COLUMN WEBUSER.ALLOWMOVECLIENT
  IS 'Only relevant when the modules PWBINTERNET is active. Possible values:
0 = Not applicable/not allowed
1 = Web user may move clients';

-- WEBEVENTTYEPE table --
INSERT INTO WEBEVENTTYPE(WEBEVENTTYPE_ID, DESCRIPTION, SYSTEMUSER_ID, TIMESTAMP) 
  SELECT 118, 'Move Client', GETMINSYSTEMUSER(), SYSDATE FROM DUAL;
COMMIT;

-- REASONCODE table --
ALTER TABLE REASONCODE ADD (MOVECLIENTADJUSTRENT VARCHAR2(1) DEFAULT 'N' NOT NULL
                            CONSTRAINT YN_VALIDATIONFIELD427 CHECK (MOVECLIENTADJUSTRENT IN ('Y', 'N')));

COMMENT ON COLUMN REASONCODE.MOVECLIENTADJUSTRENT
  IS 'Used for correction of residential rent when moving a client via the web portal.';