-- ======================
-- SIGNING: Document
-- ======================
CREATE TABLE unified_signing_document (
  unified_connection_id  text NOT NULL,
  unified_webhook_id     text NOT NULL,
  unified_external_xref  text,
  unified_integration_type text NOT NULL,
  unified_raw_id         text,
  unified_id             text NOT NULL,
  id                   text,
  created_at           timestamptz,
  updated_at           timestamptz,
  name                 text,
  description          text,
  status               text,
  sent_at              timestamptz,
  completed_at         timestamptz,
  expires_at           timestamptz,
  template_id          text,
  download_url         text,
  creator_id           text,
  raw                  jsonb
);
-- ======================
-- SIGNING: Signatory
-- ======================
CREATE TABLE unified_signing_signatory (
  unified_connection_id  text NOT NULL,
  unified_webhook_id     text NOT NULL,
  unified_external_xref  text,
  unified_integration_type text NOT NULL,
  unified_raw_id         text,
  unified_id             text NOT NULL,
  id                   text,
  created_at           timestamptz,
  updated_at           timestamptz,
  document_id          text,
  name                 text,
  email                text,
  role                 text,
  status               text,
  order                numeric,
  signed_at            timestamptz,
  decline_reason       text,
  raw                  jsonb
);
-- ======================
-- SIGNING: Template
-- ======================
CREATE TABLE unified_signing_template (
  unified_connection_id  text NOT NULL,
  unified_webhook_id     text NOT NULL,
  unified_external_xref  text,
  unified_integration_type text NOT NULL,
  unified_raw_id         text,
  unified_id             text NOT NULL,
  id                   text,
  created_at           timestamptz,
  updated_at           timestamptz,
  name                 text,
  description          text,
  is_active            boolean,
  creator_id           text,
  raw                  jsonb
);
