-- Mark: I've divided this into Tim inserts which are the insert
-- statements that Tim had put into this file
-- and Dennis inserts which are new ones.

-- Tim inserts
insert into channel values (1, "default", null, null);
insert into channel values (2, "web", 1, null);
insert into channel values (3, "LMN-en_GB", 2, "en_GB");
insert into channel values (4, "LMN-fr_FR", 2, "fr_FR");
insert into channel values (5, "trade", 1, null);
insert into channel values (6, "thomas cook", 5, "en_GB");

insert into channel_ancestors (1, 1);
insert into channel_ancestors (2, 1);
insert into channel_ancestors (3, 1);
insert into channel_ancestors (4, 1);
insert into channel_ancestors (5, 1);
insert into channel_ancestors (2, 2);
insert into channel_ancestors (2, 1);
insert into channel_ancestors (3, 3);
insert into channel_ancestors (3, 2);
insert into channel_ancestors (3, 1);
insert into channel_ancestors (4, 4);
insert into channel_ancestors (4, 2);
insert into channel_ancestors (4, 1);
insert into channel_ancestors (5, 5);
insert into channel_ancestors (5, 1);
insert into channel_ancestors (6, 6);
insert into channel_ancestors (6, 5);
insert into channel_ancestors (6, 1);



insert into pricing_type values (1, "net-rate");
insert into pricing_type values (2, "commissionable");
    
insert into pricing_method values (1, "per room");
insert into pricing_method values (2, "per person");

insert into accomm_type values (1, "hotel");
insert into accomm_type values (2, "B&B");
insert into accomm_type values (3, "hostel");
insert into accomm_type values (4, "apartment");
insert into accomm_type values (5, "villa");
insert into accomm_type values (6, "castle");
insert into accomm_type values (7, "chalet");
insert into accomm_type values (8, "cottage");
insert into accomm_type values (9, "camp site");

insert into accomm_sub_type values (1, "Normal");
insert into accomm_sub_type values (2, "Luxury");
insert into accomm_sub_type values (3, "Boutique");



insert into room_type values (1, "Single");
insert into room_type values (2, "Double");
insert into room_type values (3, "Twin");
insert into room_type values (4, "Triple");
insert into room_type values (5, "Quadruple");

insert into accomm_unit_type values (1, 1);
insert into accomm_unit_type values (2, 1);
insert into accomm_unit_type values (3, 3);


insert into accomm_unit_type_t values (1, "en_GB", "Double room");
insert into accomm_unit_type_t values (2, "en_GB", "Kingsize double room");
insert into accomm_unit_type_t values (3, "en_GB", "3 Bedroom Condo");


insert into accomm_unit_add values (1);
insert into accomm_unit_add values (2);
insert into accomm_unit_add values (3);


insert into accomm_unit_add_t values (1, "en_GB", "Flowers");
insert into accomm_unit_add_t values (2, "en_GB", "Champagne");
insert into accomm_unit_add_t values (3, "en_GB", "Tickets for Alton Towers");


insert into accomm_unit_feat values (1);
insert into accomm_unit_feat values (2);
insert into accomm_unit_feat values (3);


insert into accomm_unit_feat_t values (1, "en_GB", "Sea view");
insert into accomm_unit_feat_t values (2, "en_GB", "Mountain view");
insert into accomm_unit_feat_t values (3, "en_GB", "Balcony");


insert into bed_type values (1);
insert into bed_type values (2);
insert into bed_type values (3);


insert into bed_type_t values (1, "en_GB", "Single");
insert into bed_type_t values (2, "en_GB", "Double");
insert into bed_type_t values (3, "en_GB", "Cot");

insert into board_type values (1, "RO", 100);
insert into board_type values (2, "BB", 200);
insert into board_type values (3, "HB", 300);
insert into board_type values (4, "FB", 400);
insert into board_type values (5, "AI", 500);

insert into board_type_t values (1, "en_GB", "Room Only", "T");
insert into board_type_t values (2, "en_GB", "Bed and Breakfast", "T");
insert into board_type_t values (3, "en_GB", "Half Board", "T");
insert into board_type_t values (4, "en_GB", "Full Board", "T");
insert into board_type_t values (5, "en_GB", "All Inclusive", "T");

insert into person_type values (1, "Adult");
insert into person_type values (2, "Child");
insert into person_type values (3, "Infant");

-- Dennis inserts

insert into accomm
select d.id, d.available, d.name, 5,  1, g.lattitude, 
g.longitude, d.city_code, d.id MOD 15,
17, -- role_id I did not see how to get it from lmn_role
2, -- commissionable pricing_type 
2, -- per room pricing_method_id 
0,
12,
5, -- invented booking contact
7); -- invented supplier_id supplier(id)
from drs_valid_product d, lmn_geocode g 
where d.type_id = 5
and g.product_id = d.id

insert into accomm_t
select accomm.id, "en_GB", accomm.ref_name, "T"
from accomm;

insert into accomm_channel
select accomm.id, 1, "F"
from accomm


-- id should be serial
insert into phase
select accomm.id as accomm_id, "some phase" as description, 
1 as pricing_method_id 
from accomm



insert into accomm_unit_def values(1, 1, 2, 15, "T", "F");
insert into accomm_unit_def values(2, 1, 1, 23, "T", "F");
insert into accomm_unit_def values(3, 1, 3, 13, "T", "F");
insert into accomm_unit_def values(4, 1, 3, 17, "T", "F");
insert into accomm_unit_def values(5, 1, 2, 35, "T", "F");
insert into accomm_unit_def values(6, 1, 1, 43, "T", "F");
insert into accomm_unit_def values(7, 1, 3, 23, "T", "F");
insert into accomm_unit_def values(8, 1, 3, 97, "T", "F");

insert into accomm_unit_def_occ
select a.id, a.id, 2, 1,4,1,4,0,3
from accomm_unit_def a;

insert into accomm_unit_def_occ_beds
select a.id, 1, 2
from accomm_unit_def_occ a; 


-- Make id for contract_item be serial
insert into contract_item
select "T" as available, a.id as accomm_unit_def_id, "F" as committed_stock
from  accomm_unit_def;

