/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2016 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK

DECLARE
  e_obj_not_exists EXCEPTION;
  PRAGMA EXCEPTION_INIT(e_obj_not_exists, -04043);
BEGIN
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE XXAS_MISSED_PUNCH_VARRAY FORCE';
  EXCEPTION
    WHEN e_obj_not_exists THEN
      NULL;
  END;
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE XXAS_MISSED_PUNCH_TYPE FORCE';
  EXCEPTION
    WHEN e_obj_not_exists THEN
      NULL;
  END;
END;  
/


CREATE OR REPLACE TYPE XXAS_MISSED_PUNCH_TYPE AS OBJECT
  (pending_clock_id        number
  ,person_id               number
  ,assignment_id           number
  ,element_type_id         number
  ,start_date_time         date
  ,end_date_time           date
  ,missed_in_flag          varchar2(1)
  ,missed_out_flag         varchar2(1)
  ,last_punch_type         varchar2(30)
  ,start_time_label        varchar2(100)
  ,end_time_label          varchar2(100)
  ,missed_punch_details    varchar2(4000)
  ,status_code             varchar2(30)
  ,reason_for_miss         varchar2(100)
  ,other_more_detail       varchar2(4000)
  ,period_name             varchar2(255)
  ,pend_missed_in_flag     varchar2(1)
  ,pend_missed_out_flag    varchar2(1)
  ,pend_reason_for_miss    varchar2(100)
  ,pend_other_more_detail  varchar2(4000)
  ,auto_saved_start_time   varchar2(10)
  ,auto_saved_end_time     varchar2(10)
  ,lunch_type_flag         varchar2(1));
/

CREATE OR REPLACE TYPE XXAS_MISSED_PUNCH_VARRAY AS
VARRAY(1000000) OF XXAS_MISSED_PUNCH_TYPE;
/


COMMIT;
EXIT;
