-- Test checked_in_guest
set client_min_messages to warning;
create extension if not exists pgtap;
reset client_min_messages;

begin;

select plan(13);

set search_path to camper, public;

select has_composite('camper', 'checked_in_guest', 'Composite type camper.checked_in_guest should exist');
select columns_are('camper', 'checked_in_guest', array['id_document_type_id', 'id_document_number', 'id_document_issue_date', 'given_name', 'first_surname', 'second_surname', 'sex_id', 'birthdate', 'country_code', 'phone', 'address']);
select col_type_is('camper'::name, 'checked_in_guest'::name, 'id_document_type_id'::name, 'character varying(1)');
select col_type_is('camper'::name, 'checked_in_guest'::name, 'id_document_number'::name, 'text');
select col_type_is('camper'::name, 'checked_in_guest'::name, 'id_document_issue_date'::name, 'date');
select col_type_is('camper'::name, 'checked_in_guest'::name, 'given_name'::name, 'text');
select col_type_is('camper'::name, 'checked_in_guest'::name, 'first_surname'::name, 'text');
select col_type_is('camper'::name, 'checked_in_guest'::name, 'second_surname'::name, 'text');
select col_type_is('camper'::name, 'checked_in_guest'::name, 'sex_id'::name, 'character varying(1)');
select col_type_is('camper'::name, 'checked_in_guest'::name, 'birthdate'::name, 'date');
select col_type_is('camper'::name, 'checked_in_guest'::name, 'country_code'::name, 'country_code');
select col_type_is('camper'::name, 'checked_in_guest'::name, 'phone'::name, 'text');
select col_type_is('camper'::name, 'checked_in_guest'::name, 'address'::name, 'text');


select *
from finish();

rollback;
