--UPDATE FROM 8.13.10.1 TO 8.13.11.0


 	
DROP TABLE VERSION_8_13_10_1;


/*  VERSION_8_13_11_0  */
CREATE TABLE VERSION_8_13_11_0 (
	 DUMMY	NUMBER	    NULL
)
;

alter table XCOU add XCOU_RISK_AREA number(1) default 0 not null;
alter table XSTA add XSTA_RISK_AREA number(1) default 0 not null;
alter table WZIP add WZIP_RISK_AREA number(1) default 0 not null;

COMMENT ON COLUMN XCOU.XCOU_RISK_AREA is '0= No risk area, 1= risk area';
COMMENT ON COLUMN XSTA.XSTA_RISK_AREA is '0= No risk area, 1= risk area';
COMMENT ON COLUMN WZIP.WZIP_RISK_AREA is '0= No risk area, 1= risk area';

alter table xccs add xccs_vcc NUMBER(1) default 0;
COMMENT ON COLUMN XCCS.XCCS_VCC IS '0=no virtual credit card, 1=virtual credit card';
alter table xccs add xccs_cit varchar2(100);
COMMENT ON COLUMN XCCS.XCCS_CIT IS 'Store CIT as PSD2 reuirements';
alter table xccs add xccs_manual NUMBER(1) default 1;
COMMENT ON COLUMN XCCS.XCCS_MANUAL IS '1= manual entered, 0=received from IFC';

create table wpif(
   wpif_id number(30) not null
  ,wpif_short_desc varchar2(10) 
  ,wpif_long_desc varchar2(30)
  ,wpif_code varchar2(10) not null
  ,wpif_ifc_code varchar2(10) not null
  ,constraint wpif_pk primary key (wpif_id) using index tablespace v8index
) tablespace v8main;

create sequence seq_wpif increment by 1 start with 1000 nomaxvalue nocycle nocache noorder;

comment on table wpif is 'Legal PSD2 table';
comment on column wpif.wpif_code is 'Action code';
comment on column wpif.wpif_ifc_code is 'IFC8 action code correspnding to wpif_code';

insert into wpif (wpif_id, wpif_short_desc, wpif_long_desc, wpif_code, wpif_ifc_code) values (100,'NOS', 'No Show (3904)','3904','MIT1');
insert into wpif (wpif_id, wpif_short_desc, wpif_long_desc, wpif_code, wpif_ifc_code) values (101,'PREP', 'Prepayment (I)','I','MIT2');
insert into wpif (wpif_id, wpif_short_desc, wpif_long_desc, wpif_code, wpif_ifc_code) values (102,'INCR', 'Incremental (3900)','3900','MIT3');
insert into wpif (wpif_id, wpif_short_desc, wpif_long_desc, wpif_code, wpif_ifc_code) values (103,'DELC', 'Delayed Charges (3902)','3902','MIT4');

alter table zpos add ZPOS_WPIF_ID number(30); 
COMMENT ON COLUMN ZPOS.ZPOS_WPIF_ID IS 'ID of Merchant Initiated transaction code';
alter table xcap add xcap_wpif_id number(30);
COMMENT ON COLUMN xcap.xcap_wpif_id IS 'ID of Merchant Initiated transaction code';

