/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2015 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_APPROVER_TBL FORCE';
  EXCEPTION
    WHEN e_obj_not_exists THEN
      NULL;
  END;
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE XXAS_APPROVER FORCE';
  EXCEPTION
    WHEN e_obj_not_exists THEN
      NULL;
  END;

END;
/

CREATE OR REPLACE TYPE XXAS_APPROVER AS OBJECT
  (line_number           number
  ,origsys_id            number
  ,origsys               varchar2(50)
  ,role_name             varchar2(400)
  ,approver_category_id  number
  ,approver_category     varchar2(200)
  ,approver_order_number number
  ,approver_group_id     number
  ,approver_group_name   varchar2(200)
  ,approval_status_code  varchar2(100)
  ,approval_status       varchar2(400)
  ,adhoc_approver_flag   varchar2(10)
  ,allow_delete          varchar2(10)
  ,display_name          varchar2(240)
  ,image_uri             varchar2(2000)
  ,assignments_xml       XMLType
  );
/

CREATE TYPE XXAS_APPROVER_TBL AS TABLE OF XXAS_APPROVER;
/

COMMIT;
EXIT;
