--
-- PostgreSQL database dump
--

\restrict Hb2HcJmDeNvO1dffNkKGoSH9xaGi0o15et9OhFfpFNDbLg3kODphATphu3Q5gRj

-- Dumped from database version 15.16 (Debian 15.16-0+deb12u1)
-- Dumped by pg_dump version 15.16 (Debian 15.16-0+deb12u1)

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;


--
-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';


SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: accounts; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.accounts (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    name character varying(255) NOT NULL,
    email character varying(255),
    password_hash character varying(255),
    role character varying(20) DEFAULT 'agent'::character varying NOT NULL,
    phone character varying(30),
    phone_connected boolean DEFAULT false NOT NULL,
    availability character varying(10) DEFAULT 'offline'::character varying NOT NULL,
    avatar_url text,
    active boolean DEFAULT true NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    nw_team_id text,
    nw_sector_id text,
    CONSTRAINT accounts_availability_check CHECK (((availability)::text = ANY ((ARRAY['online'::character varying, 'busy'::character varying, 'offline'::character varying])::text[]))),
    CONSTRAINT accounts_role_check CHECK (((role)::text = ANY ((ARRAY['owner'::character varying, 'manager'::character varying, 'supervisor'::character varying, 'secretary'::character varying, 'agent'::character varying, 'viewer'::character varying])::text[])))
);


ALTER TABLE public.accounts OWNER TO newwhats;

--
-- Name: accounts_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.accounts_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.accounts_id_seq OWNER TO newwhats;

--
-- Name: accounts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.accounts_id_seq OWNED BY public.accounts.id;


--
-- Name: admins; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.admins (
    id integer NOT NULL,
    username text NOT NULL,
    password_hash text NOT NULL,
    nome text,
    email text,
    telefone text,
    created_at timestamp with time zone DEFAULT now(),
    tenant_id integer,
    account_id integer
);


ALTER TABLE public.admins OWNER TO newwhats;

--
-- Name: admins_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.admins_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.admins_id_seq OWNER TO newwhats;

--
-- Name: admins_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.admins_id_seq OWNED BY public.admins.id;


--
-- Name: benefit_clubs; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.benefit_clubs (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    slug character varying(80) NOT NULL,
    name character varying(255) NOT NULL,
    specialty character varying(80) DEFAULT 'outro'::character varying NOT NULL,
    active boolean DEFAULT true NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    conditions text,
    rules text
);


ALTER TABLE public.benefit_clubs OWNER TO newwhats;

--
-- Name: benefit_clubs_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.benefit_clubs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.benefit_clubs_id_seq OWNER TO newwhats;

--
-- Name: benefit_clubs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.benefit_clubs_id_seq OWNED BY public.benefit_clubs.id;


--
-- Name: broadcast_last_seen; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.broadcast_last_seen (
    account_id integer NOT NULL,
    tenant_id integer NOT NULL,
    last_seen_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.broadcast_last_seen OWNER TO newwhats;

--
-- Name: broadcasts; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.broadcasts (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    from_account integer,
    content text NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.broadcasts OWNER TO newwhats;

--
-- Name: broadcasts_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.broadcasts_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.broadcasts_id_seq OWNER TO newwhats;

--
-- Name: broadcasts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.broadcasts_id_seq OWNED BY public.broadcasts.id;


--
-- Name: cliente_enderecos; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.cliente_enderecos (
    id integer NOT NULL,
    cliente_id integer NOT NULL,
    tipo character varying(20) DEFAULT 'entrega'::character varying NOT NULL,
    cep character varying(10),
    rua character varying(255),
    numero character varying(20),
    complemento character varying(100),
    bairro character varying(100),
    cidade character varying(100),
    estado character varying(2),
    referencia character varying(255),
    principal boolean DEFAULT false NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    CONSTRAINT cliente_enderecos_tipo_check CHECK (((tipo)::text = ANY ((ARRAY['entrega'::character varying, 'cobranca'::character varying, 'retirada'::character varying, 'matriz'::character varying, 'filial'::character varying])::text[])))
);


ALTER TABLE public.cliente_enderecos OWNER TO newwhats;

--
-- Name: cliente_enderecos_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.cliente_enderecos_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cliente_enderecos_id_seq OWNER TO newwhats;

--
-- Name: cliente_enderecos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.cliente_enderecos_id_seq OWNED BY public.cliente_enderecos.id;


--
-- Name: cliente_responsaveis; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.cliente_responsaveis (
    id integer NOT NULL,
    cliente_id integer NOT NULL,
    nome character varying(255) NOT NULL,
    cargo character varying(100),
    setor character varying(100),
    telefone_id integer,
    email character varying(255),
    permissao character varying(100),
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.cliente_responsaveis OWNER TO newwhats;

--
-- Name: cliente_responsaveis_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.cliente_responsaveis_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cliente_responsaveis_id_seq OWNER TO newwhats;

--
-- Name: cliente_responsaveis_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.cliente_responsaveis_id_seq OWNED BY public.cliente_responsaveis.id;


--
-- Name: cliente_telefones; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.cliente_telefones (
    id integer NOT NULL,
    cliente_id integer NOT NULL,
    tipo character varying(20) DEFAULT 'celular'::character varying NOT NULL,
    numero character varying(20) NOT NULL,
    ramal character varying(10),
    aceita_whatsapp boolean DEFAULT false NOT NULL,
    principal boolean DEFAULT false NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    CONSTRAINT cliente_telefones_tipo_check CHECK (((tipo)::text = ANY ((ARRAY['comercial'::character varying, 'celular'::character varying, 'whatsapp'::character varying, 'financeiro'::character varying, 'compras'::character varying])::text[])))
);


ALTER TABLE public.cliente_telefones OWNER TO newwhats;

--
-- Name: cliente_telefones_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.cliente_telefones_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cliente_telefones_id_seq OWNER TO newwhats;

--
-- Name: cliente_telefones_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.cliente_telefones_id_seq OWNED BY public.cliente_telefones.id;


--
-- Name: clientes; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.clientes (
    id integer NOT NULL,
    tenant_id integer DEFAULT 1 NOT NULL,
    tipo character varying(2) NOT NULL,
    nome character varying(255) NOT NULL,
    cpf_cnpj character varying(20) NOT NULL,
    email character varying(255),
    status character varying(10) DEFAULT 'ativo'::character varying NOT NULL,
    user_id integer,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    CONSTRAINT clientes_status_check CHECK (((status)::text = ANY ((ARRAY['ativo'::character varying, 'inativo'::character varying])::text[]))),
    CONSTRAINT clientes_tipo_check CHECK (((tipo)::text = ANY ((ARRAY['PF'::character varying, 'PJ'::character varying])::text[])))
);


ALTER TABLE public.clientes OWNER TO newwhats;

--
-- Name: clientes_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.clientes_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.clientes_id_seq OWNER TO newwhats;

--
-- Name: clientes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.clientes_id_seq OWNED BY public.clientes.id;


--
-- Name: club_dependents; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.club_dependents (
    id integer NOT NULL,
    member_id integer NOT NULL,
    nome character varying(255) NOT NULL,
    cpf character varying(14),
    nascimento date,
    parentesco character varying(80),
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.club_dependents OWNER TO newwhats;

--
-- Name: club_dependents_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.club_dependents_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.club_dependents_id_seq OWNER TO newwhats;

--
-- Name: club_dependents_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.club_dependents_id_seq OWNED BY public.club_dependents.id;


--
-- Name: club_faqs; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.club_faqs (
    id integer NOT NULL,
    club_id integer NOT NULL,
    tenant_id integer NOT NULL,
    question text NOT NULL,
    answer text NOT NULL,
    sort_order integer DEFAULT 0 NOT NULL,
    active boolean DEFAULT true NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.club_faqs OWNER TO newwhats;

--
-- Name: club_faqs_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.club_faqs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.club_faqs_id_seq OWNER TO newwhats;

--
-- Name: club_faqs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.club_faqs_id_seq OWNED BY public.club_faqs.id;


--
-- Name: club_members; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.club_members (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    club_id integer NOT NULL,
    plan_id integer NOT NULL,
    user_cpf character varying(14) NOT NULL,
    user_nome character varying(255) NOT NULL,
    user_telefone character varying(20),
    user_email character varying(255),
    status character varying(20) DEFAULT 'pending_payment'::character varying NOT NULL,
    asaas_subscription_id character varying(255),
    asaas_customer_id character varying(255),
    next_billing_at date,
    started_at timestamp with time zone,
    canceled_at timestamp with time zone,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.club_members OWNER TO newwhats;

--
-- Name: club_members_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.club_members_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.club_members_id_seq OWNER TO newwhats;

--
-- Name: club_members_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.club_members_id_seq OWNED BY public.club_members.id;


--
-- Name: club_partners; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.club_partners (
    id integer NOT NULL,
    club_id integer NOT NULL,
    name character varying(255) NOT NULL,
    specialty character varying(255),
    phone character varying(20),
    address text,
    discount_percent integer DEFAULT 0 NOT NULL,
    active boolean DEFAULT true NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    tenant_id integer,
    notes text
);


ALTER TABLE public.club_partners OWNER TO newwhats;

--
-- Name: club_partners_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.club_partners_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.club_partners_id_seq OWNER TO newwhats;

--
-- Name: club_partners_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.club_partners_id_seq OWNED BY public.club_partners.id;


--
-- Name: club_payments; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.club_payments (
    id integer NOT NULL,
    member_id integer NOT NULL,
    plan_id integer NOT NULL,
    amount numeric(10,2) NOT NULL,
    status character varying(20) DEFAULT 'pending'::character varying NOT NULL,
    asaas_payment_id character varying(255),
    reference_month character varying(7),
    paid_at timestamp with time zone,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.club_payments OWNER TO newwhats;

--
-- Name: club_payments_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.club_payments_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.club_payments_id_seq OWNER TO newwhats;

--
-- Name: club_payments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.club_payments_id_seq OWNED BY public.club_payments.id;


--
-- Name: club_plans; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.club_plans (
    id integer NOT NULL,
    club_id integer NOT NULL,
    name character varying(255) NOT NULL,
    description text,
    price_monthly numeric(10,2) NOT NULL,
    max_dependents integer DEFAULT 0 NOT NULL,
    features jsonb DEFAULT '[]'::jsonb NOT NULL,
    active boolean DEFAULT true NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.club_plans OWNER TO newwhats;

--
-- Name: club_plans_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.club_plans_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.club_plans_id_seq OWNER TO newwhats;

--
-- Name: club_plans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.club_plans_id_seq OWNED BY public.club_plans.id;


--
-- Name: cotacao_flash_promos; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.cotacao_flash_promos (
    id integer NOT NULL,
    tenant_id integer DEFAULT 1 NOT NULL,
    produto_id integer,
    discount_pct numeric(5,2) NOT NULL,
    label character varying(120) DEFAULT 'Promoção Relâmpago'::character varying NOT NULL,
    starts_at timestamp with time zone DEFAULT now() NOT NULL,
    ends_at timestamp with time zone NOT NULL,
    ativo boolean DEFAULT true NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.cotacao_flash_promos OWNER TO newwhats;

--
-- Name: cotacao_flash_promos_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.cotacao_flash_promos_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cotacao_flash_promos_id_seq OWNER TO newwhats;

--
-- Name: cotacao_flash_promos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.cotacao_flash_promos_id_seq OWNED BY public.cotacao_flash_promos.id;


--
-- Name: cotacao_funcao_team; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.cotacao_funcao_team (
    tenant_id integer NOT NULL,
    funcao character varying(20) NOT NULL,
    nw_team_id text NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    CONSTRAINT cotacao_funcao_team_funcao_check CHECK (((funcao)::text = ANY ((ARRAY['separador'::character varying, 'embalador'::character varying, 'auditor'::character varying, 'fiscal'::character varying, 'expedidor'::character varying])::text[])))
);


ALTER TABLE public.cotacao_funcao_team OWNER TO newwhats;

--
-- Name: cotacao_itens; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.cotacao_itens (
    id integer NOT NULL,
    cotacao_id integer NOT NULL,
    produto_id integer,
    nome_produto character varying(255) NOT NULL,
    sku character varying(100),
    quantidade numeric(10,3) DEFAULT 1 NOT NULL,
    preco_unitario numeric(10,2) NOT NULL,
    preco_promocional numeric(10,2),
    desconto_pct numeric(5,2) DEFAULT 0,
    subtotal numeric(10,2) NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    observacao character varying(500)
);


ALTER TABLE public.cotacao_itens OWNER TO newwhats;

--
-- Name: cotacao_itens_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.cotacao_itens_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cotacao_itens_id_seq OWNER TO newwhats;

--
-- Name: cotacao_itens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.cotacao_itens_id_seq OWNED BY public.cotacao_itens.id;


--
-- Name: cotacoes; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.cotacoes (
    id integer NOT NULL,
    tenant_id integer DEFAULT 1 NOT NULL,
    cliente_id integer,
    user_id integer,
    status character varying(20) DEFAULT 'rascunho'::character varying NOT NULL,
    forma_pagto character varying(20),
    total numeric(10,2) DEFAULT 0 NOT NULL,
    desconto numeric(10,2) DEFAULT 0 NOT NULL,
    observacao text,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    CONSTRAINT cotacoes_forma_pagto_check CHECK (((forma_pagto)::text = ANY ((ARRAY['pix'::character varying, 'cartao'::character varying, 'faturado'::character varying, 'na_retirada'::character varying, 'na_entrega'::character varying])::text[]))),
    CONSTRAINT cotacoes_status_check CHECK (((status)::text = ANY ((ARRAY['rascunho'::character varying, 'salva'::character varying, 'finalizada'::character varying, 'cancelada'::character varying])::text[])))
);


ALTER TABLE public.cotacoes OWNER TO newwhats;

--
-- Name: cotacoes_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.cotacoes_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cotacoes_id_seq OWNER TO newwhats;

--
-- Name: cotacoes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.cotacoes_id_seq OWNED BY public.cotacoes.id;


--
-- Name: direct_messages; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.direct_messages (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    from_account integer NOT NULL,
    to_account integer NOT NULL,
    content text NOT NULL,
    read_at timestamp with time zone,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.direct_messages OWNER TO newwhats;

--
-- Name: direct_messages_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.direct_messages_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.direct_messages_id_seq OWNER TO newwhats;

--
-- Name: direct_messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.direct_messages_id_seq OWNED BY public.direct_messages.id;


--
-- Name: group_chats; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.group_chats (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    sector_id integer NOT NULL,
    name character varying(255) NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.group_chats OWNER TO newwhats;

--
-- Name: group_chats_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.group_chats_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.group_chats_id_seq OWNER TO newwhats;

--
-- Name: group_chats_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.group_chats_id_seq OWNED BY public.group_chats.id;


--
-- Name: group_last_read; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.group_last_read (
    account_id integer NOT NULL,
    group_chat_id integer NOT NULL,
    last_read_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.group_last_read OWNER TO newwhats;

--
-- Name: group_messages; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.group_messages (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    group_chat_id integer NOT NULL,
    from_account integer,
    content text NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.group_messages OWNER TO newwhats;

--
-- Name: group_messages_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.group_messages_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.group_messages_id_seq OWNER TO newwhats;

--
-- Name: group_messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.group_messages_id_seq OWNED BY public.group_messages.id;


--
-- Name: human_api_requests; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.human_api_requests (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    conversation_id character varying(64),
    sector_id integer,
    account_id integer,
    question text NOT NULL,
    answer text,
    status character varying(20) DEFAULT 'pending'::character varying NOT NULL,
    delivery_mode character varying(20) DEFAULT 'inbox_interna'::character varying NOT NULL,
    asked_at timestamp with time zone DEFAULT now() NOT NULL,
    answered_at timestamp with time zone,
    timeout_at timestamp with time zone,
    chat_id character varying(120),
    CONSTRAINT human_api_requests_delivery_mode_check CHECK (((delivery_mode)::text = ANY ((ARRAY['whatsapp'::character varying, 'inbox_interna'::character varying])::text[]))),
    CONSTRAINT human_api_requests_status_check CHECK (((status)::text = ANY ((ARRAY['pending'::character varying, 'answered'::character varying, 'timeout'::character varying, 'ignored'::character varying])::text[])))
);


ALTER TABLE public.human_api_requests OWNER TO newwhats;

--
-- Name: human_api_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.human_api_requests_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.human_api_requests_id_seq OWNER TO newwhats;

--
-- Name: human_api_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.human_api_requests_id_seq OWNED BY public.human_api_requests.id;


--
-- Name: internal_messages; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.internal_messages (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    thread_id character varying(64) NOT NULL,
    from_account integer,
    to_account integer,
    sector_id integer,
    type character varying(20) DEFAULT 'collaboration'::character varying NOT NULL,
    content text NOT NULL,
    ref_id character varying(64),
    read_at timestamp with time zone,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    chat_id character varying(128),
    CONSTRAINT internal_messages_type_check CHECK (((type)::text = ANY ((ARRAY['human_api'::character varying, 'escalation'::character varying, 'collaboration'::character varying, 'system'::character varying, 'help_request'::character varying])::text[])))
);


ALTER TABLE public.internal_messages OWNER TO newwhats;

--
-- Name: internal_messages_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.internal_messages_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.internal_messages_id_seq OWNER TO newwhats;

--
-- Name: internal_messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.internal_messages_id_seq OWNED BY public.internal_messages.id;


--
-- Name: job_applications; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.job_applications (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    job_id integer NOT NULL,
    resume_id integer,
    applicant_nome text NOT NULL,
    applicant_email text,
    applicant_phone text,
    applicant_cpf text NOT NULL,
    cover_letter text,
    status text DEFAULT 'novo'::text NOT NULL,
    admin_notes text,
    applied_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.job_applications OWNER TO newwhats;

--
-- Name: job_applications_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.job_applications_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.job_applications_id_seq OWNER TO newwhats;

--
-- Name: job_applications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.job_applications_id_seq OWNED BY public.job_applications.id;


--
-- Name: jobs; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.jobs (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    title text NOT NULL,
    description text NOT NULL,
    requirements text,
    benefits text,
    location text,
    work_mode text DEFAULT 'presencial'::text NOT NULL,
    job_type text DEFAULT 'clt'::text NOT NULL,
    category text,
    salary_min numeric(10,2),
    salary_max numeric(10,2),
    salary_hide boolean DEFAULT false NOT NULL,
    slots integer DEFAULT 1 NOT NULL,
    active boolean DEFAULT true NOT NULL,
    published_at timestamp with time zone DEFAULT now(),
    expires_at timestamp with time zone,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.jobs OWNER TO newwhats;

--
-- Name: jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.jobs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.jobs_id_seq OWNER TO newwhats;

--
-- Name: jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.jobs_id_seq OWNED BY public.jobs.id;


--
-- Name: knowledge_learning; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.knowledge_learning (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    sector_id integer,
    account_id integer,
    question text NOT NULL,
    answer text NOT NULL,
    promoted boolean DEFAULT false NOT NULL,
    promoted_at timestamp with time zone,
    use_count integer DEFAULT 0 NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.knowledge_learning OWNER TO newwhats;

--
-- Name: knowledge_learning_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.knowledge_learning_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.knowledge_learning_id_seq OWNER TO newwhats;

--
-- Name: knowledge_learning_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.knowledge_learning_id_seq OWNED BY public.knowledge_learning.id;


--
-- Name: mensagens_internas; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.mensagens_internas (
    id integer NOT NULL,
    tenant_id integer DEFAULT 1 NOT NULL,
    pedido_id integer,
    setor character varying(30) DEFAULT 'geral'::character varying NOT NULL,
    remetente character varying(120) NOT NULL,
    mensagem text NOT NULL,
    lida boolean DEFAULT false NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    chat_id character varying(120),
    CONSTRAINT mensagens_internas_setor_check CHECK (((setor)::text = ANY ((ARRAY['geral'::character varying, 'atendimento'::character varying, 'cotacao'::character varying, 'separacao'::character varying, 'embalagem'::character varying, 'auditoria'::character varying, 'fiscal'::character varying, 'expedicao'::character varying, 'financeiro'::character varying, 'suporte'::character varying])::text[])))
);


ALTER TABLE public.mensagens_internas OWNER TO newwhats;

--
-- Name: mensagens_internas_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.mensagens_internas_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.mensagens_internas_id_seq OWNER TO newwhats;

--
-- Name: mensagens_internas_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.mensagens_internas_id_seq OWNED BY public.mensagens_internas.id;


--
-- Name: notification_errors; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.notification_errors (
    id integer NOT NULL,
    job_id character varying(64),
    log_id integer,
    phone character varying(20),
    type character varying(64),
    error_message text,
    payload jsonb,
    tenant_id integer,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.notification_errors OWNER TO newwhats;

--
-- Name: notification_errors_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.notification_errors_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.notification_errors_id_seq OWNER TO newwhats;

--
-- Name: notification_errors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.notification_errors_id_seq OWNED BY public.notification_errors.id;


--
-- Name: notifications; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.notifications (
    id integer NOT NULL,
    user_cpf text NOT NULL,
    title text NOT NULL,
    message text NOT NULL,
    type text DEFAULT 'info'::text,
    read_at timestamp with time zone,
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.notifications OWNER TO newwhats;

--
-- Name: notifications_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.notifications_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.notifications_id_seq OWNER TO newwhats;

--
-- Name: notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.notifications_id_seq OWNED BY public.notifications.id;


--
-- Name: nw_auto_replies; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.nw_auto_replies (
    id integer NOT NULL,
    instance_id character varying(128) NOT NULL,
    chat_id character varying(256) NOT NULL,
    conv_id character varying(64),
    user_msg text,
    reply text,
    status character varying(20) DEFAULT 'sent'::character varying NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    tenant_id integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.nw_auto_replies OWNER TO newwhats;

--
-- Name: nw_auto_replies_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.nw_auto_replies_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.nw_auto_replies_id_seq OWNER TO newwhats;

--
-- Name: nw_auto_replies_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.nw_auto_replies_id_seq OWNED BY public.nw_auto_replies.id;


--
-- Name: nw_chat_sectors; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.nw_chat_sectors (
    chat_id text NOT NULL,
    tenant_id integer NOT NULL,
    sector_id integer,
    updated_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.nw_chat_sectors OWNER TO newwhats;

--
-- Name: nw_event_logs; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.nw_event_logs (
    id integer NOT NULL,
    instance_id character varying(128) DEFAULT ''::character varying NOT NULL,
    event character varying(64) NOT NULL,
    direction character varying(8) DEFAULT 'in'::character varying NOT NULL,
    chat_id character varying(128),
    from_me boolean DEFAULT false NOT NULL,
    msg_type character varying(32),
    payload jsonb,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    tenant_id integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.nw_event_logs OWNER TO newwhats;

--
-- Name: nw_event_logs_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.nw_event_logs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.nw_event_logs_id_seq OWNER TO newwhats;

--
-- Name: nw_event_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.nw_event_logs_id_seq OWNED BY public.nw_event_logs.id;


--
-- Name: nw_handoff; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.nw_handoff (
    chat_id text NOT NULL,
    tenant_id integer NOT NULL,
    human_until timestamp with time zone,
    updated_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.nw_handoff OWNER TO newwhats;

--
-- Name: nw_router_metrics; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.nw_router_metrics (
    id bigint NOT NULL,
    created_at timestamp with time zone DEFAULT now(),
    chat_id text NOT NULL,
    handler text NOT NULL,
    intent text,
    user_msg text,
    reply_chars integer,
    ctx_chars integer,
    saved_chars integer
);


ALTER TABLE public.nw_router_metrics OWNER TO newwhats;

--
-- Name: nw_router_metrics_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.nw_router_metrics_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.nw_router_metrics_id_seq OWNER TO newwhats;

--
-- Name: nw_router_metrics_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.nw_router_metrics_id_seq OWNED BY public.nw_router_metrics.id;


--
-- Name: orders; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.orders (
    id text NOT NULL,
    customer_id text,
    user_cpf text NOT NULL,
    total_amount numeric(10,2) NOT NULL,
    status text DEFAULT 'pending'::text,
    payment_method text DEFAULT 'PIX'::text,
    qr_code text,
    qr_code_url text,
    pix_copy_paste text,
    created_at timestamp with time zone DEFAULT now(),
    updated_at timestamp with time zone DEFAULT now(),
    asaas_payment_id text,
    tenant_id integer,
    CONSTRAINT orders_status_check CHECK ((status = ANY (ARRAY['pending'::text, 'paid'::text, 'canceled'::text, 'expired'::text])))
);


ALTER TABLE public.orders OWNER TO newwhats;

--
-- Name: password_reset_tokens; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.password_reset_tokens (
    id integer NOT NULL,
    user_id integer NOT NULL,
    token character varying(128) NOT NULL,
    expires_at timestamp with time zone NOT NULL,
    used boolean DEFAULT false NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.password_reset_tokens OWNER TO newwhats;

--
-- Name: password_reset_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.password_reset_tokens_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.password_reset_tokens_id_seq OWNER TO newwhats;

--
-- Name: password_reset_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.password_reset_tokens_id_seq OWNED BY public.password_reset_tokens.id;


--
-- Name: pedido_itens; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.pedido_itens (
    id integer NOT NULL,
    pedido_id integer NOT NULL,
    produto_id integer,
    nome_produto character varying(255) NOT NULL,
    sku character varying(100),
    quantidade numeric(10,3) DEFAULT 1 NOT NULL,
    preco_unitario numeric(10,2) NOT NULL,
    desconto_pct numeric(5,2) DEFAULT 0,
    subtotal numeric(10,2) NOT NULL,
    separado boolean DEFAULT false NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    preco_promocional numeric(10,2) DEFAULT NULL::numeric,
    observacao character varying(500),
    alerta_tipo character varying(30),
    alerta_obs character varying(500),
    alerta_foto character varying(500),
    alerta_confirmado boolean DEFAULT false,
    alerta_em timestamp with time zone
);


ALTER TABLE public.pedido_itens OWNER TO newwhats;

--
-- Name: pedido_itens_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.pedido_itens_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pedido_itens_id_seq OWNER TO newwhats;

--
-- Name: pedido_itens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.pedido_itens_id_seq OWNED BY public.pedido_itens.id;


--
-- Name: pedido_status_log; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.pedido_status_log (
    id integer NOT NULL,
    pedido_id integer NOT NULL,
    status character varying(20) NOT NULL,
    account_id integer,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.pedido_status_log OWNER TO newwhats;

--
-- Name: pedido_status_log_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.pedido_status_log_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pedido_status_log_id_seq OWNER TO newwhats;

--
-- Name: pedido_status_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.pedido_status_log_id_seq OWNED BY public.pedido_status_log.id;


--
-- Name: pedidos; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.pedidos (
    id integer NOT NULL,
    tenant_id integer DEFAULT 1 NOT NULL,
    cotacao_id integer,
    cliente_id integer,
    user_id integer,
    endereco_id integer,
    status character varying(20) DEFAULT 'aguardando'::character varying NOT NULL,
    forma_pagto character varying(20),
    tipo_entrega character varying(20) DEFAULT 'retirada'::character varying NOT NULL,
    total numeric(10,2) DEFAULT 0 NOT NULL,
    desconto numeric(10,2) DEFAULT 0 NOT NULL,
    observacao text,
    equipe_id integer,
    responsavel_entrega text,
    entregue_em timestamp with time zone,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    embalador text,
    embalado_em timestamp with time zone,
    protocolo character varying(30),
    end_cep character varying(10),
    end_rua character varying(255),
    end_numero character varying(20),
    end_complemento character varying(100),
    end_bairro character varying(100),
    end_cidade character varying(100),
    end_estado character varying(2),
    financeiro_status character varying(20),
    financeiro_obs text,
    financeiro_em timestamp with time zone,
    embalador_id bigint,
    expedidor_id bigint,
    separador_id bigint,
    auditor_id bigint,
    fiscal_id bigint,
    cupom_numero character varying(60),
    cupom_chave character varying(64),
    cupom_emitido_em timestamp with time zone,
    cupom_emitido_por bigint,
    expedidor_saida_em timestamp with time zone,
    CONSTRAINT pedidos_financeiro_status_check CHECK (((financeiro_status)::text = ANY ((ARRAY['pendente'::character varying, 'aprovado'::character varying, 'rejeitado'::character varying])::text[]))),
    CONSTRAINT pedidos_forma_pagto_check CHECK (((forma_pagto)::text = ANY ((ARRAY['pix'::character varying, 'cartao'::character varying, 'faturado'::character varying, 'na_retirada'::character varying, 'na_entrega'::character varying])::text[]))),
    CONSTRAINT pedidos_status_check CHECK (((status)::text = ANY ((ARRAY['aguardando'::character varying, 'separacao'::character varying, 'embalagem'::character varying, 'auditoria'::character varying, 'fiscal'::character varying, 'expedicao'::character varying, 'entregue'::character varying, 'cancelado'::character varying])::text[]))),
    CONSTRAINT pedidos_tipo_entrega_check CHECK (((tipo_entrega)::text = ANY ((ARRAY['retirada'::character varying, 'entrega'::character varying])::text[])))
);


ALTER TABLE public.pedidos OWNER TO newwhats;

--
-- Name: pedidos_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.pedidos_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pedidos_id_seq OWNER TO newwhats;

--
-- Name: pedidos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.pedidos_id_seq OWNED BY public.pedidos.id;


--
-- Name: pedidos_recorrentes; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.pedidos_recorrentes (
    id integer NOT NULL,
    tenant_id integer DEFAULT 1 NOT NULL,
    user_id integer,
    cliente_id integer,
    nome character varying(200) DEFAULT 'Pedido Recorrente'::character varying NOT NULL,
    itens jsonb DEFAULT '[]'::jsonb NOT NULL,
    frequencia character varying(20) DEFAULT 'mensal'::character varying NOT NULL,
    proximo_em date NOT NULL,
    ativo boolean DEFAULT true NOT NULL,
    pausado boolean DEFAULT false NOT NULL,
    created_at timestamp with time zone DEFAULT now(),
    updated_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.pedidos_recorrentes OWNER TO newwhats;

--
-- Name: pedidos_recorrentes_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.pedidos_recorrentes_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pedidos_recorrentes_id_seq OWNER TO newwhats;

--
-- Name: pedidos_recorrentes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.pedidos_recorrentes_id_seq OWNED BY public.pedidos_recorrentes.id;


--
-- Name: plugin_configs; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.plugin_configs (
    plugin_id text NOT NULL,
    key text NOT NULL,
    value text
);


ALTER TABLE public.plugin_configs OWNER TO newwhats;

--
-- Name: plugins; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.plugins (
    id text NOT NULL,
    active integer DEFAULT 0,
    installed_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.plugins OWNER TO newwhats;

--
-- Name: price_logs; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.price_logs (
    id integer NOT NULL,
    raffle_id integer NOT NULL,
    order_id text,
    user_cpf text,
    price_applied numeric(10,2) NOT NULL,
    rule_id integer,
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.price_logs OWNER TO newwhats;

--
-- Name: price_logs_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.price_logs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.price_logs_id_seq OWNER TO newwhats;

--
-- Name: price_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.price_logs_id_seq OWNED BY public.price_logs.id;


--
-- Name: produtos; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.produtos (
    id integer NOT NULL,
    tenant_id integer DEFAULT 1 NOT NULL,
    sku character varying(100),
    nome character varying(255) NOT NULL,
    descricao text,
    unidade character varying(20) DEFAULT 'un'::character varying,
    preco numeric(10,2) DEFAULT 0 NOT NULL,
    estoque numeric(10,3) DEFAULT 0 NOT NULL,
    categoria character varying(100),
    imagem text,
    ativo boolean DEFAULT true NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    preco_promocional numeric(10,2) DEFAULT NULL::numeric
);


ALTER TABLE public.produtos OWNER TO newwhats;

--
-- Name: produtos_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.produtos_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.produtos_id_seq OWNER TO newwhats;

--
-- Name: produtos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.produtos_id_seq OWNED BY public.produtos.id;


--
-- Name: promotions; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.promotions (
    id integer NOT NULL,
    nome text NOT NULL,
    descricao text,
    preco_original numeric(10,2),
    preco_promocional numeric(10,2) NOT NULL,
    imagem text DEFAULT ''::text,
    ativo boolean DEFAULT true,
    data_criacao timestamp with time zone DEFAULT now(),
    tenant_id integer
);


ALTER TABLE public.promotions OWNER TO newwhats;

--
-- Name: promotions_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.promotions_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.promotions_id_seq OWNER TO newwhats;

--
-- Name: promotions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.promotions_id_seq OWNED BY public.promotions.id;


--
-- Name: protocol_flags; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.protocol_flags (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    thread_id character varying(64) NOT NULL,
    account_id integer,
    type character varying(20) DEFAULT 'complaint'::character varying NOT NULL,
    note text,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    CONSTRAINT protocol_flags_type_check CHECK (((type)::text = ANY ((ARRAY['complaint'::character varying, 'suggestion'::character varying, 'compliment'::character varying])::text[])))
);


ALTER TABLE public.protocol_flags OWNER TO newwhats;

--
-- Name: protocol_flags_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.protocol_flags_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.protocol_flags_id_seq OWNER TO newwhats;

--
-- Name: protocol_flags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.protocol_flags_id_seq OWNED BY public.protocol_flags.id;


--
-- Name: protocol_ratings; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.protocol_ratings (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    thread_id character varying(64) NOT NULL,
    chat_id text NOT NULL,
    account_id integer,
    rating smallint,
    status character varying(20) DEFAULT 'pending'::character varying NOT NULL,
    sent_at timestamp with time zone DEFAULT now() NOT NULL,
    rated_at timestamp with time zone,
    CONSTRAINT protocol_ratings_rating_check CHECK (((rating >= 1) AND (rating <= 5))),
    CONSTRAINT protocol_ratings_status_check CHECK (((status)::text = ANY ((ARRAY['pending'::character varying, 'rated'::character varying, 'expired'::character varying])::text[])))
);


ALTER TABLE public.protocol_ratings OWNER TO newwhats;

--
-- Name: protocol_ratings_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.protocol_ratings_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.protocol_ratings_id_seq OWNER TO newwhats;

--
-- Name: protocol_ratings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.protocol_ratings_id_seq OWNED BY public.protocol_ratings.id;


--
-- Name: raffle_claims; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.raffle_claims (
    id integer NOT NULL,
    raffle_id integer NOT NULL,
    ticket_id integer NOT NULL,
    user_cpf text NOT NULL,
    status text DEFAULT 'pending'::text,
    delivery_address text,
    delivery_notes text,
    claimed_at timestamp with time zone DEFAULT now(),
    updated_at timestamp with time zone DEFAULT now(),
    notified_at timestamp with time zone,
    CONSTRAINT raffle_claims_status_check CHECK ((status = ANY (ARRAY['pending'::text, 'approved'::text, 'delivered'::text])))
);


ALTER TABLE public.raffle_claims OWNER TO newwhats;

--
-- Name: raffle_claims_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.raffle_claims_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.raffle_claims_id_seq OWNER TO newwhats;

--
-- Name: raffle_claims_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.raffle_claims_id_seq OWNED BY public.raffle_claims.id;


--
-- Name: raffle_discounts; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.raffle_discounts (
    id integer NOT NULL,
    raffle_id integer NOT NULL,
    min_qty integer NOT NULL,
    discount_pct numeric(5,2) NOT NULL,
    active boolean DEFAULT true NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    CONSTRAINT raffle_discounts_discount_pct_check CHECK (((discount_pct > (0)::numeric) AND (discount_pct <= (100)::numeric))),
    CONSTRAINT raffle_discounts_min_qty_check CHECK ((min_qty >= 2))
);


ALTER TABLE public.raffle_discounts OWNER TO newwhats;

--
-- Name: raffle_discounts_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.raffle_discounts_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.raffle_discounts_id_seq OWNER TO newwhats;

--
-- Name: raffle_discounts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.raffle_discounts_id_seq OWNED BY public.raffle_discounts.id;


--
-- Name: raffle_draw_logs; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.raffle_draw_logs (
    id integer NOT NULL,
    raffle_id integer NOT NULL,
    seed text,
    result_number integer,
    executed_at timestamp with time zone DEFAULT now(),
    ip text,
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.raffle_draw_logs OWNER TO newwhats;

--
-- Name: raffle_draw_logs_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.raffle_draw_logs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.raffle_draw_logs_id_seq OWNER TO newwhats;

--
-- Name: raffle_draw_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.raffle_draw_logs_id_seq OWNED BY public.raffle_draw_logs.id;


--
-- Name: raffle_flash_promos; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.raffle_flash_promos (
    id integer NOT NULL,
    raffle_id integer NOT NULL,
    discount_pct numeric(5,2) NOT NULL,
    label character varying(255) DEFAULT 'Promoção Relâmpago'::character varying NOT NULL,
    starts_at timestamp with time zone DEFAULT now() NOT NULL,
    ends_at timestamp with time zone NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    CONSTRAINT raffle_flash_promos_discount_pct_check CHECK (((discount_pct > (0)::numeric) AND (discount_pct <= (100)::numeric)))
);


ALTER TABLE public.raffle_flash_promos OWNER TO newwhats;

--
-- Name: raffle_flash_promos_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.raffle_flash_promos_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.raffle_flash_promos_id_seq OWNER TO newwhats;

--
-- Name: raffle_flash_promos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.raffle_flash_promos_id_seq OWNED BY public.raffle_flash_promos.id;


--
-- Name: raffle_price_rules; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.raffle_price_rules (
    id integer NOT NULL,
    raffle_id integer NOT NULL,
    rule_type text NOT NULL,
    price numeric(10,2) NOT NULL,
    start_at timestamp with time zone,
    end_at timestamp with time zone,
    priority integer DEFAULT 0,
    created_at timestamp with time zone DEFAULT now(),
    active integer DEFAULT 1,
    CONSTRAINT raffle_price_rules_rule_type_check CHECK ((rule_type = ANY (ARRAY['fixed'::text, 'time_range'::text])))
);


ALTER TABLE public.raffle_price_rules OWNER TO newwhats;

--
-- Name: raffle_price_rules_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.raffle_price_rules_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.raffle_price_rules_id_seq OWNER TO newwhats;

--
-- Name: raffle_price_rules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.raffle_price_rules_id_seq OWNED BY public.raffle_price_rules.id;


--
-- Name: raffle_results; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.raffle_results (
    id integer NOT NULL,
    raffle_id integer NOT NULL,
    winner_ticket_id integer NOT NULL,
    seed text NOT NULL,
    algorithm_version text DEFAULT '1.0'::text,
    drawn_at timestamp with time zone DEFAULT now(),
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.raffle_results OWNER TO newwhats;

--
-- Name: raffle_results_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.raffle_results_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.raffle_results_id_seq OWNER TO newwhats;

--
-- Name: raffle_results_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.raffle_results_id_seq OWNED BY public.raffle_results.id;


--
-- Name: raffles; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.raffles (
    id integer NOT NULL,
    titulo text NOT NULL,
    descricao text,
    preco_numero numeric(10,2) DEFAULT 5.00,
    total_numeros integer DEFAULT 500,
    status text DEFAULT 'active'::text,
    ativo integer DEFAULT 1,
    data_criacao timestamp with time zone DEFAULT now(),
    start_at timestamp with time zone,
    end_at timestamp with time zone,
    last_hours_notif_sent timestamp with time zone,
    tenant_id integer,
    CONSTRAINT raffles_status_check CHECK ((status = ANY (ARRAY['draft'::text, 'active'::text, 'finished'::text])))
);


ALTER TABLE public.raffles OWNER TO newwhats;

--
-- Name: raffles_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.raffles_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.raffles_id_seq OWNER TO newwhats;

--
-- Name: raffles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.raffles_id_seq OWNED BY public.raffles.id;


--
-- Name: resumes; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.resumes (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    user_cpf text NOT NULL,
    user_nome text NOT NULL,
    email text,
    phone text,
    linkedin text,
    portfolio text,
    about text,
    experience jsonb DEFAULT '[]'::jsonb NOT NULL,
    education jsonb DEFAULT '[]'::jsonb NOT NULL,
    skills jsonb DEFAULT '[]'::jsonb NOT NULL,
    file_url text,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.resumes OWNER TO newwhats;

--
-- Name: resumes_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.resumes_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.resumes_id_seq OWNER TO newwhats;

--
-- Name: resumes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.resumes_id_seq OWNED BY public.resumes.id;


--
-- Name: sector_brain_nodes; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.sector_brain_nodes (
    id integer NOT NULL,
    sector_id integer NOT NULL,
    type character varying(20) DEFAULT 'knowledge'::character varying NOT NULL,
    content text NOT NULL,
    sort_order integer DEFAULT 0 NOT NULL,
    active boolean DEFAULT true NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    tags text[] DEFAULT '{}'::text[],
    CONSTRAINT sector_brain_nodes_type_check CHECK (((type)::text = ANY ((ARRAY['knowledge'::character varying, 'rules'::character varying, 'escalation'::character varying, 'persona'::character varying])::text[])))
);


ALTER TABLE public.sector_brain_nodes OWNER TO newwhats;

--
-- Name: sector_brain_nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.sector_brain_nodes_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sector_brain_nodes_id_seq OWNER TO newwhats;

--
-- Name: sector_brain_nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.sector_brain_nodes_id_seq OWNED BY public.sector_brain_nodes.id;


--
-- Name: sectors; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.sectors (
    id integer NOT NULL,
    tenant_id integer NOT NULL,
    name character varying(255) NOT NULL,
    description text,
    icon character varying(80) DEFAULT 'Briefcase'::character varying NOT NULL,
    color character varying(20) DEFAULT '#6366f1'::character varying NOT NULL,
    sla_minutes integer DEFAULT 60 NOT NULL,
    sort_order integer DEFAULT 0 NOT NULL,
    active boolean DEFAULT true NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.sectors OWNER TO newwhats;

--
-- Name: sectors_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.sectors_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sectors_id_seq OWNER TO newwhats;

--
-- Name: sectors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.sectors_id_seq OWNED BY public.sectors.id;


--
-- Name: super_admins; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.super_admins (
    id integer NOT NULL,
    email character varying(255) NOT NULL,
    password_hash character varying(255) NOT NULL,
    name character varying(255) NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.super_admins OWNER TO newwhats;

--
-- Name: super_admins_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.super_admins_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.super_admins_id_seq OWNER TO newwhats;

--
-- Name: super_admins_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.super_admins_id_seq OWNED BY public.super_admins.id;


--
-- Name: team_members; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.team_members (
    id integer NOT NULL,
    account_id integer NOT NULL,
    sector_id integer NOT NULL,
    function character varying(255),
    is_primary boolean DEFAULT false NOT NULL,
    notify_escalation boolean DEFAULT true NOT NULL,
    notify_human_api boolean DEFAULT true NOT NULL,
    on_duty boolean DEFAULT false NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.team_members OWNER TO newwhats;

--
-- Name: team_members_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.team_members_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.team_members_id_seq OWNER TO newwhats;

--
-- Name: team_members_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.team_members_id_seq OWNED BY public.team_members.id;


--
-- Name: tenant_config; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.tenant_config (
    tenant_id integer NOT NULL,
    primary_color character varying(20) DEFAULT '#f59e0b'::character varying NOT NULL,
    secondary_color character varying(20) DEFAULT '#10b981'::character varying NOT NULL,
    logo_url text,
    favicon_url text,
    contact_email character varying(255),
    contact_phone character varying(30),
    app_url character varying(255),
    asaas_key character varying(255)
);


ALTER TABLE public.tenant_config OWNER TO newwhats;

--
-- Name: tenants; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.tenants (
    id integer NOT NULL,
    slug character varying(80) NOT NULL,
    name character varying(255) NOT NULL,
    domain character varying(255),
    active boolean DEFAULT true NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.tenants OWNER TO newwhats;

--
-- Name: tenants_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.tenants_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tenants_id_seq OWNER TO newwhats;

--
-- Name: tenants_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.tenants_id_seq OWNED BY public.tenants.id;


--
-- Name: tickets; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.tickets (
    id integer NOT NULL,
    raffle_id integer NOT NULL,
    numero integer NOT NULL,
    usuario_nome text NOT NULL,
    usuario_telefone text,
    usuario_cpf text,
    data_compra timestamp with time zone DEFAULT now(),
    status text DEFAULT 'sold'::text,
    reserved_until timestamp with time zone,
    order_id text,
    price_paid numeric(10,2),
    tenant_id integer,
    CONSTRAINT tickets_status_check CHECK ((status = ANY (ARRAY['reserved'::text, 'sold'::text])))
);


ALTER TABLE public.tickets OWNER TO newwhats;

--
-- Name: tickets_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.tickets_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tickets_id_seq OWNER TO newwhats;

--
-- Name: tickets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.tickets_id_seq OWNED BY public.tickets.id;


--
-- Name: users; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.users (
    id integer NOT NULL,
    nome text NOT NULL,
    email text,
    cpf text,
    telefone text,
    ip text,
    source text DEFAULT 'hotspot'::text,
    password_hash text,
    "timestamp" timestamp with time zone DEFAULT now(),
    whatsapp_optin boolean DEFAULT true,
    tenant_id integer,
    portal_session_id character varying(64)
);


ALTER TABLE public.users OWNER TO newwhats;

--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.users_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.users_id_seq OWNER TO newwhats;

--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;


--
-- Name: whatsapp_logs; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.whatsapp_logs (
    id integer NOT NULL,
    user_id integer,
    phone text NOT NULL,
    type text NOT NULL,
    payload text,
    status text DEFAULT 'queued'::text,
    response text,
    created_at timestamp with time zone DEFAULT now(),
    updated_at timestamp with time zone DEFAULT now(),
    tenant_id integer,
    CONSTRAINT whatsapp_logs_status_check CHECK ((status = ANY (ARRAY['queued'::text, 'processing'::text, 'sent'::text, 'failed'::text, 'retrying'::text])))
);


ALTER TABLE public.whatsapp_logs OWNER TO newwhats;

--
-- Name: whatsapp_logs_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.whatsapp_logs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.whatsapp_logs_id_seq OWNER TO newwhats;

--
-- Name: whatsapp_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.whatsapp_logs_id_seq OWNED BY public.whatsapp_logs.id;


--
-- Name: wpp_reativacao_log; Type: TABLE; Schema: public; Owner: newwhats
--

CREATE TABLE public.wpp_reativacao_log (
    id integer NOT NULL,
    tenant_id integer DEFAULT 1 NOT NULL,
    cliente_id integer,
    chat_id text NOT NULL,
    mensagem text,
    enviada_em timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.wpp_reativacao_log OWNER TO newwhats;

--
-- Name: wpp_reativacao_log_id_seq; Type: SEQUENCE; Schema: public; Owner: newwhats
--

CREATE SEQUENCE public.wpp_reativacao_log_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.wpp_reativacao_log_id_seq OWNER TO newwhats;

--
-- Name: wpp_reativacao_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: newwhats
--

ALTER SEQUENCE public.wpp_reativacao_log_id_seq OWNED BY public.wpp_reativacao_log.id;


--
-- Name: accounts id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.accounts ALTER COLUMN id SET DEFAULT nextval('public.accounts_id_seq'::regclass);


--
-- Name: admins id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.admins ALTER COLUMN id SET DEFAULT nextval('public.admins_id_seq'::regclass);


--
-- Name: benefit_clubs id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.benefit_clubs ALTER COLUMN id SET DEFAULT nextval('public.benefit_clubs_id_seq'::regclass);


--
-- Name: broadcasts id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.broadcasts ALTER COLUMN id SET DEFAULT nextval('public.broadcasts_id_seq'::regclass);


--
-- Name: cliente_enderecos id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cliente_enderecos ALTER COLUMN id SET DEFAULT nextval('public.cliente_enderecos_id_seq'::regclass);


--
-- Name: cliente_responsaveis id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cliente_responsaveis ALTER COLUMN id SET DEFAULT nextval('public.cliente_responsaveis_id_seq'::regclass);


--
-- Name: cliente_telefones id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cliente_telefones ALTER COLUMN id SET DEFAULT nextval('public.cliente_telefones_id_seq'::regclass);


--
-- Name: clientes id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.clientes ALTER COLUMN id SET DEFAULT nextval('public.clientes_id_seq'::regclass);


--
-- Name: club_dependents id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_dependents ALTER COLUMN id SET DEFAULT nextval('public.club_dependents_id_seq'::regclass);


--
-- Name: club_faqs id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_faqs ALTER COLUMN id SET DEFAULT nextval('public.club_faqs_id_seq'::regclass);


--
-- Name: club_members id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_members ALTER COLUMN id SET DEFAULT nextval('public.club_members_id_seq'::regclass);


--
-- Name: club_partners id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_partners ALTER COLUMN id SET DEFAULT nextval('public.club_partners_id_seq'::regclass);


--
-- Name: club_payments id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_payments ALTER COLUMN id SET DEFAULT nextval('public.club_payments_id_seq'::regclass);


--
-- Name: club_plans id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_plans ALTER COLUMN id SET DEFAULT nextval('public.club_plans_id_seq'::regclass);


--
-- Name: cotacao_flash_promos id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacao_flash_promos ALTER COLUMN id SET DEFAULT nextval('public.cotacao_flash_promos_id_seq'::regclass);


--
-- Name: cotacao_itens id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacao_itens ALTER COLUMN id SET DEFAULT nextval('public.cotacao_itens_id_seq'::regclass);


--
-- Name: cotacoes id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacoes ALTER COLUMN id SET DEFAULT nextval('public.cotacoes_id_seq'::regclass);


--
-- Name: direct_messages id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.direct_messages ALTER COLUMN id SET DEFAULT nextval('public.direct_messages_id_seq'::regclass);


--
-- Name: group_chats id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_chats ALTER COLUMN id SET DEFAULT nextval('public.group_chats_id_seq'::regclass);


--
-- Name: group_messages id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_messages ALTER COLUMN id SET DEFAULT nextval('public.group_messages_id_seq'::regclass);


--
-- Name: human_api_requests id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.human_api_requests ALTER COLUMN id SET DEFAULT nextval('public.human_api_requests_id_seq'::regclass);


--
-- Name: internal_messages id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.internal_messages ALTER COLUMN id SET DEFAULT nextval('public.internal_messages_id_seq'::regclass);


--
-- Name: job_applications id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.job_applications ALTER COLUMN id SET DEFAULT nextval('public.job_applications_id_seq'::regclass);


--
-- Name: jobs id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.jobs ALTER COLUMN id SET DEFAULT nextval('public.jobs_id_seq'::regclass);


--
-- Name: knowledge_learning id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.knowledge_learning ALTER COLUMN id SET DEFAULT nextval('public.knowledge_learning_id_seq'::regclass);


--
-- Name: mensagens_internas id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.mensagens_internas ALTER COLUMN id SET DEFAULT nextval('public.mensagens_internas_id_seq'::regclass);


--
-- Name: notification_errors id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.notification_errors ALTER COLUMN id SET DEFAULT nextval('public.notification_errors_id_seq'::regclass);


--
-- Name: notifications id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.notifications ALTER COLUMN id SET DEFAULT nextval('public.notifications_id_seq'::regclass);


--
-- Name: nw_auto_replies id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.nw_auto_replies ALTER COLUMN id SET DEFAULT nextval('public.nw_auto_replies_id_seq'::regclass);


--
-- Name: nw_event_logs id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.nw_event_logs ALTER COLUMN id SET DEFAULT nextval('public.nw_event_logs_id_seq'::regclass);


--
-- Name: nw_router_metrics id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.nw_router_metrics ALTER COLUMN id SET DEFAULT nextval('public.nw_router_metrics_id_seq'::regclass);


--
-- Name: password_reset_tokens id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.password_reset_tokens ALTER COLUMN id SET DEFAULT nextval('public.password_reset_tokens_id_seq'::regclass);


--
-- Name: pedido_itens id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedido_itens ALTER COLUMN id SET DEFAULT nextval('public.pedido_itens_id_seq'::regclass);


--
-- Name: pedido_status_log id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedido_status_log ALTER COLUMN id SET DEFAULT nextval('public.pedido_status_log_id_seq'::regclass);


--
-- Name: pedidos id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos ALTER COLUMN id SET DEFAULT nextval('public.pedidos_id_seq'::regclass);


--
-- Name: pedidos_recorrentes id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos_recorrentes ALTER COLUMN id SET DEFAULT nextval('public.pedidos_recorrentes_id_seq'::regclass);


--
-- Name: price_logs id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.price_logs ALTER COLUMN id SET DEFAULT nextval('public.price_logs_id_seq'::regclass);


--
-- Name: produtos id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.produtos ALTER COLUMN id SET DEFAULT nextval('public.produtos_id_seq'::regclass);


--
-- Name: promotions id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.promotions ALTER COLUMN id SET DEFAULT nextval('public.promotions_id_seq'::regclass);


--
-- Name: protocol_flags id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.protocol_flags ALTER COLUMN id SET DEFAULT nextval('public.protocol_flags_id_seq'::regclass);


--
-- Name: protocol_ratings id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.protocol_ratings ALTER COLUMN id SET DEFAULT nextval('public.protocol_ratings_id_seq'::regclass);


--
-- Name: raffle_claims id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_claims ALTER COLUMN id SET DEFAULT nextval('public.raffle_claims_id_seq'::regclass);


--
-- Name: raffle_discounts id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_discounts ALTER COLUMN id SET DEFAULT nextval('public.raffle_discounts_id_seq'::regclass);


--
-- Name: raffle_draw_logs id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_draw_logs ALTER COLUMN id SET DEFAULT nextval('public.raffle_draw_logs_id_seq'::regclass);


--
-- Name: raffle_flash_promos id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_flash_promos ALTER COLUMN id SET DEFAULT nextval('public.raffle_flash_promos_id_seq'::regclass);


--
-- Name: raffle_price_rules id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_price_rules ALTER COLUMN id SET DEFAULT nextval('public.raffle_price_rules_id_seq'::regclass);


--
-- Name: raffle_results id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_results ALTER COLUMN id SET DEFAULT nextval('public.raffle_results_id_seq'::regclass);


--
-- Name: raffles id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffles ALTER COLUMN id SET DEFAULT nextval('public.raffles_id_seq'::regclass);


--
-- Name: resumes id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.resumes ALTER COLUMN id SET DEFAULT nextval('public.resumes_id_seq'::regclass);


--
-- Name: sector_brain_nodes id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.sector_brain_nodes ALTER COLUMN id SET DEFAULT nextval('public.sector_brain_nodes_id_seq'::regclass);


--
-- Name: sectors id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.sectors ALTER COLUMN id SET DEFAULT nextval('public.sectors_id_seq'::regclass);


--
-- Name: super_admins id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.super_admins ALTER COLUMN id SET DEFAULT nextval('public.super_admins_id_seq'::regclass);


--
-- Name: team_members id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.team_members ALTER COLUMN id SET DEFAULT nextval('public.team_members_id_seq'::regclass);


--
-- Name: tenants id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.tenants ALTER COLUMN id SET DEFAULT nextval('public.tenants_id_seq'::regclass);


--
-- Name: tickets id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.tickets ALTER COLUMN id SET DEFAULT nextval('public.tickets_id_seq'::regclass);


--
-- Name: users id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);


--
-- Name: whatsapp_logs id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.whatsapp_logs ALTER COLUMN id SET DEFAULT nextval('public.whatsapp_logs_id_seq'::regclass);


--
-- Name: wpp_reativacao_log id; Type: DEFAULT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.wpp_reativacao_log ALTER COLUMN id SET DEFAULT nextval('public.wpp_reativacao_log_id_seq'::regclass);


--
-- Data for Name: accounts; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.accounts (id, tenant_id, name, email, password_hash, role, phone, phone_connected, availability, avatar_url, active, created_at, nw_team_id, nw_sector_id) FROM stdin;
7	1	Priscila Ramos	priscila@alemao.local	$2a$10$FaMXnFwK0iupb2TZUmbbOOTlWW3eotkucAzQ6v8rzZmKqo4emDLkm	agent	\N	f	offline	\N	t	2026-04-29 09:56:00.142126-04	\N	\N
8	1	Diego Mendonça	diego.sep@alemao.local	$2a$10$mkIYL3LaJePSiAjNHsFBGOBNr.CCqPdb0dB2PLQ8Zr9t47WZGLG.e	supervisor	\N	f	offline	\N	t	2026-04-29 09:56:00.256428-04	\N	\N
9	1	Tatiane Oliveira	tatiane@alemao.local	$2a$10$kl0ECRwyF2WTWAx/acDCiOuNQMfcQ7Mw9T9CCeUiTCVY3Oa3IpkM.	agent	\N	f	offline	\N	t	2026-04-29 09:56:00.381652-04	\N	\N
10	1	Jonatas Ferreira	jonatas@alemao.local	$2a$10$dG86DLFuX2/xRU3kLb/jwOXwHontzLEHvJ17sWuwcn0IdfWLXbqBa	agent	\N	f	offline	\N	t	2026-04-29 09:56:00.489343-04	\N	\N
11	1	Roberta Nascimento	roberta.emb@alemao.local	$2a$10$OHtiGZewp9W3tGf.Ysd/1.7x0eqJGUnVzciVk45wEyBiCWExkvPxS	supervisor	\N	f	offline	\N	t	2026-04-29 09:56:00.595868-04	\N	\N
12	1	Paulo Henrique Silva	paulo.emb@alemao.local	$2a$10$flsFXynEZ80yQuH3PFzI1uo0ElhuE.JqB9i4wG9Ij2Y5vuLXc90ey	agent	\N	f	offline	\N	t	2026-04-29 09:56:00.716449-04	\N	\N
13	1	Aline Torres	aline.emb@alemao.local	$2a$10$CjA6fh676QzFxjC0BLAY8.ud8ke/EYJT9Z00GCbsbJYNcDtI7mL62	agent	\N	f	offline	\N	t	2026-04-29 09:56:00.823586-04	\N	\N
14	1	Ricardo Barbosa	ricardo.aud@alemao.local	$2a$10$tIyDGnThn7di5xcCmTWfEOxTfeJNERxcOvohBxLDmbce1FwS/3hv2	supervisor	\N	f	offline	\N	t	2026-04-29 09:56:00.933264-04	\N	\N
15	1	Camila Freitas	camila.aud@alemao.local	$2a$10$BTvBiG1o4pWzgvfqf5CzWusMzh4awmqkmkiLxaTxQ.q/xsyiUJPl2	agent	\N	f	offline	\N	t	2026-04-29 09:56:01.056242-04	\N	\N
16	1	Luciana Pereira	luciana.fis@alemao.local	$2a$10$QB0hLyCThKqtye4BN23BDOAYnas.6Y8I4supvc1ggStUmCgPBmoym	supervisor	\N	f	offline	\N	t	2026-04-29 09:56:01.198786-04	\N	\N
17	1	Henrique Cardoso	henrique.fis@alemao.local	$2a$10$injydg.FTrvTu8VNEpH2YeYunJ4RQafx6zaQc1WhpyDzJhUcbSA9W	agent	\N	f	offline	\N	t	2026-04-29 09:56:01.339998-04	\N	\N
18	1	Rodrigo Santana	rodrigo.exp@alemao.local	$2a$10$d3xupQKkxW43BcdLAgrpuOaQZX4Z/nIiS9BuLFnZbhNIMljzbKnNq	supervisor	\N	f	offline	\N	t	2026-04-29 09:56:01.498487-04	\N	\N
19	1	Vanessa Melo	vanessa.exp@alemao.local	$2a$10$iK5dOPV5lDpiWIjv/EUUfOfA3OdRU/c0rB5HmWnRugogKBwu.anZK	agent	\N	f	offline	\N	t	2026-04-29 09:56:01.704081-04	\N	\N
20	1	Bruno Castro	bruno.exp@alemao.local	$2a$10$53/7ULPDcqLsv5hhOSnC7ekJEXIB6QD9BOK53gnEH.o1XzJkTaOjm	agent	\N	f	offline	\N	t	2026-04-29 09:56:01.833404-04	\N	\N
21	1	Juliana Monteiro	juliana.fin@alemao.local	$2a$10$9UfrIuI.g00ZZp3N0DQLteNjNZETQMMREu.LBSNAkmhJbEG4G.VwG	manager	\N	f	offline	\N	t	2026-04-29 09:56:01.938169-04	\N	\N
22	1	Thiago Andrade	thiago.fin@alemao.local	$2a$10$eFuA0aLjaerXPztg7do7j.KFWBPko2LqwnB7rL8kZU5D31eCwx4Ua	agent	\N	f	offline	\N	t	2026-04-29 09:56:02.041559-04	\N	\N
23	1	Natália Gomes	natalia.sup@alemao.local	$2a$10$bmAqey2HLwfC./JggD/2HOgJC80xyLb5JJ6Qp71QelKwlGAd8UBhe	supervisor	\N	f	offline	\N	t	2026-04-29 09:56:02.147216-04	\N	\N
24	1	Leonardo Araújo	leonardo.sup@alemao.local	$2a$10$ZzwXxRnrYQtokPy0ybFsuuPLPFlBJba2ykPL60ujMRIq07rtc7hx.	agent	\N	f	offline	\N	t	2026-04-29 09:56:02.256822-04	\N	\N
2	1	Rui Cesar	ruibto@gmail.com	$2a$10$ZkIAixjDwLPnBwYNM0Yl0ejQdorEDkJuhVbmgCJMnBvB.vhTAzmTu	manager	5567999222377	f	online	\N	t	2026-04-22 22:39:48.350529-04	\N	\N
1	1	Monique Fernandes	monique13fa@gmail.com	$2a$10$EANYlGfjixLp6jU0FJ0kc.8e8JmN7JS/ChsAjZA5BjG0tX4LbLphm	secretary	\N	f	offline	\N	t	2026-04-19 20:32:35.050246-04	\N	\N
3	1	Ana Paula Souza	ana.paula@alemao.local	$2a$10$7MXJaScgLXHSfoxj0PzLFulfHL.Jy39.FXAcvZa7dwfuy7EParg7i	supervisor	\N	f	offline	\N	t	2026-04-29 09:55:59.686817-04	\N	\N
4	1	Carlos Eduardo Lima	carlos.lima@alemao.local	$2a$10$rx4gdmTArLdmLxuTZSCQ2.FnxB5qR9.wNDn.38VDYA8EUgs3FUN4O	agent	\N	f	offline	\N	t	2026-04-29 09:55:59.805628-04	\N	\N
5	1	Fernanda Costa	fernanda@alemao.local	$2a$10$vU/zBygUPyoF3npbpGOP/.jxW/VOrGUvPuyfP/.nYfFS4Zuqn4pH.	agent	\N	f	offline	\N	t	2026-04-29 09:55:59.912901-04	\N	\N
6	1	Marcos Vinícius Alves	marcos.alves@alemao.local	$2a$10$WDvmQK6KBOsvPcp1KQ1tiucceIszmZFGUZWQZZvCzoKMy4b0IoPlS	supervisor	\N	f	offline	\N	t	2026-04-29 09:56:00.018277-04	\N	\N
\.


--
-- Data for Name: admins; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.admins (id, username, password_hash, nome, email, telefone, created_at, tenant_id, account_id) FROM stdin;
2	admin	$2a$10$kJAmnZKAcniLF8HBgz1C7ecCm1YMszT6z2CkC6q98yaFD7raAGDPO	\N	\N	\N	2026-04-15 21:32:40.762391-04	1	2
\.


--
-- Data for Name: benefit_clubs; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.benefit_clubs (id, tenant_id, slug, name, specialty, active, created_at, conditions, rules) FROM stdin;
1	1	odonto	Clube Odonto	odonto	t	2026-04-17 11:49:04.332914-04	\N	\N
2	1	medico	Clube Médico	medico	t	2026-04-17 11:49:04.332914-04	\N	\N
\.


--
-- Data for Name: broadcast_last_seen; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.broadcast_last_seen (account_id, tenant_id, last_seen_at) FROM stdin;
1	1	2026-04-26 05:36:26.496092-04
2	1	2026-04-26 22:40:01.420028-04
\.


--
-- Data for Name: broadcasts; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.broadcasts (id, tenant_id, from_account, content, created_at) FROM stdin;
\.


--
-- Data for Name: cliente_enderecos; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.cliente_enderecos (id, cliente_id, tipo, cep, rua, numero, complemento, bairro, cidade, estado, referencia, principal, created_at) FROM stdin;
\.


--
-- Data for Name: cliente_responsaveis; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.cliente_responsaveis (id, cliente_id, nome, cargo, setor, telefone_id, email, permissao, created_at) FROM stdin;
\.


--
-- Data for Name: cliente_telefones; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.cliente_telefones (id, cliente_id, tipo, numero, ramal, aceita_whatsapp, principal, created_at) FROM stdin;
\.


--
-- Data for Name: clientes; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.clientes (id, tenant_id, tipo, nome, cpf_cnpj, email, status, user_id, created_at, updated_at) FROM stdin;
\.


--
-- Data for Name: club_dependents; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.club_dependents (id, member_id, nome, cpf, nascimento, parentesco, created_at) FROM stdin;
\.


--
-- Data for Name: club_faqs; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.club_faqs (id, club_id, tenant_id, question, answer, sort_order, active, created_at) FROM stdin;
1	1	1	Como funciona o pagamento?	O pagamento é mensal via PIX, gerado automaticamente. Você recebe o link no WhatsApp antes do vencimento.	0	t	2026-04-18 12:07:00.073023-04
2	1	1	Posso cancelar a qualquer momento?	Sim. Acesse sua área do cliente e solicite o cancelamento. O plano permanece ativo até o fim do período pago.	1	t	2026-04-18 12:07:00.073023-04
3	1	1	Meus dependentes têm acesso?	Sim, dependendo do plano escolhido. O plano Família inclui cobertura para até 4 dependentes.	2	t	2026-04-18 12:07:00.073023-04
4	1	1	Como acessar as clínicas parceiras?	Apresente sua carteirinha digital (acessível pela área do cliente) na recepção da clínica parceira.	3	t	2026-04-18 12:07:00.073023-04
5	2	1	Como funciona o pagamento?	O pagamento é mensal via PIX, gerado automaticamente. Você recebe o link no WhatsApp antes do vencimento.	0	t	2026-04-18 12:07:00.083094-04
6	2	1	Posso cancelar a qualquer momento?	Sim. Acesse sua área do cliente e solicite o cancelamento. O plano permanece ativo até o fim do período pago.	1	t	2026-04-18 12:07:00.083094-04
7	2	1	Meus dependentes têm acesso?	Sim, dependendo do plano escolhido. O plano Família inclui cobertura para até 4 dependentes.	2	t	2026-04-18 12:07:00.083094-04
8	2	1	Como acessar as clínicas parceiras?	Apresente sua carteirinha digital (acessível pela área do cliente) na recepção da clínica parceira.	3	t	2026-04-18 12:07:00.083094-04
\.


--
-- Data for Name: club_members; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.club_members (id, tenant_id, club_id, plan_id, user_cpf, user_nome, user_telefone, user_email, status, asaas_subscription_id, asaas_customer_id, next_billing_at, started_at, canceled_at, created_at) FROM stdin;
\.


--
-- Data for Name: club_partners; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.club_partners (id, club_id, name, specialty, phone, address, discount_percent, active, created_at, tenant_id, notes) FROM stdin;
\.


--
-- Data for Name: club_payments; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.club_payments (id, member_id, plan_id, amount, status, asaas_payment_id, reference_month, paid_at, created_at) FROM stdin;
\.


--
-- Data for Name: club_plans; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.club_plans (id, club_id, name, description, price_monthly, max_dependents, features, active, created_at) FROM stdin;
1	1	Individual	Plano para uma pessoa	25.00	0	["Limpezas e Prevenção", "Descontos em Tratamentos", "Extrações e Obturações", "Sem Carência"]	t	2026-04-17 11:49:47.587753-04
2	1	Família	Plano para até 4 dependentes	80.00	4	["Até 4 Dependentes", "Limpezas e Prevenção", "Descontos em Tratamentos", "Urgência e Emergência"]	t	2026-04-17 11:49:47.587753-04
3	2	Individual	Plano médico individual	80.00	0	["Consultas com Clínico Geral", "Descontos em Exames", "Pediatria", "Sem Carência"]	t	2026-04-17 11:49:47.593974-04
4	2	Família	Plano médico familiar	325.00	4	["Até 4 Dependentes", "Clínico Geral e Especialistas", "Descontos em Exames", "Urgência e Emergência"]	t	2026-04-17 11:49:47.593974-04
\.


--
-- Data for Name: cotacao_flash_promos; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.cotacao_flash_promos (id, tenant_id, produto_id, discount_pct, label, starts_at, ends_at, ativo, created_at) FROM stdin;
\.


--
-- Data for Name: cotacao_funcao_team; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.cotacao_funcao_team (tenant_id, funcao, nw_team_id, updated_at) FROM stdin;
\.


--
-- Data for Name: cotacao_itens; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.cotacao_itens (id, cotacao_id, produto_id, nome_produto, sku, quantidade, preco_unitario, preco_promocional, desconto_pct, subtotal, created_at, observacao) FROM stdin;
1	1	23	Absorvente Intimus c/8	INTI-8	1.000	7.49	\N	0.00	7.49	2026-04-26 03:07:08.986421-04	\N
2	1	12	Água com Gás 500ml	AGUAG-500	1.000	4.29	\N	0.00	4.29	2026-04-26 03:07:12.224134-04	\N
3	1	5	Água Mineral 500ml	AGUA-500	1.000	3.50	1.99	0.00	1.99	2026-04-26 03:07:13.679071-04	\N
4	1	26	Amendoim Crocante 150g	AMEND-150	1.000	5.99	\N	0.00	5.99	2026-04-26 03:07:15.199565-04	\N
5	2	23	Absorvente Intimus c/8	INTI-8	1.000	7.49	\N	0.00	7.49	2026-04-26 17:55:10.59976-04	\N
6	2	12	Água com Gás 500ml	AGUAG-500	1.000	4.29	\N	0.00	4.29	2026-04-26 17:55:16.186473-04	\N
7	3	5	Água Mineral 500ml	AGUA-500	1.000	3.50	1.99	0.00	1.99	2026-04-27 15:28:24.130472-04	\N
8	3	5	Água Mineral 500ml	AGUA-500	1.000	3.50	1.99	0.00	1.99	2026-04-27 15:28:44.044432-04	\N
9	3	30	Biscoito Oreo 120g	OREO-120	1.000	7.49	\N	0.00	7.49	2026-04-27 15:28:51.049248-04	\N
\.


--
-- Data for Name: cotacoes; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.cotacoes (id, tenant_id, cliente_id, user_id, status, forma_pagto, total, desconto, observacao, created_at, updated_at) FROM stdin;
1	1	\N	7	finalizada	pix	19.76	0.00	\N	2026-04-26 01:34:10.936614-04	2026-04-26 03:51:43.075446-04
2	1	\N	7	finalizada	pix	11.78	0.00	\N	2026-04-26 03:51:54.520288-04	2026-04-26 17:58:08.723799-04
3	1	\N	7	finalizada	pix	11.47	0.00	\N	2026-04-26 18:30:16.150539-04	2026-04-27 15:30:17.368765-04
4	1	\N	7	rascunho	\N	0.00	0.00	\N	2026-05-05 12:16:29.525335-04	2026-05-05 12:16:29.525335-04
\.


--
-- Data for Name: direct_messages; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.direct_messages (id, tenant_id, from_account, to_account, content, read_at, created_at) FROM stdin;
1	1	2	1	oi	2026-04-26 00:27:04.997973-04	2026-04-23 01:26:23.721448-04
2	1	1	2	oi	2026-04-26 00:38:47.676942-04	2026-04-26 00:27:30.652004-04
3	1	2	1	oie	2026-04-26 00:55:51.520844-04	2026-04-26 00:38:54.140317-04
4	1	1	2	oi	2026-04-26 00:56:02.585749-04	2026-04-26 00:55:55.963954-04
\.


--
-- Data for Name: group_chats; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.group_chats (id, tenant_id, sector_id, name, created_at) FROM stdin;
1	1	1	Secretária	2026-04-26 00:29:16.436737-04
2	1	2	Gerencia	2026-04-26 00:29:16.436737-04
3	1	3	Atendimento	2026-04-29 21:17:20.016392-04
4	1	4	Cotação	2026-04-29 21:17:20.016392-04
5	1	5	Separação	2026-04-29 21:17:20.016392-04
6	1	6	Embalagem	2026-04-29 21:17:20.016392-04
7	1	7	Auditoria	2026-04-29 21:17:20.016392-04
8	1	8	Fiscal	2026-04-29 21:17:20.016392-04
9	1	9	Expedição	2026-04-29 21:17:20.016392-04
10	1	10	Financeiro	2026-04-29 21:17:20.016392-04
11	1	11	Suporte	2026-04-29 21:17:20.016392-04
\.


--
-- Data for Name: group_last_read; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.group_last_read (account_id, group_chat_id, last_read_at) FROM stdin;
1	1	2026-04-26 05:36:28.700442-04
\.


--
-- Data for Name: group_messages; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.group_messages (id, tenant_id, group_chat_id, from_account, content, created_at) FROM stdin;
\.


--
-- Data for Name: human_api_requests; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.human_api_requests (id, tenant_id, conversation_id, sector_id, account_id, question, answer, status, delivery_mode, asked_at, answered_at, timeout_at, chat_id) FROM stdin;
\.


--
-- Data for Name: internal_messages; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.internal_messages (id, tenant_id, thread_id, from_account, to_account, sector_id, type, content, ref_id, read_at, created_at, chat_id) FROM stdin;
\.


--
-- Data for Name: job_applications; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.job_applications (id, tenant_id, job_id, resume_id, applicant_nome, applicant_email, applicant_phone, applicant_cpf, cover_letter, status, admin_notes, applied_at, updated_at) FROM stdin;
\.


--
-- Data for Name: jobs; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.jobs (id, tenant_id, title, description, requirements, benefits, location, work_mode, job_type, category, salary_min, salary_max, salary_hide, slots, active, published_at, expires_at, created_at, updated_at) FROM stdin;
\.


--
-- Data for Name: knowledge_learning; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.knowledge_learning (id, tenant_id, sector_id, account_id, question, answer, promoted, promoted_at, use_count, created_at) FROM stdin;
\.


--
-- Data for Name: mensagens_internas; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.mensagens_internas (id, tenant_id, pedido_id, setor, remetente, mensagem, lida, created_at, chat_id) FROM stdin;
1	1	\N	atendimento	Monitor IA	⚠️ Chat sem resposta há 32 min: caf8cd29-d230-4bca-8881-a4a27ff8b29a\n"em que fase esta a cotação #1"	t	2026-04-26 05:34:52.017655-04	\N
2	1	\N	atendimento	Sistema	revise e responda	t	2026-04-26 05:37:05.878151-04	\N
3	1	\N	atendimento	Monitor IA	⚠️ Chat sem resposta há 14 min: caf8cd29-d230-4bca-8881-a4a27ff8b29a\n"em que fase esta a cotação #1"	t	2026-04-26 06:05:41.714299-04	\N
4	1	\N	atendimento	Monitor IA	⚠️ Chat sem resposta há 44 min: caf8cd29-d230-4bca-8881-a4a27ff8b29a\n"em que fase esta a cotação #1"	t	2026-04-26 06:35:41.721126-04	\N
5	1	\N	atendimento	Monitor IA	⚠️ Chat sem resposta há 74 min: caf8cd29-d230-4bca-8881-a4a27ff8b29a\n"em que fase esta a cotação #1"	t	2026-04-26 07:05:41.7783-04	\N
6	1	\N	atendimento	Monitor IA	⚠️ Chat sem resposta há 104 min: caf8cd29-d230-4bca-8881-a4a27ff8b29a\n"em que fase esta a cotação #1"	t	2026-04-26 07:35:42.106043-04	\N
7	1	\N	atendimento	Sistema	entregue!	t	2026-04-26 15:44:06.033642-04	\N
9	1	\N	atendimento	Monitor IA	⚠️ Chat sem resposta há 8 min: caf8cd29-d230-4bca-8881-a4a27ff8b29a\n"em que fase esta a cotação #1"	t	2026-04-26 15:51:02.453468-04	\N
10	1	\N	atendimento	Monitor IA	⚠️ Chat sem resposta há 38 min: caf8cd29-d230-4bca-8881-a4a27ff8b29a\n"em que fase esta a cotação #1"	t	2026-04-26 16:21:02.460533-04	\N
11	1	\N	atendimento	Monitor IA	⚠️ Chat sem resposta há 68 min: caf8cd29-d230-4bca-8881-a4a27ff8b29a\n"em que fase esta a cotação #1"	t	2026-04-26 16:51:02.584417-04	\N
12	1	\N	atendimento	Monitor IA	⚠️ Chat sem resposta há 101 min: caf8cd29-d230-4bca-8881-a4a27ff8b29a\n"em que fase esta a cotação #1"	t	2026-04-26 17:24:21.309044-04	\N
13	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 107 min — caf8cd29…\n"em que fase esta a cotação #1"	t	2026-04-26 17:30:21.542803-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
14	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 5 min — Rui Cesar\n"oie, verifique novamente cotação #1"	t	2026-04-26 21:20:23.859996-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
15	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 40 min — Rui Cesar\n"oie, verifique novamente cotação #1"	t	2026-04-26 21:55:10.061966-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
16	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 7 min — Rui Cesar\n"sim, estou testando!!!"	t	2026-04-26 23:53:42.276922-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
17	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 37 min — Rui Cesar\n"sim, estou testando!!!"	t	2026-04-27 00:23:42.328247-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
18	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 67 min — Rui Cesar\n"sim, estou testando!!!"	t	2026-04-27 00:53:42.371093-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
19	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 97 min — Rui Cesar\n"sim, estou testando!!!"	t	2026-04-27 01:23:42.379886-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
20	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 9 min — Rui Cesar\n"teste"	t	2026-04-27 14:01:01.586811-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
21	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 27 min — Rui Cesar\n"adawdaw"	t	2026-04-27 14:31:01.593293-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
22	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 60 min — Rui Cesar\n"adawdaw"	t	2026-04-27 15:04:38.768057-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
23	1	\N	atendimento	Sistema	oi	t	2026-04-27 15:34:16.406639-04	\N
24	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 5 min — Rui Cesar\n"preciso de ajuda"	t	2026-04-27 15:36:41.375116-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
25	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 33 min — Rui Cesar\n"IA????"	t	2026-04-27 16:06:41.379929-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
26	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 63 min — Rui Cesar\n"IA????"	t	2026-04-27 16:36:41.395818-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
27	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 93 min — Rui Cesar\n"IA????"	t	2026-04-27 17:06:41.39945-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
28	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 7 min — Rui Cesar\n"oi"	t	2026-04-28 13:21:32.221511-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
29	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 37 min — Rui Cesar\n"oi"	t	2026-04-28 13:51:32.236299-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
30	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 21 min — Rui Cesar\n"e os produtos?"	t	2026-04-28 14:22:01.251784-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
31	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 51 min — Rui Cesar\n"e os produtos?"	t	2026-04-28 14:52:01.25565-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
32	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 81 min — Rui Cesar\n"e os produtos?"	t	2026-04-28 15:22:01.262138-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
33	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 111 min — Rui Cesar\n"e os produtos?"	t	2026-04-28 15:52:01.268942-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
34	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 6 min — Rui Cesar\n"verifique o status deste pedido"	t	2026-04-29 01:51:27.018937-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
35	1	\N	atendimento	Monitor IA	⚠️ Sem resposta há 9 min — Rui Cesar\n"como eu falo com Rui Cesar"	f	2026-05-05 13:33:30.74696-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a
\.


--
-- Data for Name: notification_errors; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.notification_errors (id, job_id, log_id, phone, type, error_message, payload, tenant_id, created_at) FROM stdin;
1	6	6	5567998885576	\N	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	{"body": "🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *26/04/2026* às *04:02*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente.", "number": "5567998885576"}	\N	2026-04-26 04:03:09.048117-04
2	7	7	5567998885576	\N	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	{"body": "🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *26/04/2026* às *04:02*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente.", "number": "5567998885576"}	\N	2026-04-26 04:03:15.323151-04
3	8	8	5567998885576	\N	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	{"body": "🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *27/04/2026* às *09:23*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente.", "number": "5567998885576"}	\N	2026-04-27 09:23:36.470511-04
4	9	9	5567998885576	\N	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	{"body": "🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *28/04/2026* às *10:47*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente.", "number": "5567998885576"}	\N	2026-04-28 10:47:34.777634-04
5	10	10	5567998885576	\N	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	{"body": "🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *28/04/2026* às *10:47*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente.", "number": "5567998885576"}	\N	2026-04-28 10:48:32.337935-04
6	11	11	5567998885576	\N	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	{"body": "🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *28/04/2026* às *10:52*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente.", "number": "5567998885576"}	\N	2026-04-28 10:52:41.28633-04
7	12	12	5567998885576	\N	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	{"body": "🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *28/04/2026* às *11:07*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente.", "number": "5567998885576"}	\N	2026-04-28 11:08:04.89085-04
8	13	13	5567998885576	\N	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	{"body": "🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *28/04/2026* às *11:18*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente.", "number": "5567998885576"}	\N	2026-04-28 11:19:35.161343-04
9	14	14	5567998885576	\N	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	{"body": "🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *04/05/2026* às *09:56*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente.", "number": "5567998885576"}	\N	2026-05-04 09:57:26.975437-04
10	15	15	5567998885576	\N	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	{"body": "🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *05/05/2026* às *10:16*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente.", "number": "5567998885576"}	\N	2026-05-05 10:17:09.714715-04
\.


--
-- Data for Name: notifications; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.notifications (id, user_cpf, title, message, type, read_at, created_at) FROM stdin;
1	42150825104	✅ Pedido marcado como entregue	Seu pedido PED-20260426-3 foi marcado como entregue. Se não recebeu, entre em contato.	success	\N	2026-04-26 05:13:19.146532-04
2	42150825104	📦 Pedido em separação	Seu pedido PED-20260426-4 está sendo preparado.	info	\N	2026-04-28 21:45:25.450782-04
3	42150825104	📦 Pedido em separação	Seu pedido PED-20260427-5 está sendo preparado.	info	\N	2026-04-28 22:21:05.919713-04
4	42150825104	🔍 Pedido em auditoria	Seu pedido PED-20260427-5 está em verificação final.	info	\N	2026-05-04 09:57:31.894321-04
5	42150825104	🧾 Pedido em processamento fiscal	Seu pedido PED-20260427-5 está na etapa fiscal.	info	\N	2026-05-04 09:57:39.1252-04
6	42150825104	🚚 Pedido saiu para entrega	Seu pedido PED-20260427-5 saiu para entrega. Fique de olho!	info	\N	2026-05-04 09:57:44.990054-04
7	42150825104	✅ Pedido marcado como entregue	Seu pedido PED-20260427-5 foi marcado como entregue. Se não recebeu, entre em contato.	success	\N	2026-05-04 09:57:53.926351-04
8	42150825104	🔍 Pedido em auditoria	Seu pedido PED-20260426-4 está em verificação final.	info	\N	2026-05-04 10:17:00.711272-04
9	42150825104	🧾 Pedido em processamento fiscal	Seu pedido PED-20260426-4 está na etapa fiscal.	info	\N	2026-05-04 10:17:02.066114-04
10	42150825104	🚚 Pedido saiu para entrega	Seu pedido PED-20260426-4 saiu para entrega. Fique de olho!	info	\N	2026-05-04 10:17:03.122596-04
11	42150825104	✅ Pedido marcado como entregue	Seu pedido PED-20260426-4 foi marcado como entregue. Se não recebeu, entre em contato.	success	\N	2026-05-04 10:17:11.912236-04
\.


--
-- Data for Name: nw_auto_replies; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.nw_auto_replies (id, instance_id, chat_id, conv_id, user_msg, reply, status, created_at, tenant_id) FROM stdin;
1	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	oi	Oi, Rui! Como você está? O que posso fazer por você hoje?	sent	2026-04-19 01:07:20.724861-04	1
2	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	então quais as promoções	Claro! Aqui estão as promoções ativas no momento:\n\n- **Coca-Cola 2L**: de R$ 12,99 por R$ 8,99\n- **Cerveja Heineken 350ml**: de R$ 7,99 por R$ 5,49\n- **Doritos 96g**: de R$ 9,99 por R$ 6,99\n- **Energético Red Bull 250ml**: de R$ 11,99 por R$ 8,99\n- **Água Mineral 500ml**: de R$ 3,50 por R$ 1,99\n- **Chocolate Bis 126g**: de R$ 8,49 por R$ 5,99\n\nSe precisar de mais detalhes sobre algum produto ou quiser fazer um pedido, é só avisar!	sent	2026-04-19 01:25:14.670742-04	1
3	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	que dia é hoje?	Hoje é 26 de outubro de 2023. Posso ajudar com mais alguma coisa?	sent	2026-04-19 01:29:24.908044-04	1
4	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	quais são os valores dos planos	Aqui estão os valores dos nossos planos de benefícios:\n\n**Clube Odonto:**\n- **Individual (titular)**: R$ 25,00/mês\n- **Família (até 4 dependentes)**: R$ 80,00/mês\n\n**Clube Médico:**\n- **Individual (titular)**: R$ 80,00/mês\n- **Família (até 4 dependentes)**: R$ 325,00/mês\n\nSe precisar de mais informações sobre o que cada plano oferece, é só me avisar!	sent	2026-04-19 01:38:16.354477-04	1
5	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	que dia é hoje?	Hoje é 26 de outubro de 2023. Precisa de mais alguma coisa?	sent	2026-04-19 01:40:44.765513-04	1
6	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	ano?	Estamos em 2023. Alguma outra dúvida que eu possa ajudar?	sent	2026-04-19 01:42:43.247006-04	1
7	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	que ano é hoje?	Hoje é 2026. Se precisar de mais alguma informação, é só avisar!	sent	2026-04-19 02:45:31.102441-04	1
8	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	bom dia	Bom dia! Como posso te ajudar hoje?	sent	2026-04-19 12:57:55.130966-04	1
9	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	me fale sobre os sorteios	Claro! Estamos com um sorteio ativo chamado "Grande Sorteio Alemão Conveniência". Aqui estão os detalhes:\n\n- **Descrição**: Concorra a prêmios incríveis!\n- **Custo de cada número**: R$ 5,00\n- **Números disponíveis**: 500 de 500\n\nPara participar, é só acessar nosso site e escolher seus números favoritos. Se precisar de mais informações, estou aqui!	sent	2026-04-19 12:59:36.589838-04	1
10	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	?	Parece que posso ter me adiantado! O que você gostaria de saber sobre os sorteios? Estou aqui para ajudar!	sent	2026-04-19 13:01:01.261087-04	1
11	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	?	Desculpe se não fui claro. Se tiver alguma dúvida específica ou se precisar de mais informações sobre os sorteios, pode me dizer! Estou aqui para ajudar.	sent	2026-04-19 13:01:49.634425-04	1
12	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	qual o site oficial do alemao	O site oficial da Alemão Conveniências é o [alemaoconveniencias.com](http://alemaoconveniencias.com). Se precisar de mais alguma coisa, é só avisar!	sent	2026-04-19 13:03:32.505891-04	1
13	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	oi, boa noite	Oi! Boa noite! Como posso ajudar você hoje?	sent	2026-04-19 23:02:59.361023-04	1
14	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	queria falar com a monique	Vou chamar a Monique para você. Um momento, por favor!	sent	2026-04-19 23:05:23.801344-04	1
15	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	c490cf09-7064-4cfc-b080-87ff89e16d7b	oi monique tudo bem?	Chamei a Monique para te atender. Ela já deve estar chegando. Se precisar de mais alguma coisa enquanto isso, é só avisar!	sent	2026-04-19 23:38:15.628565-04	1
16	fb8adc42-8ecd-44f8-964a-8ad144fac999	4a25736f-1db0-4c2b-9087-f4985ae8b38d	40e25cd2-7848-4044-8d2a-1eaa7cb5c57b	Boa tarde, vocé está trabalhando hoje?	Boa tarde! Sim, estou aqui para ajudar. O que você precisa?	sent	2026-04-20 10:32:59.662342-04	1
17	fb8adc42-8ecd-44f8-964a-8ad144fac999	4a25736f-1db0-4c2b-9087-f4985ae8b38d	40e25cd2-7848-4044-8d2a-1eaa7cb5c57b	Quer trabalhar em nossa plataforma e ganhar cerca de Muita renda por dia?	Parece interessante! Mas aqui sou atendente da Alemão Conveniências e não tenho informações sobre oportunidades de trabalho em outras plataformas. Posso ajudar com algo relacionado aos nossos serviços?	sent	2026-04-20 11:07:47.116557-04	1
18	fb8adc42-8ecd-44f8-964a-8ad144fac999	4a25736f-1db0-4c2b-9087-f4985ae8b38d	40e25cd2-7848-4044-8d2a-1eaa7cb5c57b	Se você confiar em mim e jogar com qualquer valor de depósito, eu o ajudarei a ganhar assim. Não vou ajudar ninguém que não acredita em mim. 99% de certeza de ganhar. Todo mundo que joga no meu link já fica feliz porque ganhou.⭐️Link 👉 fogobet004.com	Entendo que você está muito animado com essa oportunidade, mas preciso esclarecer que não posso apoiar ou discutir apostas ou jogos de azar. Se precisar de ajuda com algo relacionado aos nossos serviços, estou à disposição!	sent	2026-04-20 12:38:05.389065-04	1
19	fb8adc42-8ecd-44f8-964a-8ad144fac999	4a25736f-1db0-4c2b-9087-f4985ae8b38d	40e25cd2-7848-4044-8d2a-1eaa7cb5c57b	Amigo, sou gerente de contas na FOGO . GAME . Agora jogue o jogo do coelho no link que forneci. A maioria dos clientes joga o jogo do coelho e retira seus ganhos. Hoje é seu dia de sorte. Link 💠👉 fogobet004.com	Agradeço pela sua mensagem, mas não posso ajudar com jogos ou apostas. Meu foco é ajudar com os serviços da Alemão Conveniências. Se tiver alguma dúvida ou precisar de informações sobre nossos planos ou promoções, estou aqui para ajudar!	sent	2026-04-20 16:04:13.559441-04	1
20	fb8adc42-8ecd-44f8-964a-8ad144fac999	4a25736f-1db0-4c2b-9087-f4985ae8b38d	40e25cd2-7848-4044-8d2a-1eaa7cb5c57b	Quer trabalhar em nossa plataforma e ganhar cerca de Muita renda por dia?	Agradeço pela oferta, mas estou aqui para ajudar com os serviços da Alemão Conveniências. Se precisar de informações sobre nossos planos ou promoções, ficarei feliz em ajudar!	sent	2026-04-22 21:14:28.622133-04	1
21	fb8adc42-8ecd-44f8-964a-8ad144fac999	4a25736f-1db0-4c2b-9087-f4985ae8b38d	40e25cd2-7848-4044-8d2a-1eaa7cb5c57b	➡️ FORTUNE RABBIT\n- ⏰19:05 | 19:10 | 19:21\n- ⏰19:30 | 19:45 | 19:51\n\n\n➡️ FORTUNE OX\n- ⏰20:00 | 20:15 | 20:26\n- ⏰20:38 | 20:42 | 20:53\n\n\nDê a você um momento de ouro para ganhar dinheiro e eu o ajudarei a atingir a maior taxa de vitórias. Você deposita qualquer quantia e recebe mais reembolsos\nLink VIP: 👉 fogobet004.com	Agradeço pelo convite, mas não posso participar de jogos ou apostas. Estou aqui para ajudar com informações sobre os serviços da Alemão Conveniências. Se precisar de alguma coisa relacionada a isso, é só me avisar!	sent	2026-04-22 21:14:31.809218-04	1
22	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	Boa noite	Boa noite! Como posso te ajudar hoje?	sent	2026-04-22 22:29:27.30208-04	1
23	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	me diga sobre o sistema de cotação online	O sistema de cotação online permite que você monte seu carrinho de produtos, salve listas, solicite cotações e até transforme cotações em pedidos confirmados. É uma maneira prática de gerenciar suas compras, especialmente se você precisa de um acompanhamento mais detalhado. \n\nSe precisar de mais informações ou ajuda específica com o sistema, é só me falar!	sent	2026-04-22 22:37:30.951903-04	1
24	fb8adc42-8ecd-44f8-964a-8ad144fac999	1922f924-7a10-410b-8b28-479ebe3a77a2	a1d0262c-23ea-4d70-88a1-f3703de16e1e	Oi	Oi! Tudo bem? Como posso te ajudar hoje?	sent	2026-04-23 03:23:47.041888-04	1
25	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	Oi	Oi! Como você está? O que posso fazer por você hoje?	sent	2026-04-23 03:23:47.317733-04	1
26	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	Bom dia	Bom dia! Como posso te ajudar hoje?	sent	2026-04-26 05:02:58.903621-04	1
27	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	?	Parece que algo não saiu como esperado. Como posso te ajudar? Se tiver alguma dúvida ou precisar de informações, estou aqui!	sent	2026-04-26 05:35:45.093774-04	1
28	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	?	Desculpe se não fui clara! O que você gostaria de saber ou discutir? Estou aqui para ajudar.	sent	2026-04-26 05:37:35.962256-04	1
29	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	?	Entendo que você possa estar confuso ou frustrado. Estou aqui para ajudar! Se puder me dar mais contexto ou esclarecer o que você precisa, ficarei feliz em ajudar.	sent	2026-04-26 05:51:29.829613-04	1
30	fb8adc42-8ecd-44f8-964a-8ad144fac999	1922f924-7a10-410b-8b28-479ebe3a77a2	a1d0262c-23ea-4d70-88a1-f3703de16e1e	?	Estou aqui para ajudar! O que você precisa?	sent	2026-04-26 11:00:34.30443-04	1
31	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	?	Parece que estamos numa roda-viva aqui! 😊 Se você puder me dizer como posso ajudar, ficarei feliz em te auxiliar. O que você precisa?	sent	2026-04-26 11:00:35.142692-04	1
32	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	oi	Oi! Como posso te ajudar hoje? 😊	sent	2026-04-26 15:42:31.716649-04	1
33	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	Boa noite consegue ver o status e a lista de produtos do pedido #1	Não consegui encontrar informações sobre o pedido #1. Você poderia confirmar o número do pedido ou fornecer mais detalhes? Assim, eu consigo ajudar melhor!	sent	2026-04-26 20:36:36.913473-04	1
34	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	????/??	Entendo que você está frustrado. Vou precisar de mais informações sobre o seu pedido para ajudar. Pode me confirmar o número do pedido ou algum detalhe que possa ajudar? 😊	sent	2026-04-26 20:38:02.999485-04	1
35	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	Boa noite	Boa noite! Como posso ajudar você hoje? 😊	sent	2026-04-26 20:51:49.357174-04	1
36	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	???????????	Parece que estamos tendo dificuldades na comunicação. Se você puder me dar mais detalhes sobre o que precisa, ficarei feliz em ajudar! 😊	sent	2026-04-26 20:53:50.889713-04	1
37	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	\N	oie, verifique novamente cotação #1	*PED-20260426-3*\nfoi marcado como *entregue* ✅\nModalidade: 🏪 retirada na loja\nPagamento: PIX\nTotal: R$ 19.76\n\nVocê chegou a receber tudo certinho? 🙏	sent_local	2026-04-26 21:15:17.295958-04	1
38	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	sim, desculpe a demora me disseram que esta tudo certinho	Sem problemas! Se te disseram que está tudo certinho, você gostaria de verificar algum detalhe específico do pedido ou tem alguma outra dúvida? 😊	sent	2026-04-26 22:08:21.252547-04	1
39	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	teste1	Parece que você está testando algo. Se precisar de ajuda específica, é só me avisar! 😊	sent	2026-04-26 23:46:28.96585-04	1
40	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	Botões New	Não tenho informações sobre "botões New". Você pode me dar mais detalhes ou especificar o que precisa? Assim, consigo ajudar melhor! 😊	sent	2026-04-27 09:46:35.153334-04	1
41	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	teste	Tudo certo! Se precisar de alguma informação ou ajuda, é só me falar! 😊	sent	2026-04-27 11:18:32.048813-04	1
42	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	0c244726-39ae-4807-8f90-6c4c5f472428	texto	Parece que você está testando mensagens. Se tiver uma pergunta ou algo específico em mente, estou aqui para ajudar! 😊	sent	2026-04-27 11:39:03.954532-04	1
43	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	\N	teste	\N	failed	2026-04-27 13:52:53.182503-04	1
44	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	\N	adawdaw	\N	failed	2026-04-27 14:05:04.545607-04	1
45	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	\N	oi	\N	failed	2026-04-27 15:31:46.581503-04	1
46	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	\N	preciso de ajuda	\N	failed	2026-04-27 15:31:50.621312-04	1
47	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	\N	IA????	\N	failed	2026-04-27 15:33:55.109028-04	1
48	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	\N	oi	\N	failed	2026-04-28 13:14:47.801663-04	1
49	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	\N	oi	\N	failed	2026-04-28 13:57:04.145141-04	1
50	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	oi	Oi! Como posso te ajudar hoje? 😊	sent	2026-04-28 13:58:59.369302-04	1
51	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	io	Oi! Como posso te ajudar hoje? 😊	sent	2026-04-28 13:59:02.572007-04	1
52	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	\N	oque foi pedido em PED-20260426-4	*PED-20260426-4*\nModalidade: 🏪 retirada na loja\nPagamento: PIX\nTotal: R$ 11.78	sent_local	2026-04-28 14:00:35.60686-04	1
53	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	[O cliente enviou apenas "???" sem contexto anterior nas últimas 2h. Responda com uma saudação curta perguntando como pode ajudar.]	Oi! O que você precisa? Estou aqui pra ajudar! 😊	sent	2026-04-28 17:02:46.591925-04	1
54	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	[Atenção: o cliente está cobrando uma resposta. Há 187min ele perguntou:\n"e os produtos?"\nAgora ele reenviou apenas "??" para chamar atenção. Responda à pergunta original o mais diretamente possível. Se realmente não souber a resposta ou se for assunto que precisa de operador humano, peça desculpa pela demora e diga que vai chamar um atendente.]	Desculpa pela demora! Eu vi que você estava perguntando sobre os produtos. Temos disponível:\n\n- Biscoito Oreo 120g por R$ 7,49\n- Pringles Original 114g por R$ 14,99\n\nSe precisar de mais informações ou quiser fazer um pedido, é só avisar! 😊	sent	2026-04-28 17:08:04.647284-04	1
55	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	coca cola esta em promoção hoje?	Sim! A Coca-Cola 2L está em promoção por R$ 8,99, com 31% de desconto. Se quiser, posso ajudar a fazer o pedido! 🥤	sent	2026-04-28 17:23:45.57094-04	1
56	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	veja quanto sai 3 engradados de coca cola	Um engradado de Coca-Cola 2L tem 6 garrafas, e a promoção é de R$ 8,99 por garrafa. Então, 3 engradados (18 garrafas) ficaria R$ 161,82. \n\nSe precisar de mais alguma coisa ou quiser fazer o pedido, é só avisar! 😊	sent	2026-04-28 17:25:04.524736-04	1
57	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	oi	Oi! Como posso te ajudar hoje? 😊	sent	2026-04-29 00:41:03.519745-04	1
58	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	[O cliente enviou apenas "????" sem contexto anterior nas últimas 2h. Responda com uma saudação curta perguntando como pode ajudar.]	Oi! O que está pegando? Estou aqui para ajudar! 😊	sent	2026-04-29 01:14:03.971633-04	1
59	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	\N	[documento PDF] O documento é um comprovante de pedido de uma loja chamada Alemão Conveniências. O número do pedido é PED-20260426-3, datado de 26 de abril de 2026, às 01:34. O total do pedido é R$ 19,76, pago via PIX, e o status do pedido é "ENTREGUE".\n\nOs produtos listados no pedido incluem: 1 absorvente Intimu (R$ 7,49), 1 água com gás de 500ml (R$ 4,29), 1 água mineral de 500ml (R$ 1,99) e 1 amendoim crocante (R$ 5,99). Não há informações sobre o nome do cliente ou CNPJ/CPF no documento.\n\nA instrução ao cliente é um agradecimento pela preferência, com o site da loja disponível para mais informações: alemaoconveniencias.local.\nMensagem do cliente: verifique o status deste pedido	*PED-20260426-3*\nfoi marcado como *entregue* ✅\nModalidade: 🏪 retirada na loja\nPagamento: PIX\nTotal: R$ 19.76\n\n🛒 *Itens:*\n• 1x Absorvente Intimus c/8 — R$ 7.49\n• 1x Água com Gás 500ml — R$ 4.29\n• 1x Água Mineral 500ml — R$ 1.99\n• 1x Amendoim Crocante 150g — R$ 5.99\n\nVocê chegou a receber tudo certinho? 🙏	sent_local	2026-04-29 01:47:03.411898-04	1
60	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	oie	Oi! Tudo bem? Como posso te ajudar hoje? 😊	sent	2026-05-04 10:02:04.150601-04	1
61	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	[Atenção: o cliente está cobrando uma resposta. Há 3min ele perguntou:\n"foi entregue o pedido PED-20260427-5 ? Estou na rua não sei se entregaram"\nAgora ele reenviou apenas "?" para chamar atenção. Responda à pergunta original o mais diretamente possível. Se realmente não souber a resposta ou se for assunto que precisa de operador humano, peça desculpa pela demora e diga que vai chamar um atendente.]	Desculpa pela demora! O pedido *PED-20260427-5* foi entregue. Você recebeu tudo certinho? Se precisar de mais alguma coisa, é só falar! 😊	sent	2026-05-04 10:06:04.324093-04	1
62	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	oi	Oi! Como posso te ajudar hoje? 😊	sent	2026-05-05 12:12:43.482588-04	1
63	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	[Atenção: o cliente está cobrando uma resposta. Há 2min ele perguntou:\n"[documento PDF] O documento é um pedido de compra da empresa "ALEMÃO CONVENIÊNCIAS". A data do pedido é 26/04/2026, com o número de protocolo PED-20260427-5. O total da compra é R$ 11,47, que inclui dois itens: Água Mineral 500ml (2x R$ 1,99) e Biscoito Oreo 120g (1x R$ 7,49). O pagamento foi realizado via PIX.\n\nO status do pedido é "ENTREGUE". Não há informações sobre o nome do cliente ou CNPJ/CPF no documento. A instrução ao cliente é um agradecimento pela preferência, com o site da empresa mencionado como alemaoconveniencias.local."\nAgora ele reenviou apenas "?" para chamar atenção. Responda à pergunta original o mais diretamente possível. Se realmente não souber a resposta ou se for assunto que precisa de operador humano, peça desculpa pela demora e diga que vai chamar um atendente.]	Desculpe pela demora! O pedido *PED-20260427-5* foi entregue e o total foi de *R$ 11,47*, pago via PIX. Se precisar de mais alguma coisa, posso ajudar! 😊	sent	2026-05-05 12:15:42.105739-04	1
64	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	valor do Chiclete Trident Melancia?	O Chiclete Trident Melancia está custando *R$ 2,49*. Quer adicionar ao seu pedido? 😊	sent	2026-05-05 12:17:04.326143-04	1
65	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	oi	Oi! Tudo certo por aí? Como posso te ajudar hoje? 😊	sent	2026-05-05 13:23:35.573927-04	1
66	fb8adc42-8ecd-44f8-964a-8ad144fac999	caf8cd29-d230-4bca-8881-a4a27ff8b29a	38aa13d7-db27-4ace-a28f-1103d6feda8d	Bruno Castro, esta no local neste momento?	Desculpa, mas não tenho como confirmar a presença de pessoas específicas aqui. Você gostaria de saber algo mais ou precisa de ajuda com outra coisa? 😊	sent	2026-05-05 13:42:21.621656-04	1
\.


--
-- Data for Name: nw_chat_sectors; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.nw_chat_sectors (chat_id, tenant_id, sector_id, updated_at) FROM stdin;
\.


--
-- Data for Name: nw_event_logs; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.nw_event_logs (id, instance_id, event, direction, chat_id, from_me, msg_type, payload, created_at, tenant_id) FROM stdin;
1	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	f12369cd-0e8f-476c-a29e-5f9a6e3e1b40	t	UNSUPPORTED	{"body": null}	2026-04-18 01:57:04.905702-04	1
2	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "bancoTalentos.md"}	2026-04-18 01:57:05.230558-04	1
3	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 11:53:19.17144-04	1
4	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 11:59:33.603594-04	1
5	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 12:30:10.705956-04	1
6	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 13:02:33.189237-04	1
7	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 18:47:35.724807-04	1
8	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 19:07:45.314813-04	1
9	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi"}	2026-04-18 19:17:45.819248-04	1
10	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "promoções"}	2026-04-18 19:21:04.204022-04	1
11	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 20:11:23.909198-04	1
12	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi"}	2026-04-18 20:42:15.128144-04	1
13	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 21:17:20.056064-04	1
14	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 21:18:38.372793-04	1
15	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 21:18:53.239439-04	1
16	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 21:20:01.051695-04	1
17	bc8ea020-3343-495d-a90b-045251688a0e	session.status	in	\N	f	\N	{"status": "disconnected"}	2026-04-18 21:20:12.945391-04	1
18	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 21:25:24.073217-04	1
19	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	7b4298eb-ba80-4636-9368-03b56c0aaade	t	UNSUPPORTED	{"body": null}	2026-04-18 21:25:24.535127-04	1
20	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	7b4298eb-ba80-4636-9368-03b56c0aaade	t	UNSUPPORTED	{"body": null}	2026-04-18 21:25:24.628734-04	1
21	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	7b4298eb-ba80-4636-9368-03b56c0aaade	t	UNSUPPORTED	{"body": null}	2026-04-18 21:25:24.643977-04	1
22	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	7b4298eb-ba80-4636-9368-03b56c0aaade	t	UNSUPPORTED	{"body": null}	2026-04-18 21:25:24.684268-04	1
23	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	7b4298eb-ba80-4636-9368-03b56c0aaade	t	UNSUPPORTED	{"body": null}	2026-04-18 21:25:24.712406-04	1
24	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	7b4298eb-ba80-4636-9368-03b56c0aaade	t	UNSUPPORTED	{"body": null}	2026-04-18 21:25:24.772822-04	1
25	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	7b4298eb-ba80-4636-9368-03b56c0aaade	t	UNSUPPORTED	{"body": null}	2026-04-18 21:25:26.613365-04	1
26	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	7b4298eb-ba80-4636-9368-03b56c0aaade	t	UNSUPPORTED	{"body": null}	2026-04-18 21:25:27.204715-04	1
27	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 21:37:16.179671-04	1
28	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 21:37:16.339188-04	1
29	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 21:45:03.196671-04	1
30	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 21:45:06.077725-04	1
31	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	in	5a098d2c-00e7-4235-b98c-6da0b5094444	f	TEXT	{"body": "oi"}	2026-04-18 21:45:17.785121-04	1
32	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	5c225314-2ffb-49eb-80f2-511a6da8513d	f	TEXT	{"body": "oi"}	2026-04-18 21:46:01.810982-04	1
33	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	in	014ac1b9-b619-403b-9506-4b026933bc4a	f	TEXT	{"body": "teste"}	2026-04-18 21:47:34.723455-04	1
34	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 22:00:23.452539-04	1
35	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 22:00:23.657678-04	1
36	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 22:03:45.126538-04	1
37	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-18 22:03:45.258394-04	1
38	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 00:17:17.345313-04	1
39	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 00:17:18.020755-04	1
40	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 00:56:29.957088-04	1
41	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 00:56:30.119006-04	1
42	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 01:02:04.541628-04	1
43	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 01:02:04.781531-04	1
44	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi"}	2026-04-19 01:07:17.329729-04	1
45	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "me fala das prmoções do alemão"}	2026-04-19 01:07:46.901455-04	1
46	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "então quais as promoções"}	2026-04-19 01:25:05.299089-04	1
47	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "que dia é hoje?"}	2026-04-19 01:29:21.952799-04	1
48	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "quais são os valores dos planos"}	2026-04-19 01:38:12.979012-04	1
49	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "que dia é hoje?"}	2026-04-19 01:40:42.075247-04	1
50	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "que ano é hoje?"}	2026-04-19 01:41:24.62817-04	1
51	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "ano?"}	2026-04-19 01:42:40.938031-04	1
52	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 02:41:35.823287-04	1
53	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 02:41:36.427736-04	1
54	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	f12369cd-0e8f-476c-a29e-5f9a6e3e1b40	t	UNSUPPORTED	{"body": null}	2026-04-19 02:43:14.869531-04	1
55	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	f12369cd-0e8f-476c-a29e-5f9a6e3e1b40	t	UNSUPPORTED	{"body": null}	2026-04-19 02:43:14.91684-04	1
56	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	f12369cd-0e8f-476c-a29e-5f9a6e3e1b40	t	UNSUPPORTED	{"body": null}	2026-04-19 02:43:14.922755-04	1
57	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	f12369cd-0e8f-476c-a29e-5f9a6e3e1b40	t	UNSUPPORTED	{"body": null}	2026-04-19 02:43:14.95153-04	1
58	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	f12369cd-0e8f-476c-a29e-5f9a6e3e1b40	t	UNSUPPORTED	{"body": null}	2026-04-19 02:43:14.958156-04	1
59	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 02:44:19.204916-04	1
60	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 02:44:19.633885-04	1
61	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	f12369cd-0e8f-476c-a29e-5f9a6e3e1b40	t	UNSUPPORTED	{"body": null}	2026-04-19 02:45:27.093392-04	1
62	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "que ano é hoje?"}	2026-04-19 02:45:27.522474-04	1
63	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 02:52:25.225816-04	1
64	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 02:52:25.482107-04	1
65	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 03:19:31.163919-04	1
66	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 03:40:19.620072-04	1
67	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 05:50:43.619285-04	1
68	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "bom dia"}	2026-04-19 12:57:52.219908-04	1
69	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "me fale sobre os sorteios"}	2026-04-19 12:59:33.530621-04	1
70	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "valores dos numeros"}	2026-04-19 13:00:14.97444-04	1
71	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "?"}	2026-04-19 13:00:58.763075-04	1
72	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "qual o site"}	2026-04-19 13:01:28.357702-04	1
73	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "?"}	2026-04-19 13:01:47.393709-04	1
74	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "qual o site oficial do alemao"}	2026-04-19 13:03:28.89776-04	1
75	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 14:18:26.94693-04	1
76	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 14:19:05.554993-04	1
77	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 19:24:16.820506-04	1
78	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-19 19:24:38.613287-04	1
79	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi, boa noite"}	2026-04-19 23:02:54.077487-04	1
80	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "queria falar com a monique"}	2026-04-19 23:05:21.077414-04	1
81	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi monique tudo bem?"}	2026-04-19 23:38:10.393129-04	1
82	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 05:31:08.255298-04	1
83	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 08:18:27.807842-04	1
84	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 08:18:32.337165-04	1
85	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	4a25736f-1db0-4c2b-9087-f4985ae8b38d	f	TEXT	{"body": "Boa tarde, vocé está trabalhando hoje?"}	2026-04-20 10:32:55.64734-04	1
86	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	4a25736f-1db0-4c2b-9087-f4985ae8b38d	f	IMAGE	{"body": ""}	2026-04-20 10:33:20.336195-04	1
87	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	4a25736f-1db0-4c2b-9087-f4985ae8b38d	f	TEXT	{"body": "💖 Olá, sou o gerente de contas da FOGO . GAME  \\n💎 Estou honrado por ter sido escolhido como vencedor pela nossa plataforma. Basta concluir o cadastro usando o link fornecido e você receberá  58 Bônus de graça. Deposite qualquer quantia e envie uma captura de tela do seu ID do jogo para ter a chance de ganhar de R$ 88 a R$ 8.888. Hoje é o último dia da promoção Rabbit Games, então tenho certeza que você vai ganhar!\\n\\nClique neste link e crie sua própria conta. Link do site oficial:💠👉  fogobet004.com"}	2026-04-20 10:33:20.647353-04	1
88	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	4a25736f-1db0-4c2b-9087-f4985ae8b38d	f	TEXT	{"body": "Quer trabalhar em nossa plataforma e ganhar cerca de Muita renda por dia?"}	2026-04-20 11:07:42.92873-04	1
89	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 11:25:42.508341-04	1
90	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	caf8cd29-d230-4bca-8881-a4a27ff8b29a	t	DOCUMENT	{"body": "282,35 energisa"}	2026-04-20 11:30:49.875135-04	1
91	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	caf8cd29-d230-4bca-8881-a4a27ff8b29a	t	DOCUMENT	{"body": "282,35 energisa"}	2026-04-20 11:30:50.100111-04	1
92	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 12:00:54.097458-04	1
93	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 12:29:30.928283-04	1
94	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	4a25736f-1db0-4c2b-9087-f4985ae8b38d	f	IMAGE	{"body": ""}	2026-04-20 12:38:01.074758-04	1
95	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	4a25736f-1db0-4c2b-9087-f4985ae8b38d	f	TEXT	{"body": "Se você confiar em mim e jogar com qualquer valor de depósito, eu o ajudarei a ganhar assim. Não vou ajudar ninguém que não acredita em mim. 99% de certeza de ganhar. Todo mundo que joga no meu link já fica feliz porque ganhou.⭐️Link 👉 fogobet004.com"}	2026-04-20 12:38:01.309299-04	1
96	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 14:00:17.467225-04	1
97	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 14:16:39.957642-04	1
98	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 15:31:57.584613-04	1
99	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	4a25736f-1db0-4c2b-9087-f4985ae8b38d	f	TEXT	{"body": "Amigo, sou gerente de contas na FOGO . GAME . Agora jogue o jogo do coelho no link que forneci. A maioria dos clientes joga o jogo do coelho e retira seus ganhos. Hoje é seu dia de sorte. Link 💠👉 fogobet004.com"}	2026-04-20 16:04:09.397212-04	1
100	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 17:45:48.488621-04	1
101	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 17:46:01.584167-04	1
102	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 19:12:51.367477-04	1
103	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 19:16:26.187605-04	1
104	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 19:22:39.026736-04	1
105	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 21:14:32.198083-04	1
106	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 22:33:57.777667-04	1
107	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-20 22:33:58.477896-04	1
108	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-22 21:14:12.937111-04	1
109	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-22 21:14:13.223347-04	1
110	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	4a25736f-1db0-4c2b-9087-f4985ae8b38d	f	TEXT	{"body": "Quer trabalhar em nossa plataforma e ganhar cerca de Muita renda por dia?"}	2026-04-22 21:14:24.961637-04	1
111	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	4a25736f-1db0-4c2b-9087-f4985ae8b38d	f	TEXT	{"body": "➡️ FORTUNE RABBIT\\n- ⏰19:05 | 19:10 | 19:21\\n- ⏰19:30 | 19:45 | 19:51\\n\\n\\n➡️ FORTUNE OX\\n- ⏰20:00 | 20:15 | 20:26\\n- ⏰20:38 | 20:42 | 20:53\\n\\n\\nDê a você um momento de ouro para ganhar dinheiro e eu o ajudarei a atingir a maior taxa de vitórias. Você deposita qualquer quantia e recebe mais reembolsos\\nLink VIP: 👉 fogobet004.com"}	2026-04-22 21:14:25.950932-04	1
112	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-22 22:25:55.761433-04	1
113	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-22 22:25:56.0295-04	1
114	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "Boa noite"}	2026-04-22 22:29:24.85173-04	1
115	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "me diga sobre o sistema de cotação online"}	2026-04-22 22:37:27.315969-04	1
116	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "quanto custa"}	2026-04-22 22:37:56.516636-04	1
117	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-23 03:23:36.187119-04	1
118	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-23 03:23:36.231832-04	1
119	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	1922f924-7a10-410b-8b28-479ebe3a77a2	f	TEXT	{"body": "Oi"}	2026-04-23 03:23:43.735163-04	1
120	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "Oi"}	2026-04-23 03:23:43.989212-04	1
121	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-24 23:01:59.909735-04	1
122	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-24 23:02:00.06193-04	1
123	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-25 22:52:54.535037-04	1
124	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-25 22:52:56.470264-04	1
125	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	c577b7dc-ffb2-455c-9dc6-dc4c31befa3c	t	TEXT	{"body": "Teste"}	2026-04-25 22:55:32.608097-04	1
126	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	c577b7dc-ffb2-455c-9dc6-dc4c31befa3c	t	TEXT	{"body": "Teste"}	2026-04-25 22:55:32.87648-04	1
127	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-25 23:45:44.988601-04	1
128	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 04:59:51.780793-04	1
129	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "Bom dia"}	2026-04-26 05:02:51.846602-04	1
130	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "em que fase esta a cotação #1"}	2026-04-26 05:03:14.27268-04	1
131	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "?"}	2026-04-26 05:35:39.344088-04	1
132	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "em que fase esta a cotação #1"}	2026-04-26 05:36:01.834744-04	1
133	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "?"}	2026-04-26 05:37:33.90104-04	1
134	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "?"}	2026-04-26 05:51:25.898686-04	1
135	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "em que fase esta a cotação #1"}	2026-04-26 05:51:39.406166-04	1
136	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 08:30:37.134374-04	1
137	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 10:27:48.700224-04	1
138	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 10:28:04.742215-04	1
139	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	1922f924-7a10-410b-8b28-479ebe3a77a2	f	TEXT	{"body": "?"}	2026-04-26 11:00:30.750079-04	1
140	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "?"}	2026-04-26 11:00:31.160446-04	1
141	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 11:09:05.302593-04	1
142	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 11:10:54.156922-04	1
143	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	caf8cd29-d230-4bca-8881-a4a27ff8b29a	t	TEXT	{"body": "https://developers.openai.com/api/docs/guides/prompt-guidance"}	2026-04-26 11:33:47.810555-04	1
144	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	caf8cd29-d230-4bca-8881-a4a27ff8b29a	t	TEXT	{"body": "https://developers.openai.com/api/docs/guides/prompt-guidance"}	2026-04-26 11:33:48.289092-04	1
145	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 11:53:12.011091-04	1
146	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 11:53:12.468391-04	1
147	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 12:26:55.418404-04	1
148	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 12:26:55.795826-04	1
149	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 12:38:39.249825-04	1
150	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 12:38:41.513528-04	1
151	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 13:17:56.124897-04	1
152	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 13:17:56.528765-04	1
153	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi"}	2026-04-26 15:42:28.505292-04	1
154	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "em que fase esta a cotação #1"}	2026-04-26 15:42:56.242808-04	1
155	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 17:02:26.97216-04	1
156	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 17:02:56.781362-04	1
157	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "Boa noite consegue ver o status e a lista de produtos do pedido #1", "pushName": "Rui Cesar"}	2026-04-26 20:36:28.230343-04	1
158	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "cotação #1", "pushName": "Rui Cesar"}	2026-04-26 20:37:06.622114-04	1
159	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "????/??", "pushName": "Rui Cesar"}	2026-04-26 20:38:00.413054-04	1
160	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 20:45:45.366189-04	1
161	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "Boa noite", "pushName": "Rui Cesar"}	2026-04-26 20:51:47.825741-04	1
162	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "Cotação #3 em qual estagio esta?", "pushName": "Rui Cesar"}	2026-04-26 20:52:24.74134-04	1
163	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "???????????", "pushName": "Rui Cesar"}	2026-04-26 20:53:47.891568-04	1
164	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oie, verifique novamente cotação #1", "pushName": "Rui Cesar"}	2026-04-26 21:15:16.907968-04	1
165	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "sim, desculpe a demora me disseram que esta tudo certinho", "pushName": "Rui Cesar"}	2026-04-26 22:08:18.43463-04	1
166	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 22:36:14.545599-04	1
167	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 22:36:14.76131-04	1
168	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 23:21:40.502515-04	1
169	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-26 23:21:40.871064-04	1
170	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "teste1", "pushName": "Rui Cesar"}	2026-04-26 23:46:23.141094-04	1
171	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "sim, estou testando!!!", "pushName": "Rui Cesar"}	2026-04-26 23:46:56.493833-04	1
172	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 08:32:20.70261-04	1
173	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 08:32:20.703074-04	1
174	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	caf8cd29-d230-4bca-8881-a4a27ff8b29a	t	DOCUMENT	{"body": "334,29", "pushName": null}	2026-04-27 08:32:30.430226-04	1
175	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	caf8cd29-d230-4bca-8881-a4a27ff8b29a	t	TEXT	{"body": "Oi", "pushName": "Odonto Digital Ms"}	2026-04-27 08:32:33.654063-04	1
176	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	caf8cd29-d230-4bca-8881-a4a27ff8b29a	t	DOCUMENT	{"body": "334,29", "pushName": "Odonto Digital Ms"}	2026-04-27 08:32:33.687307-04	1
177	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	1922f924-7a10-410b-8b28-479ebe3a77a2	t	TEXT	{"body": "Oi", "pushName": null}	2026-04-27 08:32:33.727723-04	1
178	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 08:36:17.427051-04	1
179	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 08:36:17.742408-04	1
180	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 08:44:39.921205-04	1
181	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 08:44:39.928357-04	1
182	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 08:45:34.665733-04	1
183	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 08:45:34.7269-04	1
184	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 08:53:44.346374-04	1
185	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 08:53:44.979496-04	1
186	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 09:40:43.928218-04	1
187	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 09:40:43.938663-04	1
188	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "Botões New", "pushName": "Rui Cesar"}	2026-04-27 09:46:32.219998-04	1
189	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 09:55:24.679537-04	1
190	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 09:55:25.412863-04	1
191	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 10:05:41.620965-04	1
192	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 10:05:42.522615-04	1
193	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 11:09:35.369189-04	1
194	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 11:09:35.660583-04	1
195	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 11:15:00.852338-04	1
196	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 11:15:00.860787-04	1
197	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "teste", "pushName": "Rui Cesar"}	2026-04-27 11:18:28.237819-04	1
198	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 11:28:52.849222-04	1
199	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 11:28:53.069099-04	1
200	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "texto", "pushName": "Rui Cesar"}	2026-04-27 11:39:00.752086-04	1
201	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 11:49:17.762768-04	1
202	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 11:49:18.497219-04	1
203	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 11:53:02.939856-04	1
204	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 11:53:03.339065-04	1
205	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 12:10:45.878036-04	1
206	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 12:10:46.116001-04	1
207	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 12:50:27.469388-04	1
208	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 13:20:33.929294-04	1
209	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 13:20:34.12423-04	1
210	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "teste", "pushName": "Rui Cesar"}	2026-04-27 13:52:18.843153-04	1
211	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 13:57:39.361838-04	1
212	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 13:57:39.466066-04	1
213	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	BUTTONS	{"body": null, "pushName": "Rui Cesar"}	2026-04-27 13:59:21.696585-04	1
214	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	BUTTONS	{"body": null, "pushName": "Rui Cesar"}	2026-04-27 13:59:49.171234-04	1
215	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 14:03:23.135981-04	1
216	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 14:03:23.166591-04	1
217	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "adawdaw", "pushName": "Rui Cesar"}	2026-04-27 14:04:27.667861-04	1
218	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 14:12:52.793732-04	1
219	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 14:12:53.304336-04	1
220	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 14:14:27.296609-04	1
221	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 14:14:27.817809-04	1
222	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 14:23:55.239149-04	1
223	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 14:23:55.673113-04	1
224	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	f832090c-d21c-4a7b-8bb2-7af70bd13970	t	BUTTONS	{"body": null, "pushName": null}	2026-04-27 14:42:33.832463-04	1
225	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 15:03:50.01519-04	1
226	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 15:03:50.088133-04	1
227	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	POLL	{"body": null, "pushName": "Rui Cesar"}	2026-04-27 15:18:37.704058-04	1
228	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 15:27:19.838906-04	1
229	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 15:27:19.915921-04	1
230	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi", "pushName": "Rui Cesar"}	2026-04-27 15:31:10.784019-04	1
231	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "preciso de ajuda", "pushName": "Rui Cesar"}	2026-04-27 15:31:17.402868-04	1
232	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi", "pushName": "Rui Cesar"}	2026-04-27 15:31:56.377786-04	1
233	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "IA????", "pushName": "Rui Cesar"}	2026-04-27 15:33:20.393139-04	1
234	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	f832090c-d21c-4a7b-8bb2-7af70bd13970	t	BUTTONS	{"body": null, "pushName": null}	2026-04-27 15:37:58.758741-04	1
235	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 15:43:49.279021-04	1
236	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 15:43:49.550811-04	1
237	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	f832090c-d21c-4a7b-8bb2-7af70bd13970	t	BUTTONS	{"body": null, "pushName": null}	2026-04-27 15:51:20.021332-04	1
238	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 15:56:11.593405-04	1
239	0e30a661-6d23-4ff2-838f-f39d58241662	message.new	out	f832090c-d21c-4a7b-8bb2-7af70bd13970	t	BUTTONS	{"body": null, "pushName": null}	2026-04-27 15:57:57.608871-04	1
240	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 16:03:15.27428-04	1
241	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 16:03:23.259108-04	1
242	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 17:43:45.819374-04	1
243	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 17:49:19.419093-04	1
244	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-27 17:50:53.626074-04	1
245	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 10:38:52.737271-04	1
246	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 10:38:54.749042-04	1
247	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi", "pushName": "Rui Cesar"}	2026-04-28 13:14:10.523632-04	1
248	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 13:20:53.50533-04	1
249	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 13:56:05.28695-04	1
250	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 13:56:05.571171-04	1
251	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi", "pushName": "Rui Cesar"}	2026-04-28 13:56:36.977476-04	1
252	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "io", "pushName": "Rui Cesar"}	2026-04-28 13:58:16.0593-04	1
253	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi", "pushName": "Rui Cesar"}	2026-04-28 13:58:25.443008-04	1
254	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oque foi pedido em PED-20260426-4", "pushName": "Rui Cesar"}	2026-04-28 14:00:35.29349-04	1
255	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "e os produtos?", "pushName": "Rui Cesar"}	2026-04-28 14:01:00.236614-04	1
256	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 14:17:03.763713-04	1
257	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 14:17:03.956382-04	1
258	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 14:56:37.963302-04	1
259	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 16:31:38.016991-04	1
260	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "???", "pushName": "Rui Cesar"}	2026-04-28 17:02:12.862471-04	1
261	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 17:03:55.825278-04	1
263	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "??", "pushName": "Rui Cesar"}	2026-04-28 17:07:46.048045-04	1
264	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 17:21:42.803005-04	1
265	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "coca cola esta em promoção hoje?", "pushName": "Rui Cesar"}	2026-04-28 17:23:10.434235-04	1
266	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "veja quanto sai 3 engradados de coca cola", "pushName": "Rui Cesar"}	2026-04-28 17:24:50.197666-04	1
267	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 17:38:05.811372-04	1
268	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-28 17:44:42.181667-04	1
269	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 00:27:48.768941-04	1
270	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 00:27:48.978083-04	1
271	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi", "pushName": "Rui Cesar"}	2026-04-29 00:40:43.12595-04	1
272	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "????", "pushName": "Rui Cesar"}	2026-04-29 01:13:35.497372-04	1
273	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 01:40:44.184804-04	1
274	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 01:40:44.206663-04	1
275	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 01:45:15.604595-04	1
276	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 01:45:16.089439-04	1
277	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	DOCUMENT	{"body": "verifique o status deste pedido", "pushName": "Rui Cesar"}	2026-04-29 01:45:52.035282-04	1
278	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	DOCUMENT	{"body": "[documento PDF] O documento é um comprovante de pedido de uma loja chamada Alemão Conveniências. O número do pedido é PED-20260426-3, datado de 26 de abril de 2026, às 01:34. O total do pedido é R$ 19,76, pago via PIX, e o status do pedido é \\"ENTREGUE\\".\\n\\nOs produtos listados no pedido incluem: 1 absorvente Intimu (R$ 7,49), 1 água com gás de 500ml (R$ 4,29), 1 água mineral de 500ml (R$ 1,99) e 1 amendoim crocante (R$ 5,99). Não há informações sobre o nome do cliente ou CNPJ/CPF no documento.\\n\\nA instrução ao cliente é um agradecimento pela preferência, com o site da loja disponível para mais informações: alemaoconveniencias.local.", "hasMedia": true, "pushName": "Rui Cesar", "originalCaption": "verifique o status deste pedido"}	2026-04-29 01:46:56.217639-04	1
279	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 09:09:46.702798-04	1
280	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 09:09:47.44051-04	1
281	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 09:49:39.160985-04	1
282	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 13:57:02.752476-04	1
283	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 14:17:23.158106-04	1
284	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 14:34:06.499063-04	1
285	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 15:10:06.604611-04	1
286	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 15:10:07.618204-04	1
287	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 15:12:11.545111-04	1
288	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 15:12:12.189551-04	1
289	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 15:17:40.80086-04	1
290	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 15:17:41.192588-04	1
291	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 16:43:32.423011-04	1
292	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 16:43:33.697077-04	1
293	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 16:44:04.258738-04	1
294	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 16:44:04.451105-04	1
295	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 17:16:39.651047-04	1
296	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 17:34:33.781782-04	1
297	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 17:39:05.472143-04	1
298	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 17:45:39.258205-04	1
299	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 17:48:43.120734-04	1
300	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 19:01:51.929621-04	1
301	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 19:44:22.266539-04	1
302	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 21:14:30.374463-04	1
303	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 21:14:39.090087-04	1
304	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 21:16:11.7426-04	1
305	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 21:17:30.130121-04	1
306	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 21:17:30.821103-04	1
307	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 21:22:56.111532-04	1
308	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 21:22:56.140717-04	1
309	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 21:26:20.59983-04	1
310	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 21:26:20.818814-04	1
311	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 23:13:16.068088-04	1
312	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-29 23:13:16.701375-04	1
313	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 01:27:52.023156-04	1
314	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 01:33:38.561829-04	1
315	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 01:33:40.324706-04	1
316	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 02:22:04.748187-04	1
317	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 06:52:49.0371-04	1
318	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 06:53:07.020365-04	1
319	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 12:17:03.871618-04	1
320	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 12:31:37.271558-04	1
321	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 12:58:50.408938-04	1
322	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 13:13:52.595789-04	1
323	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 14:49:09.982108-04	1
324	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 14:49:10.286474-04	1
325	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 17:26:08.847562-04	1
326	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 17:46:10.876765-04	1
327	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 17:46:32.088606-04	1
328	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 17:52:45.050492-04	1
329	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 17:59:05.437939-04	1
330	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-04-30 18:32:21.329697-04	1
331	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-01 00:33:19.224806-04	1
332	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-01 00:33:19.420837-04	1
333	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-01 00:37:55.843094-04	1
334	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-01 00:37:55.938532-04	1
335	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-01 06:27:02.731355-04	1
336	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-01 11:16:25.705951-04	1
337	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-03 22:36:14.490998-04	1
338	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-03 22:36:14.547427-04	1
339	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-03 23:34:08.518693-04	1
340	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-04 06:49:06.681469-04	1
341	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-04 09:39:29.125267-04	1
342	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oie", "pushName": "Rui Cesar"}	2026-05-04 10:01:42.437092-04	1
343	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "foi entregue o pedido PED-20260427-5 ? Estou na rua não sei se entregaram", "pushName": "Rui Cesar"}	2026-05-04 10:02:43.635194-04	1
344	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "?", "pushName": "Rui Cesar"}	2026-05-04 10:05:30.931312-04	1
345	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-04 10:17:09.254089-04	1
346	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-04 12:03:13.557752-04	1
347	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-04 12:42:00.394618-04	1
348	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-04 12:42:21.251504-04	1
349	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-04 15:22:39.76144-04	1
350	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-04 15:22:44.953994-04	1
351	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-04 15:32:13.219765-04	1
352	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-05 09:57:35.319141-04	1
353	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-05 09:57:35.48215-04	1
354	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-05 10:20:00.963086-04	1
355	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-05 11:56:14.500187-04	1
356	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-05 11:56:14.872186-04	1
357	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi", "pushName": "Rui Cesar"}	2026-05-05 12:12:07.563253-04	1
358	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	DOCUMENT	{"body": "[documento PDF] O documento é um pedido de compra da empresa \\"ALEMÃO CONVENIÊNCIAS\\". A data do pedido é 26/04/2026, com o número de protocolo PED-20260427-5. O total da compra é R$ 11,47, que inclui dois itens: Água Mineral 500ml (2x R$ 1,99) e Biscoito Oreo 120g (1x R$ 7,49). O pagamento foi realizado via PIX.\\n\\nO status do pedido é \\"ENTREGUE\\". Não há informações sobre o nome do cliente ou CNPJ/CPF no documento. A instrução ao cliente é um agradecimento pela preferência, com o site da empresa mencionado como alemaoconveniencias.local.", "hasMedia": true, "pushName": "Rui Cesar", "originalCaption": "qual o estatus do pedido?"}	2026-05-05 12:13:18.837463-04	1
359	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "?", "pushName": "Rui Cesar"}	2026-05-05 12:15:06.537213-04	1
360	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "valor do Chiclete Trident Melancia?", "pushName": "Rui Cesar"}	2026-05-05 12:16:57.551834-04	1
361	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-05 12:43:00.199221-04	1
362	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-05 12:43:01.063298-04	1
363	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-05 12:43:44.977192-04	1
364	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-05 12:43:45.370498-04	1
365	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "oi", "pushName": "Rui Cesar"}	2026-05-05 13:23:22.834425-04	1
366	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "como eu falo com Rui Cesar", "pushName": "Rui Cesar"}	2026-05-05 13:24:12.093561-04	1
367	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	in	caf8cd29-d230-4bca-8881-a4a27ff8b29a	f	TEXT	{"body": "Bruno Castro, esta no local neste momento?", "pushName": "Rui Cesar"}	2026-05-05 13:42:07.787442-04	1
368	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-06 22:42:26.436263-04	1
369	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-06 22:42:27.058129-04	1
370	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-06 23:54:45.277008-04	1
371	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-06 23:54:46.274282-04	1
372	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-07 07:50:52.195318-04	1
373	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-07 07:50:52.562478-04	1
374	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-07 08:12:43.018429-04	1
375	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-07 08:12:53.537602-04	1
376	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-07 19:01:17.603282-04	1
377	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-07 19:01:28.225633-04	1
378	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-07 19:34:03.596487-04	1
379	fb8adc42-8ecd-44f8-964a-8ad144fac999	message.new	out	caf8cd29-d230-4bca-8881-a4a27ff8b29a	t	TEXT	{"body": "oi", "pushName": "Odonto Digital Ms"}	2026-05-07 19:34:10.294129-04	1
380	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-07 20:24:52.831201-04	1
381	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-08 13:50:40.448144-04	1
382	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-08 13:50:41.457883-04	1
383	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-08 14:35:23.589871-04	1
384	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-08 15:48:42.196447-04	1
385	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-08 15:49:00.496154-04	1
386	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-08 16:39:44.269031-04	1
387	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-08 17:07:44.201426-04	1
388	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-09 17:04:36.079373-04	1
389	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-09 17:04:39.122858-04	1
390	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-11 16:15:17.961607-04	1
391	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-11 16:15:20.513911-04	1
392	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-11 16:16:32.466747-04	1
393	fb8adc42-8ecd-44f8-964a-8ad144fac999	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-11 16:37:34.303495-04	1
394	0e30a661-6d23-4ff2-838f-f39d58241662	session.status	in	\N	f	\N	{"status": "connected"}	2026-05-11 16:37:34.484062-04	1
\.


--
-- Data for Name: nw_handoff; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.nw_handoff (chat_id, tenant_id, human_until, updated_at) FROM stdin;
caf8cd29-d230-4bca-8881-a4a27ff8b29a	1	\N	2026-04-29 15:21:02.876263-04
\.


--
-- Data for Name: nw_router_metrics; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.nw_router_metrics (id, created_at, chat_id, handler, intent, user_msg, reply_chars, ctx_chars, saved_chars) FROM stdin;
1	2026-04-26 15:42:31.725303-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	oi	33	2462	2538
2	2026-04-26 20:36:36.929846-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	Boa noite consegue ver o status e a lista de produtos do pedido #1	155	2462	2538
3	2026-04-26 20:38:03.007826-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	????/??	172	2462	2538
4	2026-04-26 20:51:49.365785-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	Boa noite	42	2462	2538
5	2026-04-26 20:53:50.895505-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	???????????	137	2462	2538
6	2026-04-26 21:15:17.306882-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	local	cotacao_lookup	oie, verifique novamente cotação #1	150	0	5000
7	2026-04-26 22:08:21.258958-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	sim, desculpe a demora me disseram que esta tudo certinho	146	2920	2080
8	2026-04-26 23:46:28.981425-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	teste1	87	2928	2072
9	2026-04-27 09:46:35.164896-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	Botões New	135	2888	2112
10	2026-04-27 11:18:32.055369-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	teste	72	2890	2110
11	2026-04-27 11:39:03.961139-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	texto	118	2890	2110
12	2026-04-28 13:58:59.377591-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	saudacao_simples,msg_curta_ambigua	oi	33	3230	1770
13	2026-04-28 13:59:02.578398-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	msg_curta_ambigua	io	33	2947	2053
14	2026-04-28 14:00:35.612967-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	local	cotacao_lookup	oque foi pedido em PED-20260426-4	79	0	5000
15	2026-04-28 17:02:46.603671-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	[O cliente enviou apenas "???" sem contexto anterior nas últimas 2h. Responda com uma saudação curta perguntando como pode ajudar.]	49	3430	1570
16	2026-04-28 17:08:04.655728-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	[Atenção: o cliente está cobrando uma resposta. Há 187min ele perguntou:\n"e os produtos?"\nAgora ele reenviou apenas "??" para chamar atenção. Responda à pergunta original o mais diretamente possível. 	240	3705	1295
17	2026-04-28 17:23:45.59952-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	coca cola esta em promoção hoje?	115	4245	755
18	2026-04-28 17:25:04.53174-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	veja quanto sai 3 engradados de coca cola	213	4261	739
19	2026-04-29 00:41:03.535659-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	saudacao_simples,msg_curta_ambigua	oi	33	3810	1190
20	2026-04-29 01:14:03.979292-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	[O cliente enviou apenas "????" sem contexto anterior nas últimas 2h. Responda com uma saudação curta perguntando como pode ajudar.]	50	3468	1532
21	2026-04-29 01:47:03.420579-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	local	cotacao_lookup	[documento PDF] O documento é um comprovante de pedido de uma loja chamada Alemão Conveniências. O número do pedido é PED-20260426-3, datado de 26 de abril de 2026, às 01:34. O total do pedido é R$ 19	307	0	5000
22	2026-05-04 10:02:04.163416-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	msg_curta_ambigua	oie	43	3489	1511
23	2026-05-04 10:06:04.330684-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	[Atenção: o cliente está cobrando uma resposta. Há 3min ele perguntou:\n"foi entregue o pedido PED-20260427-5 ? Estou na rua não sei se entregaram"\nAgora ele reenviou apenas "?" para chamar atenção. Re	138	4019	981
24	2026-05-05 12:12:43.499337-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	saudacao_simples,msg_curta_ambigua	oi	33	3772	1228
25	2026-05-05 12:15:42.114914-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	pergunta_pagamento	[Atenção: o cliente está cobrando uma resposta. Há 2min ele perguntou:\n"[documento PDF] O documento é um pedido de compra da empresa "ALEMÃO CONVENIÊNCIAS". A data do pedido é 26/04/2026, com o número	154	4574	426
26	2026-05-05 12:17:04.336061-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	valor do Chiclete Trident Melancia?	85	3582	1418
27	2026-05-05 13:23:35.582477-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	saudacao_simples,msg_curta_ambigua	oi	52	3772	1228
28	2026-05-05 13:42:21.630961-04	caf8cd29-d230-4bca-8881-a4a27ff8b29a	llm	\N	Bruno Castro, esta no local neste momento?	151	3430	1570
\.


--
-- Data for Name: orders; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.orders (id, customer_id, user_cpf, total_amount, status, payment_method, qr_code, qr_code_url, pix_copy_paste, created_at, updated_at, asaas_payment_id, tenant_id) FROM stdin;
8636b360-3912-4fbc-bfe6-ec34cd3f5406	\N	04638245129	5.00	pending	PIX	\N	\N	\N	2026-04-15 21:21:56.276361-04	2026-04-15 21:21:56.276361-04	\N	1
b40b5116-0d71-4b5b-98a0-28e76b95eecf	\N	12345678909	5.00	pending	PIX	\N	\N	\N	2026-04-15 21:47:29.032572-04	2026-04-15 21:47:29.032572-04	\N	1
de545baa-efa4-49c4-8cc1-d7d32304d961	\N	04638245129	5.00	pending	PIX	\N	\N	\N	2026-04-17 10:38:45.706604-04	2026-04-17 10:38:45.706604-04	\N	1
781a8183-5d3e-484d-829a-beebc74d64c5	\N	04638245129	5.00	pending	PIX	\N	\N	\N	2026-04-17 10:39:00.695516-04	2026-04-17 10:39:00.695516-04	\N	1
\.


--
-- Data for Name: password_reset_tokens; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.password_reset_tokens (id, user_id, token, expires_at, used, created_at) FROM stdin;
\.


--
-- Data for Name: pedido_itens; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.pedido_itens (id, pedido_id, produto_id, nome_produto, sku, quantidade, preco_unitario, desconto_pct, subtotal, separado, created_at, preco_promocional, observacao, alerta_tipo, alerta_obs, alerta_foto, alerta_confirmado, alerta_em) FROM stdin;
3	3	23	Absorvente Intimus c/8	INTI-8	1.000	7.49	0.00	7.49	t	2026-04-26 03:51:43.043452-04	\N	\N	\N	\N	\N	f	\N
4	3	12	Água com Gás 500ml	AGUAG-500	1.000	4.29	0.00	4.29	t	2026-04-26 03:51:43.055938-04	\N	\N	\N	\N	\N	f	\N
5	3	5	Água Mineral 500ml	AGUA-500	1.000	3.50	0.00	1.99	t	2026-04-26 03:51:43.06072-04	\N	\N	\N	\N	\N	f	\N
6	3	26	Amendoim Crocante 150g	AMEND-150	1.000	5.99	0.00	5.99	t	2026-04-26 03:51:43.065184-04	\N	\N	\N	\N	\N	f	\N
7	4	23	Absorvente Intimus c/8	INTI-8	1.000	7.49	0.00	7.49	t	2026-04-26 17:58:08.701646-04	\N	\N	\N	\N	\N	f	\N
8	4	12	Água com Gás 500ml	AGUAG-500	1.000	4.29	0.00	4.29	t	2026-04-26 17:58:08.713778-04	\N	\N	\N	\N	\N	f	\N
9	5	5	Água Mineral 500ml	AGUA-500	1.000	3.50	0.00	1.99	t	2026-04-27 15:30:17.34567-04	\N	\N	\N	\N	\N	f	\N
10	5	5	Água Mineral 500ml	AGUA-500	1.000	3.50	0.00	1.99	t	2026-04-27 15:30:17.353035-04	\N	\N	\N	\N	\N	f	\N
11	5	30	Biscoito Oreo 120g	OREO-120	1.000	7.49	0.00	7.49	t	2026-04-27 15:30:17.35754-04	\N	\N	\N	\N	\N	f	\N
\.


--
-- Data for Name: pedido_status_log; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.pedido_status_log (id, pedido_id, status, account_id, created_at) FROM stdin;
1	3	aguardando	\N	2026-04-26 03:51:43.038207-04
2	4	aguardando	\N	2026-04-26 17:58:08.675885-04
3	5	aguardando	\N	2026-04-27 15:30:17.332098-04
4	4	separacao	2	2026-04-28 21:45:25.438197-04
5	4	embalagem	\N	2026-04-28 21:45:49.965011-04
6	5	separacao	2	2026-04-28 22:21:05.890075-04
7	5	embalagem	13	2026-05-04 09:57:29.450497-04
8	5	auditoria	2	2026-05-04 09:57:31.875716-04
9	5	fiscal	2	2026-05-04 09:57:39.091105-04
10	5	expedicao	2	2026-05-04 09:57:44.973106-04
11	5	entregue	20	2026-05-04 09:57:53.898992-04
12	4	auditoria	2	2026-05-04 10:17:00.687932-04
13	4	fiscal	2	2026-05-04 10:17:02.049714-04
14	4	expedicao	2	2026-05-04 10:17:03.096118-04
15	4	entregue	18	2026-05-04 10:17:11.89784-04
\.


--
-- Data for Name: pedidos; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.pedidos (id, tenant_id, cotacao_id, cliente_id, user_id, endereco_id, status, forma_pagto, tipo_entrega, total, desconto, observacao, equipe_id, responsavel_entrega, entregue_em, created_at, updated_at, embalador, embalado_em, protocolo, end_cep, end_rua, end_numero, end_complemento, end_bairro, end_cidade, end_estado, financeiro_status, financeiro_obs, financeiro_em, embalador_id, expedidor_id, separador_id, auditor_id, fiscal_id, cupom_numero, cupom_chave, cupom_emitido_em, cupom_emitido_por, expedidor_saida_em) FROM stdin;
3	1	1	\N	7	\N	entregue	pix	retirada	19.76	0.00	obs teste	\N	Mily	2026-04-26 05:01:35.541142-04	2026-04-26 03:51:43.038207-04	2026-04-26 05:01:35.541142-04	Junior	2026-04-26 05:00:48.024673-04	PED-20260426-3	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
5	1	3	\N	7	\N	entregue	pix	retirada	11.47	0.00	\N	\N	\N	2026-05-04 09:57:53.892211-04	2026-04-27 15:30:17.332098-04	2026-05-04 09:57:53.892211-04	\N	2026-05-04 09:57:29.442948-04	PED-20260427-5	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	13	20	\N	15	\N	\N	\N	\N	\N	\N
4	1	2	\N	7	\N	entregue	pix	retirada	11.78	0.00	rui vai pegar	\N	\N	2026-05-04 10:17:11.892865-04	2026-04-26 17:58:08.675885-04	2026-05-04 10:17:11.892865-04	José	2026-04-28 21:45:49.958965-04	PED-20260426-4	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	18	\N	\N	\N	\N	\N	\N	\N	\N
\.


--
-- Data for Name: pedidos_recorrentes; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.pedidos_recorrentes (id, tenant_id, user_id, cliente_id, nome, itens, frequencia, proximo_em, ativo, pausado, created_at, updated_at) FROM stdin;
\.


--
-- Data for Name: plugin_configs; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.plugin_configs (plugin_id, key, value) FROM stdin;
newwhats	integration_key	nw_test_alemao_integration_key_001
newwhats	newwhats_url	http://127.0.0.1:8008
newwhats	webhook_secret	e75c28beaf1fe5f68330364c90eb13f9cbe74518101ccd2d4c30f447361f6ef6
newwhats	auto_reply_mode	automatico
newwhats	persona_key	conveniencia_amigavel
\.


--
-- Data for Name: plugins; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.plugins (id, active, installed_at) FROM stdin;
newwhats	1	2026-04-15 20:42:27.26828-04
\.


--
-- Data for Name: price_logs; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.price_logs (id, raffle_id, order_id, user_cpf, price_applied, rule_id, created_at) FROM stdin;
1	1	8636b360-3912-4fbc-bfe6-ec34cd3f5406	04638245129	5.00	\N	2026-04-15 21:21:56.309664-04
2	1	b40b5116-0d71-4b5b-98a0-28e76b95eecf	12345678909	5.00	\N	2026-04-15 21:47:29.092865-04
3	1	de545baa-efa4-49c4-8cc1-d7d32304d961	04638245129	5.00	\N	2026-04-17 10:38:45.739051-04
\.


--
-- Data for Name: produtos; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.produtos (id, tenant_id, sku, nome, descricao, unidade, preco, estoque, categoria, imagem, ativo, created_at, updated_at, preco_promocional) FROM stdin;
1	1	COCA-2L	Coca-Cola 2L	Refrigerante Coca-Cola 2 Litros	un	12.99	50.000	Bebidas	\N	t	2026-04-26 02:06:55.725985-04	2026-04-26 02:06:55.725985-04	8.99
2	1	HEIN-350	Cerveja Heineken 350ml	Cerveja Heineken Long Neck 350ml	un	7.99	80.000	Bebidas	\N	t	2026-04-26 02:06:55.725985-04	2026-04-26 02:06:55.725985-04	5.49
3	1	DORI-96	Doritos 96g	Salgadinho Doritos sabor Queijo Nacho	un	9.99	60.000	Snacks	\N	t	2026-04-26 02:06:55.725985-04	2026-04-26 02:06:55.725985-04	6.99
4	1	RBULL-250	Energético Red Bull 250ml	Energético Red Bull Lata 250ml	un	11.99	40.000	Bebidas	\N	t	2026-04-26 02:06:55.725985-04	2026-04-26 02:06:55.725985-04	8.99
5	1	AGUA-500	Água Mineral 500ml	Água Mineral sem Gás 500ml	un	3.50	200.000	Bebidas	\N	t	2026-04-26 02:06:55.725985-04	2026-04-26 02:06:55.725985-04	1.99
6	1	BIS-126	Chocolate Bis 126g	Chocolate Bis ao Leite Lacta 126g	un	8.49	45.000	Doces	\N	t	2026-04-26 02:06:55.725985-04	2026-04-26 02:06:55.725985-04	5.99
7	1	PEPSI-2L	Pepsi 2L	Refrigerante Pepsi 2 Litros	un	10.99	40.000	Bebidas	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
8	1	GUAR-2L	Guaraná Antarctica 2L	Refrigerante Guaraná Antarctica 2 Litros	un	10.49	35.000	Bebidas	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
9	1	DELV-1L	Suco Del Valle Laranja 1L	Suco de Laranja Del Valle 1 Litro	un	8.99	30.000	Bebidas	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
10	1	LEITE-1L	Leite Integral 1L	Leite Integral Longa Vida 1L	un	5.49	60.000	Laticínios	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
11	1	SKOL-350	Cerveja Skol Lata 350ml	Cerveja Skol Lata 350ml	un	3.99	100.000	Bebidas	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
12	1	AGUAG-500	Água com Gás 500ml	Água Mineral com Gás 500ml	un	4.29	80.000	Bebidas	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
13	1	PRING-114	Pringles Original 114g	Batata Pringles sabor Original 114g	un	14.99	25.000	Snacks	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
14	1	RUFF-137	Ruffles Costela 137g	Salgadinho Ruffles Costela 137g	un	9.49	30.000	Snacks	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
15	1	CHEE-100	Cheetos Requeijão 100g	Salgadinho Cheetos Requeijão 100g	un	7.99	40.000	Snacks	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
16	1	PIPE-100	Pipoca Manteiga 100g	Pipoca Manteiga Elma Chips 100g	un	5.99	50.000	Snacks	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
17	1	SDV-1UN	Bombom Sonho de Valsa	Bombom Sonho de Valsa unitário	un	3.49	100.000	Doces	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
18	1	TRID-MEL	Chiclete Trident Melancia	Chiclete Trident Melancia 8g	un	2.49	200.000	Doces	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
19	1	MMS-45	M&Ms Chocolate 45g	Confeito de Chocolate M&Ms 45g	un	6.99	60.000	Doces	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
20	1	KITKAT-45	KitKat ao Leite 45g	Chocolate KitKat ao Leite 45g	un	5.49	55.000	Doces	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
21	1	JONTEX-3	Preservativo Jontex c/3	Preservativo Lubrificado Jontex c/3	pct	9.99	40.000	Higiene	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
22	1	LENCO-50	Lenço de Papel 50un	Lenço de Papel Kleenex 50 unidades	pct	4.99	35.000	Higiene	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
23	1	INTI-8	Absorvente Intimus c/8	Absorvente Intimus Suave c/8	pct	7.49	25.000	Higiene	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
24	1	MARL-RED	Cigarro Marlboro Red	Maço Marlboro Vermelho	un	13.99	50.000	Tabacaria	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
25	1	BIC-ISQ	Isqueiro BIC	Isqueiro BIC colorido sortido	un	4.99	80.000	Tabacaria	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
26	1	AMEND-150	Amendoim Crocante 150g	Amendoim Crocante Dori 150g	un	5.99	45.000	Alimentos	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
27	1	QUAKER-BC	Barra Cereal Quaker	Barra de Cereal Aveia e Mel Quaker	un	3.29	60.000	Alimentos	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
28	1	DANO-100	Iogurte Danoninho 100g	Iogurte Danoninho Morango 100g	un	2.99	30.000	Laticínios	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
29	1	PILAO-250	Café Pilão 250g	Café Torrado e Moído Pilão 250g	un	9.99	40.000	Alimentos	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
30	1	OREO-120	Biscoito Oreo 120g	Biscoito Oreo Recheio Original 120g	un	7.49	35.000	Doces	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
31	1	RBULL-TRP	Red Bull Tropical 250ml	Energético Red Bull Tropical 250ml	un	11.99	30.000	Bebidas	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
32	1	MONST-473	Monster Energy 473ml	Energético Monster Energy 473ml	un	12.99	25.000	Bebidas	\N	t	2026-04-26 02:06:55.73258-04	2026-04-26 02:06:55.73258-04	\N
\.


--
-- Data for Name: promotions; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.promotions (id, nome, descricao, preco_original, preco_promocional, imagem, ativo, data_criacao, tenant_id) FROM stdin;
1	Coca-Cola 2L	Refrigerante Coca-Cola 2 Litros	12.99	8.99	/images/products/coca-cola.png	t	2026-03-04 06:33:49-04	1
2	Cerveja Heineken 350ml	Cerveja Heineken Long Neck 350ml	7.99	5.49	/images/products/heineken.png	t	2026-03-04 06:33:49-04	1
3	Doritos 96g	Salgadinho Doritos sabor Queijo Nacho	9.99	6.99	/images/products/doritos.png	t	2026-03-04 06:33:49-04	1
4	Energético Red Bull 250ml	Energético Red Bull Lata 250ml	11.99	8.99	/images/products/red-bull.png	t	2026-03-04 06:33:49-04	1
5	Água Mineral 500ml	Água Mineral sem Gás 500ml	3.50	1.99	/images/products/agua.png	t	2026-03-04 06:33:49-04	1
6	Chocolate Bis 126g	Chocolate Bis ao Leite Lacta 126g	8.49	5.99	/images/products/bis.png	t	2026-03-04 06:33:49-04	1
\.


--
-- Data for Name: protocol_flags; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.protocol_flags (id, tenant_id, thread_id, account_id, type, note, created_at) FROM stdin;
\.


--
-- Data for Name: protocol_ratings; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.protocol_ratings (id, tenant_id, thread_id, chat_id, account_id, rating, status, sent_at, rated_at) FROM stdin;
\.


--
-- Data for Name: raffle_claims; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.raffle_claims (id, raffle_id, ticket_id, user_cpf, status, delivery_address, delivery_notes, claimed_at, updated_at, notified_at) FROM stdin;
\.


--
-- Data for Name: raffle_discounts; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.raffle_discounts (id, raffle_id, min_qty, discount_pct, active, created_at) FROM stdin;
8	1	3	10.00	t	2026-04-21 01:30:12.010676-04
9	1	5	15.00	t	2026-04-21 01:30:12.010676-04
10	1	10	20.00	t	2026-04-21 01:30:12.010676-04
11	1	20	40.00	t	2026-04-21 01:30:12.010676-04
\.


--
-- Data for Name: raffle_draw_logs; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.raffle_draw_logs (id, raffle_id, seed, result_number, executed_at, ip, created_at) FROM stdin;
\.


--
-- Data for Name: raffle_flash_promos; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.raffle_flash_promos (id, raffle_id, discount_pct, label, starts_at, ends_at, created_at) FROM stdin;
1	1	60.00	Promoção Relâmpago	2026-04-21 01:32:52.132023-04	2026-04-21 02:02:52.132023-04	2026-04-21 01:32:52.132023-04
\.


--
-- Data for Name: raffle_price_rules; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.raffle_price_rules (id, raffle_id, rule_type, price, start_at, end_at, priority, created_at, active) FROM stdin;
\.


--
-- Data for Name: raffle_results; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.raffle_results (id, raffle_id, winner_ticket_id, seed, algorithm_version, drawn_at, created_at) FROM stdin;
\.


--
-- Data for Name: raffles; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.raffles (id, titulo, descricao, preco_numero, total_numeros, status, ativo, data_criacao, start_at, end_at, last_hours_notif_sent, tenant_id) FROM stdin;
1	Grande Sorteio Alemão Conveniência	Concorra a prêmios incríveis! Cada número custa apenas R$5,00.	5.00	500	active	1	2026-03-04 06:33:49-04	\N	\N	\N	1
\.


--
-- Data for Name: resumes; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.resumes (id, tenant_id, user_cpf, user_nome, email, phone, linkedin, portfolio, about, experience, education, skills, file_url, updated_at, created_at) FROM stdin;
\.


--
-- Data for Name: sector_brain_nodes; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.sector_brain_nodes (id, sector_id, type, content, sort_order, active, created_at, tags) FROM stdin;
11	1	persona	[ROLE]\nAninha, secretária virtual do Alemão Conveniências (loja de conveniência, Paraíba).\n\n[TOM]\nAtende em português brasileiro coloquial, simpática e direta. Sem formalidade. Máximo 1-2 emojis por mensagem.\n\n[GOAL]\nResolver a dúvida do cliente usando DADOS_REAIS quando houver. Quando não tiver dado, perguntar ou escalonar — nunca inventar.	1	t	2026-04-26 11:54:25.786148-04	{core}
12	1	rules	[SUCCESS CRITERIA]\n- Resposta cabe em até 4 linhas de WhatsApp.\n- Toda afirmação factual (preço, prazo, status, endereço) tem suporte em DADOS_REAIS ou em CONHECIMENTO.\n- Pergunta do cliente foi respondida (não desvie).\n\n[CONSTRAINTS — GROUNDING]\n- NUNCA invente preço, prazo, status de pedido, endereço, taxa.\n- Se DADOS_REAIS está vazio para o que o cliente perguntou: peça o dado faltante OU chame escalar_humano.\n- NUNCA responda só com "?" ou "Como posso ajudar?" repetidas vezes — se o cliente mandou algo ambíguo, faça UMA pergunta concreta.\n- Não repita o nome do cliente em todas as frases.\n\n[OUTPUT FORMAT]\nTexto puro. *Negrito* (asterisco simples) só em status, valor ou protocolo. Sem listas com bullet asterisco.\n\n[STOPPING]\n- Cliente disse "obrigado/valeu/tchau" → despedida breve + chame encerrar_protocolo.\n- Cliente demonstrou frustração ou urgência → empatia + chame escalar_humano.\n- Loja FECHADA + cliente quer pedido urgente → chame escalar_humano.	5	t	2026-04-26 11:54:25.793192-04	{core}
13	1	knowledge	[CONHECIMENTO — A LOJA]\nAlemão Conveniências. Bebidas, salgadinhos, gelo, cigarro, mercearia rápida.\nAtende por WhatsApp, app cliente e retirada na loja.\nSite: alemaocoonveniencias.com.br	10	t	2026-04-26 11:54:25.80168-04	{core,identidade}
14	1	knowledge	[CONHECIMENTO — HORÁRIO]\nSeg-Qui 08h-23h | Sex-Sáb 08h-02h | Dom 10h-22h.\nPara responder "está aberto?": consulte contexto_temporal.loja_aberta no DADOS_REAIS.	20	t	2026-04-26 11:54:25.805689-04	{horario,pergunta_horario}
15	1	knowledge	[CONHECIMENTO — ENTREGA]\nRetirada na loja: grátis, pronto em 30 min.\nTele-entrega até 3 km: R$ 5,00 | 3-5 km: R$ 8,00 | acima de 5 km: escalar_humano.\nPedido mínimo entrega: R$ 25,00. Prazo: 30-60 min.	30	t	2026-04-26 11:54:25.809571-04	{entrega,pergunta_entrega}
16	1	knowledge	[CONHECIMENTO — PAGAMENTO]\nPix (libera na hora) | Cartão crédito | Débito | Dinheiro (avise troco) | Boleto só PJ acima R$ 200.\nStatus financeiro: pendente=aguardando | aprovado=pago | recusado=oriente refazer.	40	t	2026-04-26 11:54:25.813543-04	{pagamento,pergunta_pagamento}
17	1	knowledge	[CONHECIMENTO — FASES DO PEDIDO]\nTradução para linguagem natural (use ao explicar status):\n- novo → "recebemos, vamos separar"\n- separacao → "separando os itens"\n- embalagem → "embalando"\n- expedicao → "saiu para entrega / pronto pra retirar"\n- entregue → "entregue ✅" (pergunte se recebeu certinho)\n- cancelado → "foi cancelado"\n- auditoria/fiscal → "em conferência interna, libera em minutos"	50	t	2026-04-26 11:54:25.817487-04	{core,pedido,cotacao_lookup}
18	1	knowledge	[CONHECIMENTO — POLÍTICAS]\nTroca produto defeituoso: até 24h, foto pelo WhatsApp.\nItem faltante na entrega: registramos no inbox e estornamos / enviamos depois.\nCancelar: até fase "separação". Após "embalagem" só com gerência.\nBebida alcoólica: maior 18 anos, doc na entrega.	60	t	2026-04-26 11:54:25.821366-04	{politica,troca,reclamacao,frustracao}
19	1	knowledge	[CONHECIMENTO — PROMOÇÕES E CLUBE]\nFlash Promo: ofertas relâmpago do dia (em DADOS_REAIS.promocoes_ativas).\nClube de Benefícios: assinatura mensal com descontos (cliente membro aparece em DADOS_REAIS.plano).\nSorteios: 1 ticket a cada R$ 50 em compras no mês.	70	t	2026-04-26 11:54:25.826052-04	{promocao,clube,sorteio,pergunta_sorteio,pergunta_clube}
20	1	rules	[REGRAS DE OURO]\n1. Pergunta sobre cotação/pedido específico → DADOS_REAIS.consulta_mencionada tem o dado. Use-o direto.\n2. "Meus pedidos" → use DADOS_REAIS.pedidos_recentes.\n3. Pergunta sobre produto → DADOS_REAIS.produtos_buscados (com nome e preço).\n4. Cliente sem cadastro (telefone não bate) → peça CPF ou nome cadastrado, sem dramatizar.\n5. NUNCA promete prazo/preço fora desta base. Em dúvida → escalar_humano.	90	t	2026-04-26 11:54:25.830841-04	{core}
\.


--
-- Data for Name: sectors; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.sectors (id, tenant_id, name, description, icon, color, sla_minutes, sort_order, active, created_at) FROM stdin;
1	1	Secretária	Uma secretária universal (aplicável a praticamente qualquer tipo de negócio: clínica, escritório, loja, indústria, escola, oficina, imobiliária, etc.) atua como centro operacional administrativo e de relacionamento. Ela organiza fluxo de informações, agenda, atendimento e suporte interno.\n\nFunções Gerais de uma Secretária Universal\n1. Atendimento ao Público\nRecepcionar clientes, pacientes, fornecedores e visitantes.\nAtender telefone, WhatsApp, e-mail e redes sociais.\nEsclarecer dúvidas iniciais.\nDirecionar demandas ao setor correto.\nRegistrar recados e retornos pendentes.\n2. Gestão de Agenda\nMarcar, remarcar e cancelar compromissos.\nOrganizar reuniões, consultas, visitas técnicas ou entregas.\nConfirmar horários.\nControlar atrasos e encaixes.\nAvisar equipe sobre mudanças.\n3. Organização Administrativa\nCadastro de clientes e fornecedores.\nAtualização de dados.\nEmissão e arquivamento de documentos.\nOrganização de contratos, fichas e formulários.\nControle de arquivos físicos e digitais.\n4. Financeiro Básico\nCobrança amigável.\nEmissão de boletos, recibos, notas ou comprovantes.\nControle de pagamentos recebidos.\nLançamento de despesas simples.\nConferência de caixa (quando aplicável).\n5. Comunicação Interna\nRepassar ordens da gestão.\nInformar equipe sobre agendas, metas e avisos.\nIntegrar setores (vendas, financeiro, produção, atendimento).\n6. Suporte Comercial\nAtendimento de interessados.\nEnvio de orçamento.\nFollow-up com leads.\nConfirmação de propostas.\nPós-venda inicial.\n7. Controle Operacional\nAcompanhar demandas abertas.\nCobrar execução de tarefas.\nMonitorar prazos.\nAtualizar status para gestores.\n8. Compras e Suprimentos\nControlar materiais de escritório ou insumos.\nSolicitar reposição.\nCotar preços com fornecedores.\nAcompanhar entregas.\n9. Imagem e Experiência do Cliente\nManter padrão de cordialidade.\nResolver pequenos conflitos.\nMelhorar experiência no atendimento.\nOrganizar recepção/ambiente.\n10. Apoio à Gestão\nPreparar relatórios simples.\nOrganizar documentos para contador/jurídico.\nFiltrar prioridades do dono/gestor.\nLembrar compromissos importantes.	Briefcase	#6366f1	60	0	t	2026-04-19 20:37:13.493175-04
2	1	Gerencia	Gerente de loja	Briefcase	#6366f1	60	0	t	2026-04-23 00:54:18.496755-04
3	1	Atendimento	Primeiro contato e suporte ao cliente	HeadphonesIcon	#06b6d4	30	0	t	2026-04-29 09:55:57.812573-04
4	1	Cotação	Elaboração e gestão de cotações	FileText	#8b5cf6	60	0	t	2026-04-29 09:55:59.527277-04
5	1	Separação	Separação de itens para pedidos	PackageSearch	#3b82f6	120	0	t	2026-04-29 09:55:59.533433-04
6	1	Embalagem	Embalagem e preparação para envio	Package	#a855f7	60	0	t	2026-04-29 09:55:59.538974-04
7	1	Auditoria	Verificação e controle de qualidade	ShieldCheck	#f59e0b	90	0	t	2026-04-29 09:55:59.544918-04
8	1	Fiscal	Emissão de NF e documentos fiscais	FileCheck	#10b981	120	0	t	2026-04-29 09:55:59.550618-04
9	1	Expedição	Despacho e logística de entrega	Truck	#f97316	60	0	t	2026-04-29 09:55:59.555709-04
10	1	Financeiro	Gestão financeira e contas a receber	DollarSign	#84cc16	240	0	t	2026-04-29 09:55:59.562123-04
11	1	Suporte	Suporte técnico pós-venda	Wrench	#ec4899	180	0	t	2026-04-29 09:55:59.567405-04
\.


--
-- Data for Name: super_admins; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.super_admins (id, email, password_hash, name, created_at) FROM stdin;
1	super@admin.local	$2a$10$jx0mQxSPPAu/7cuZXWx6UO6Wo9q9jBaP29H1OBU0J4s4F0tnMdIAS	Super Admin	2026-04-17 22:47:24.156067-04
\.


--
-- Data for Name: team_members; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.team_members (id, account_id, sector_id, function, is_primary, notify_escalation, notify_human_api, on_duty, created_at) FROM stdin;
1	1	1	Secretária	f	t	t	f	2026-04-19 20:37:42.065018-04
2	3	3	Supervisora	t	t	t	f	2026-04-29 09:55:59.695059-04
3	4	3	Agente Atendimento	f	t	t	f	2026-04-29 09:55:59.810114-04
4	5	3	Agente Atendimento	f	t	t	f	2026-04-29 09:55:59.917758-04
5	6	4	Coordenador Cot.	t	t	t	f	2026-04-29 09:56:00.030923-04
6	7	4	Analista Cotação	f	t	t	f	2026-04-29 09:56:00.148178-04
7	8	5	Lider Separação	t	t	t	f	2026-04-29 09:56:00.261181-04
8	9	5	Auxiliar Sep.	f	t	t	f	2026-04-29 09:56:00.386025-04
9	10	5	Auxiliar Sep.	f	t	t	f	2026-04-29 09:56:00.493782-04
10	11	6	Lider Embalagem	t	t	t	f	2026-04-29 09:56:00.600396-04
11	12	6	Embalador	f	t	t	f	2026-04-29 09:56:00.720488-04
12	13	6	Embaladora	f	t	t	f	2026-04-29 09:56:00.828448-04
13	14	7	Auditor Chefe	t	t	t	f	2026-04-29 09:56:00.937529-04
14	15	7	Auditora	f	t	t	f	2026-04-29 09:56:01.061058-04
15	16	8	Coordenadora Fiscal	t	t	t	f	2026-04-29 09:56:01.20371-04
16	17	8	Fiscal Tributário	f	t	t	f	2026-04-29 09:56:01.344712-04
17	18	9	Lider Expedição	t	t	t	f	2026-04-29 09:56:01.502999-04
18	19	9	Despachante	f	t	t	f	2026-04-29 09:56:01.711426-04
19	20	9	Motorista Entrega	f	t	t	f	2026-04-29 09:56:01.837657-04
20	21	10	Gerente Financeiro	t	t	t	f	2026-04-29 09:56:01.942269-04
21	22	10	Analista Financeiro	f	t	t	f	2026-04-29 09:56:02.046341-04
22	23	11	Supervisora Suporte	t	t	t	f	2026-04-29 09:56:02.151917-04
23	24	11	Técnico Suporte	f	t	t	f	2026-04-29 09:56:02.260908-04
\.


--
-- Data for Name: tenant_config; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.tenant_config (tenant_id, primary_color, secondary_color, logo_url, favicon_url, contact_email, contact_phone, app_url, asaas_key) FROM stdin;
1	#f59e0b	#10b981	\N	\N	\N	\N	https://alemaocoonveniencias.com.br	\N
\.


--
-- Data for Name: tenants; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.tenants (id, slug, name, domain, active, created_at) FROM stdin;
1	alemao	Alemão Conveniências	alemaoconveniencias.local	t	2026-04-17 11:49:03.981281-04
\.


--
-- Data for Name: tickets; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.tickets (id, raffle_id, numero, usuario_nome, usuario_telefone, usuario_cpf, data_compra, status, reserved_until, order_id, price_paid, tenant_id) FROM stdin;
\.


--
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.users (id, nome, email, cpf, telefone, ip, source, password_hash, "timestamp", whatsapp_optin, tenant_id, portal_session_id) FROM stdin;
7	Bruno Vargas	brunovargasbto@gmail.com	421.508.251-04	(67) 99888-5576	\N	web	$2a$10$dtnrGv4S/pnl1WxLyBJcGO3lMZ9umkvU1IM6Uofg72r3jI6J2999O	2026-04-26 01:33:38.718309-04	t	1	\N
8	Rui Cesar Vargas Casanova	\N	04638245129	67999222377	10.0.0.98	hotspot	\N	2026-04-30 11:55:36.356849-04	t	1	0b9dca75-0b1b-4baa-8c26-de829b1c62f9
11	brunovargasbto@gmail.com	\N	\N	67999985576	10.0.0.98	hotspot	\N	2026-05-04 01:22:15.378318-04	t	1	7d17fc0d-027c-4ac0-8ca1-b44681c4a340
18	monique13fa@gmail.com	\N	\N	67999961071	10.0.0.99	hotspot	\N	2026-05-04 11:49:31.123985-04	t	1	03a2b289-9308-4a7f-88b3-2baa02f57599
21	meubruno@gmail.com	meubruno@gmail.com	\N	67996799991	10.0.0.232	hotspot	\N	2026-05-05 09:59:34.235539-04	t	1	a9c59132-7df3-4eee-98ed-d93cf99f0986
22	murilo@murilo.com	murilo@murilo.com	\N	67996006389	10.0.0.53	hotspot	\N	2026-05-05 12:04:24.578593-04	t	1	87d021c0-c6a3-4834-b31f-8e4621cfe4ed
\.


--
-- Data for Name: whatsapp_logs; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.whatsapp_logs (id, user_id, phone, type, payload, status, response, created_at, updated_at, tenant_id) FROM stdin;
8	7	5567998885576	security_login	{"number":"5567998885576","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *27/04/2026* às *09:23*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	failed	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-27 09:23:09.794015-04	2026-04-27 09:23:36.462398-04	1
7	7	5567998885576	security_login	{"number":"5567998885576","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *26/04/2026* às *04:02*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	failed	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-26 04:02:41.309087-04	2026-04-26 04:03:15.310025-04	1
9	7	5567998885576	security_login	{"number":"5567998885576","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *28/04/2026* às *10:47*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	failed	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-28 10:47:05.551198-04	2026-04-28 10:47:34.767279-04	1
1	\N	5567999222377	security_login	{"number":"5567999222377","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Teste Portal*! Detectamos um acesso à sua conta no Alemão Conveniências em *17/04/2026* às *10:39*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	retrying	Status 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-17 10:39:27.467525-04	2026-04-17 10:40:02.635488-04	1
2	\N	5567999222377	security_login	{"number":"5567999222377","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Teste Portal*! Detectamos um acesso à sua conta no Alemão Conveniências em *17/04/2026* às *10:39*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	retrying	Status 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-17 10:39:55.428131-04	2026-04-17 10:40:33.216714-04	1
11	7	5567998885576	security_login	{"number":"5567998885576","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *28/04/2026* às *10:52*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	failed	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-28 10:52:09.369775-04	2026-04-28 10:52:41.276347-04	1
10	7	5567998885576	security_login	{"number":"5567998885576","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *28/04/2026* às *10:47*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	failed	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-28 10:47:58.413742-04	2026-04-28 10:48:32.320784-04	1
6	7	5567998885576	security_login	{"number":"5567998885576","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *26/04/2026* às *04:02*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	failed	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-26 04:02:30.434704-04	2026-04-26 04:03:09.040899-04	1
13	7	5567998885576	security_login	{"number":"5567998885576","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *28/04/2026* às *11:18*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	failed	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-28 11:18:56.00762-04	2026-04-28 11:19:35.155967-04	1
12	7	5567998885576	security_login	{"number":"5567998885576","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *28/04/2026* às *11:07*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	failed	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-28 11:07:24.57855-04	2026-04-28 11:08:04.884527-04	1
5	\N	5511999999999	password_reset	{"number":"5511999999999","body":"🔑 *Redefinição de senha*\\n\\nOlá, *Teste 9B*! Recebemos uma solicitação para redefinir sua senha.\\n\\nClique no link abaixo para criar uma nova senha (válido por 1 hora):\\nhttp://alemaoconveniencias.local:4001/redefinir-senha?token=84fe21d2d1903d0308bdeaf6ebc6fd15fb577ece69d15664a37641e547d04a5f6a0647f3702e8dcc77adfe026bb9bcd1\\n\\nSe não foi você, ignore esta mensagem."}	retrying	Status 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-17 11:55:05.461278-04	2026-04-17 11:55:42.170819-04	1
14	7	5567998885576	security_login	{"number":"5567998885576","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *04/05/2026* às *09:56*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	failed	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-05-04 09:56:51.502799-04	2026-05-04 09:57:26.951403-04	1
15	7	5567998885576	security_login	{"number":"5567998885576","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Bruno Vargas*! Detectamos um acesso à sua conta no Alemão Conveniências em *05/05/2026* às *10:16*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	failed	HTTP 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-05-05 10:16:41.497582-04	2026-05-05 10:17:09.659725-04	1
3	\N	5511999999999	welcome	{"number":"5511999999999","body":"👋 *Bem-vindo ao Alemão Conveniências!*\\n\\nOlá, *Teste 9B*! Seu cadastro foi realizado com sucesso.\\n\\nAqui você encontra promoções exclusivas e participa dos nossos sorteios. Acesse sua área:\\nhttp://localhost:4001/area-do-usuario"}	retrying	Status 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-17 11:53:33.985637-04	2026-04-17 11:54:05.113207-04	1
4	\N	5511999999999	security_login	{"number":"5511999999999","body":"🔐 *Novo acesso à sua conta*\\n\\nOlá, *Teste 9B*! Detectamos um acesso à sua conta no Alemão Conveniências em *17/04/2026* às *11:53*.\\n\\nSe não foi você, acesse a loja ou entre em contato conosco imediatamente."}	retrying	Status 404: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/messages/send</pre>\n</body>\n</html>\n	2026-04-17 11:53:48.387698-04	2026-04-17 11:54:32.709014-04	1
\.


--
-- Data for Name: wpp_reativacao_log; Type: TABLE DATA; Schema: public; Owner: newwhats
--

COPY public.wpp_reativacao_log (id, tenant_id, cliente_id, chat_id, mensagem, enviada_em) FROM stdin;
\.


--
-- Name: accounts_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.accounts_id_seq', 24, true);


--
-- Name: admins_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.admins_id_seq', 2, true);


--
-- Name: benefit_clubs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.benefit_clubs_id_seq', 6764, true);


--
-- Name: broadcasts_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.broadcasts_id_seq', 1, false);


--
-- Name: cliente_enderecos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.cliente_enderecos_id_seq', 1, false);


--
-- Name: cliente_responsaveis_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.cliente_responsaveis_id_seq', 1, false);


--
-- Name: cliente_telefones_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.cliente_telefones_id_seq', 1, false);


--
-- Name: clientes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.clientes_id_seq', 1, false);


--
-- Name: club_dependents_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.club_dependents_id_seq', 1, false);


--
-- Name: club_faqs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.club_faqs_id_seq', 8, true);


--
-- Name: club_members_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.club_members_id_seq', 1, false);


--
-- Name: club_partners_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.club_partners_id_seq', 1, false);


--
-- Name: club_payments_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.club_payments_id_seq', 1, false);


--
-- Name: club_plans_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.club_plans_id_seq', 4, true);


--
-- Name: cotacao_flash_promos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.cotacao_flash_promos_id_seq', 1, false);


--
-- Name: cotacao_itens_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.cotacao_itens_id_seq', 9, true);


--
-- Name: cotacoes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.cotacoes_id_seq', 4, true);


--
-- Name: direct_messages_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.direct_messages_id_seq', 4, true);


--
-- Name: group_chats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.group_chats_id_seq', 11, true);


--
-- Name: group_messages_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.group_messages_id_seq', 1, false);


--
-- Name: human_api_requests_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.human_api_requests_id_seq', 1, false);


--
-- Name: internal_messages_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.internal_messages_id_seq', 1, false);


--
-- Name: job_applications_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.job_applications_id_seq', 1, false);


--
-- Name: jobs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.jobs_id_seq', 1, false);


--
-- Name: knowledge_learning_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.knowledge_learning_id_seq', 1, false);


--
-- Name: mensagens_internas_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.mensagens_internas_id_seq', 35, true);


--
-- Name: notification_errors_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.notification_errors_id_seq', 10, true);


--
-- Name: notifications_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.notifications_id_seq', 11, true);


--
-- Name: nw_auto_replies_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.nw_auto_replies_id_seq', 66, true);


--
-- Name: nw_event_logs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.nw_event_logs_id_seq', 394, true);


--
-- Name: nw_router_metrics_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.nw_router_metrics_id_seq', 28, true);


--
-- Name: password_reset_tokens_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.password_reset_tokens_id_seq', 1, true);


--
-- Name: pedido_itens_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.pedido_itens_id_seq', 11, true);


--
-- Name: pedido_status_log_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.pedido_status_log_id_seq', 15, true);


--
-- Name: pedidos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.pedidos_id_seq', 5, true);


--
-- Name: pedidos_recorrentes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.pedidos_recorrentes_id_seq', 1, false);


--
-- Name: price_logs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.price_logs_id_seq', 3, true);


--
-- Name: produtos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.produtos_id_seq', 32, true);


--
-- Name: promotions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.promotions_id_seq', 6, true);


--
-- Name: protocol_flags_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.protocol_flags_id_seq', 1, false);


--
-- Name: protocol_ratings_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.protocol_ratings_id_seq', 1, false);


--
-- Name: raffle_claims_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.raffle_claims_id_seq', 1, false);


--
-- Name: raffle_discounts_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.raffle_discounts_id_seq', 11, true);


--
-- Name: raffle_draw_logs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.raffle_draw_logs_id_seq', 1, false);


--
-- Name: raffle_flash_promos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.raffle_flash_promos_id_seq', 1, true);


--
-- Name: raffle_price_rules_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.raffle_price_rules_id_seq', 1, false);


--
-- Name: raffle_results_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.raffle_results_id_seq', 1, false);


--
-- Name: raffles_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.raffles_id_seq', 1, true);


--
-- Name: resumes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.resumes_id_seq', 1, false);


--
-- Name: sector_brain_nodes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.sector_brain_nodes_id_seq', 20, true);


--
-- Name: sectors_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.sectors_id_seq', 11, true);


--
-- Name: super_admins_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.super_admins_id_seq', 1, true);


--
-- Name: team_members_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.team_members_id_seq', 23, true);


--
-- Name: tenants_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.tenants_id_seq', 1, false);


--
-- Name: tickets_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.tickets_id_seq', 3, true);


--
-- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.users_id_seq', 22, true);


--
-- Name: whatsapp_logs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.whatsapp_logs_id_seq', 15, true);


--
-- Name: wpp_reativacao_log_id_seq; Type: SEQUENCE SET; Schema: public; Owner: newwhats
--

SELECT pg_catalog.setval('public.wpp_reativacao_log_id_seq', 1, false);


--
-- Name: accounts accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.accounts
    ADD CONSTRAINT accounts_pkey PRIMARY KEY (id);


--
-- Name: admins admins_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.admins
    ADD CONSTRAINT admins_pkey PRIMARY KEY (id);


--
-- Name: admins admins_username_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.admins
    ADD CONSTRAINT admins_username_key UNIQUE (username);


--
-- Name: benefit_clubs benefit_clubs_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.benefit_clubs
    ADD CONSTRAINT benefit_clubs_pkey PRIMARY KEY (id);


--
-- Name: benefit_clubs benefit_clubs_tenant_id_slug_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.benefit_clubs
    ADD CONSTRAINT benefit_clubs_tenant_id_slug_key UNIQUE (tenant_id, slug);


--
-- Name: broadcast_last_seen broadcast_last_seen_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.broadcast_last_seen
    ADD CONSTRAINT broadcast_last_seen_pkey PRIMARY KEY (account_id, tenant_id);


--
-- Name: broadcasts broadcasts_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.broadcasts
    ADD CONSTRAINT broadcasts_pkey PRIMARY KEY (id);


--
-- Name: cliente_enderecos cliente_enderecos_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cliente_enderecos
    ADD CONSTRAINT cliente_enderecos_pkey PRIMARY KEY (id);


--
-- Name: cliente_responsaveis cliente_responsaveis_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cliente_responsaveis
    ADD CONSTRAINT cliente_responsaveis_pkey PRIMARY KEY (id);


--
-- Name: cliente_telefones cliente_telefones_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cliente_telefones
    ADD CONSTRAINT cliente_telefones_pkey PRIMARY KEY (id);


--
-- Name: clientes clientes_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.clientes
    ADD CONSTRAINT clientes_pkey PRIMARY KEY (id);


--
-- Name: club_dependents club_dependents_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_dependents
    ADD CONSTRAINT club_dependents_pkey PRIMARY KEY (id);


--
-- Name: club_faqs club_faqs_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_faqs
    ADD CONSTRAINT club_faqs_pkey PRIMARY KEY (id);


--
-- Name: club_members club_members_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_members
    ADD CONSTRAINT club_members_pkey PRIMARY KEY (id);


--
-- Name: club_partners club_partners_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_partners
    ADD CONSTRAINT club_partners_pkey PRIMARY KEY (id);


--
-- Name: club_payments club_payments_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_payments
    ADD CONSTRAINT club_payments_pkey PRIMARY KEY (id);


--
-- Name: club_plans club_plans_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_plans
    ADD CONSTRAINT club_plans_pkey PRIMARY KEY (id);


--
-- Name: cotacao_flash_promos cotacao_flash_promos_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacao_flash_promos
    ADD CONSTRAINT cotacao_flash_promos_pkey PRIMARY KEY (id);


--
-- Name: cotacao_funcao_team cotacao_funcao_team_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacao_funcao_team
    ADD CONSTRAINT cotacao_funcao_team_pkey PRIMARY KEY (tenant_id, funcao);


--
-- Name: cotacao_itens cotacao_itens_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacao_itens
    ADD CONSTRAINT cotacao_itens_pkey PRIMARY KEY (id);


--
-- Name: cotacoes cotacoes_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacoes
    ADD CONSTRAINT cotacoes_pkey PRIMARY KEY (id);


--
-- Name: direct_messages direct_messages_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.direct_messages
    ADD CONSTRAINT direct_messages_pkey PRIMARY KEY (id);


--
-- Name: group_chats group_chats_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_chats
    ADD CONSTRAINT group_chats_pkey PRIMARY KEY (id);


--
-- Name: group_chats group_chats_tenant_id_sector_id_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_chats
    ADD CONSTRAINT group_chats_tenant_id_sector_id_key UNIQUE (tenant_id, sector_id);


--
-- Name: group_last_read group_last_read_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_last_read
    ADD CONSTRAINT group_last_read_pkey PRIMARY KEY (account_id, group_chat_id);


--
-- Name: group_messages group_messages_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_messages
    ADD CONSTRAINT group_messages_pkey PRIMARY KEY (id);


--
-- Name: human_api_requests human_api_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.human_api_requests
    ADD CONSTRAINT human_api_requests_pkey PRIMARY KEY (id);


--
-- Name: internal_messages internal_messages_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.internal_messages
    ADD CONSTRAINT internal_messages_pkey PRIMARY KEY (id);


--
-- Name: job_applications job_applications_job_id_applicant_cpf_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.job_applications
    ADD CONSTRAINT job_applications_job_id_applicant_cpf_key UNIQUE (job_id, applicant_cpf);


--
-- Name: job_applications job_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.job_applications
    ADD CONSTRAINT job_applications_pkey PRIMARY KEY (id);


--
-- Name: jobs jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.jobs
    ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);


--
-- Name: knowledge_learning knowledge_learning_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.knowledge_learning
    ADD CONSTRAINT knowledge_learning_pkey PRIMARY KEY (id);


--
-- Name: mensagens_internas mensagens_internas_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.mensagens_internas
    ADD CONSTRAINT mensagens_internas_pkey PRIMARY KEY (id);


--
-- Name: notification_errors notification_errors_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.notification_errors
    ADD CONSTRAINT notification_errors_pkey PRIMARY KEY (id);


--
-- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_pkey PRIMARY KEY (id);


--
-- Name: nw_auto_replies nw_auto_replies_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.nw_auto_replies
    ADD CONSTRAINT nw_auto_replies_pkey PRIMARY KEY (id);


--
-- Name: nw_chat_sectors nw_chat_sectors_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.nw_chat_sectors
    ADD CONSTRAINT nw_chat_sectors_pkey PRIMARY KEY (chat_id, tenant_id);


--
-- Name: nw_event_logs nw_event_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.nw_event_logs
    ADD CONSTRAINT nw_event_logs_pkey PRIMARY KEY (id);


--
-- Name: nw_handoff nw_handoff_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.nw_handoff
    ADD CONSTRAINT nw_handoff_pkey PRIMARY KEY (chat_id, tenant_id);


--
-- Name: nw_router_metrics nw_router_metrics_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.nw_router_metrics
    ADD CONSTRAINT nw_router_metrics_pkey PRIMARY KEY (id);


--
-- Name: orders orders_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.orders
    ADD CONSTRAINT orders_pkey PRIMARY KEY (id);


--
-- Name: password_reset_tokens password_reset_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.password_reset_tokens
    ADD CONSTRAINT password_reset_tokens_pkey PRIMARY KEY (id);


--
-- Name: password_reset_tokens password_reset_tokens_token_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.password_reset_tokens
    ADD CONSTRAINT password_reset_tokens_token_key UNIQUE (token);


--
-- Name: pedido_itens pedido_itens_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedido_itens
    ADD CONSTRAINT pedido_itens_pkey PRIMARY KEY (id);


--
-- Name: pedido_status_log pedido_status_log_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedido_status_log
    ADD CONSTRAINT pedido_status_log_pkey PRIMARY KEY (id);


--
-- Name: pedidos pedidos_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos
    ADD CONSTRAINT pedidos_pkey PRIMARY KEY (id);


--
-- Name: pedidos_recorrentes pedidos_recorrentes_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos_recorrentes
    ADD CONSTRAINT pedidos_recorrentes_pkey PRIMARY KEY (id);


--
-- Name: plugin_configs plugin_configs_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.plugin_configs
    ADD CONSTRAINT plugin_configs_pkey PRIMARY KEY (plugin_id, key);


--
-- Name: plugins plugins_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.plugins
    ADD CONSTRAINT plugins_pkey PRIMARY KEY (id);


--
-- Name: price_logs price_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.price_logs
    ADD CONSTRAINT price_logs_pkey PRIMARY KEY (id);


--
-- Name: produtos produtos_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.produtos
    ADD CONSTRAINT produtos_pkey PRIMARY KEY (id);


--
-- Name: promotions promotions_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.promotions
    ADD CONSTRAINT promotions_pkey PRIMARY KEY (id);


--
-- Name: protocol_flags protocol_flags_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.protocol_flags
    ADD CONSTRAINT protocol_flags_pkey PRIMARY KEY (id);


--
-- Name: protocol_ratings protocol_ratings_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.protocol_ratings
    ADD CONSTRAINT protocol_ratings_pkey PRIMARY KEY (id);


--
-- Name: raffle_claims raffle_claims_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_claims
    ADD CONSTRAINT raffle_claims_pkey PRIMARY KEY (id);


--
-- Name: raffle_discounts raffle_discounts_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_discounts
    ADD CONSTRAINT raffle_discounts_pkey PRIMARY KEY (id);


--
-- Name: raffle_discounts raffle_discounts_raffle_id_min_qty_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_discounts
    ADD CONSTRAINT raffle_discounts_raffle_id_min_qty_key UNIQUE (raffle_id, min_qty);


--
-- Name: raffle_draw_logs raffle_draw_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_draw_logs
    ADD CONSTRAINT raffle_draw_logs_pkey PRIMARY KEY (id);


--
-- Name: raffle_flash_promos raffle_flash_promos_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_flash_promos
    ADD CONSTRAINT raffle_flash_promos_pkey PRIMARY KEY (id);


--
-- Name: raffle_price_rules raffle_price_rules_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_price_rules
    ADD CONSTRAINT raffle_price_rules_pkey PRIMARY KEY (id);


--
-- Name: raffle_results raffle_results_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_results
    ADD CONSTRAINT raffle_results_pkey PRIMARY KEY (id);


--
-- Name: raffle_results raffle_results_raffle_id_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_results
    ADD CONSTRAINT raffle_results_raffle_id_key UNIQUE (raffle_id);


--
-- Name: raffles raffles_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffles
    ADD CONSTRAINT raffles_pkey PRIMARY KEY (id);


--
-- Name: resumes resumes_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.resumes
    ADD CONSTRAINT resumes_pkey PRIMARY KEY (id);


--
-- Name: resumes resumes_tenant_id_user_cpf_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.resumes
    ADD CONSTRAINT resumes_tenant_id_user_cpf_key UNIQUE (tenant_id, user_cpf);


--
-- Name: sector_brain_nodes sector_brain_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.sector_brain_nodes
    ADD CONSTRAINT sector_brain_nodes_pkey PRIMARY KEY (id);


--
-- Name: sectors sectors_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.sectors
    ADD CONSTRAINT sectors_pkey PRIMARY KEY (id);


--
-- Name: super_admins super_admins_email_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.super_admins
    ADD CONSTRAINT super_admins_email_key UNIQUE (email);


--
-- Name: super_admins super_admins_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.super_admins
    ADD CONSTRAINT super_admins_pkey PRIMARY KEY (id);


--
-- Name: team_members team_members_account_id_sector_id_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.team_members
    ADD CONSTRAINT team_members_account_id_sector_id_key UNIQUE (account_id, sector_id);


--
-- Name: team_members team_members_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.team_members
    ADD CONSTRAINT team_members_pkey PRIMARY KEY (id);


--
-- Name: tenant_config tenant_config_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.tenant_config
    ADD CONSTRAINT tenant_config_pkey PRIMARY KEY (tenant_id);


--
-- Name: tenants tenants_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.tenants
    ADD CONSTRAINT tenants_pkey PRIMARY KEY (id);


--
-- Name: tenants tenants_slug_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.tenants
    ADD CONSTRAINT tenants_slug_key UNIQUE (slug);


--
-- Name: tickets tickets_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.tickets
    ADD CONSTRAINT tickets_pkey PRIMARY KEY (id);


--
-- Name: tickets tickets_raffle_id_numero_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.tickets
    ADD CONSTRAINT tickets_raffle_id_numero_key UNIQUE (raffle_id, numero);


--
-- Name: users users_email_key; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_email_key UNIQUE (email);


--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_pkey PRIMARY KEY (id);


--
-- Name: whatsapp_logs whatsapp_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.whatsapp_logs
    ADD CONSTRAINT whatsapp_logs_pkey PRIMARY KEY (id);


--
-- Name: wpp_reativacao_log wpp_reativacao_log_pkey; Type: CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.wpp_reativacao_log
    ADD CONSTRAINT wpp_reativacao_log_pkey PRIMARY KEY (id);


--
-- Name: idx_accounts_email; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE UNIQUE INDEX idx_accounts_email ON public.accounts USING btree (tenant_id, email) WHERE (email IS NOT NULL);


--
-- Name: idx_accounts_role; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_accounts_role ON public.accounts USING btree (tenant_id, role);


--
-- Name: idx_accounts_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_accounts_tenant ON public.accounts USING btree (tenant_id);


--
-- Name: idx_applications_cpf; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_applications_cpf ON public.job_applications USING btree (applicant_cpf);


--
-- Name: idx_applications_job; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_applications_job ON public.job_applications USING btree (job_id);


--
-- Name: idx_broadcasts_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_broadcasts_tenant ON public.broadcasts USING btree (tenant_id, created_at DESC);


--
-- Name: idx_cfp_ativo; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_cfp_ativo ON public.cotacao_flash_promos USING btree (tenant_id, ativo) WHERE (ativo = true);


--
-- Name: idx_cfp_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_cfp_tenant ON public.cotacao_flash_promos USING btree (tenant_id);


--
-- Name: idx_clientes_cpf_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE UNIQUE INDEX idx_clientes_cpf_tenant ON public.clientes USING btree (cpf_cnpj, tenant_id);


--
-- Name: idx_clientes_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_clientes_tenant ON public.clientes USING btree (tenant_id);


--
-- Name: idx_club_faqs_club; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_club_faqs_club ON public.club_faqs USING btree (club_id);


--
-- Name: idx_club_members_cpf; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_club_members_cpf ON public.club_members USING btree (user_cpf);


--
-- Name: idx_club_members_status; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_club_members_status ON public.club_members USING btree (status);


--
-- Name: idx_club_members_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_club_members_tenant ON public.club_members USING btree (tenant_id);


--
-- Name: idx_club_partners_club; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_club_partners_club ON public.club_partners USING btree (club_id);


--
-- Name: idx_club_payments_member; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_club_payments_member ON public.club_payments USING btree (member_id);


--
-- Name: idx_club_payments_status; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_club_payments_status ON public.club_payments USING btree (status);


--
-- Name: idx_cotacao_itens_cotacao; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_cotacao_itens_cotacao ON public.cotacao_itens USING btree (cotacao_id);


--
-- Name: idx_cotacoes_cliente; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_cotacoes_cliente ON public.cotacoes USING btree (cliente_id);


--
-- Name: idx_cotacoes_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_cotacoes_tenant ON public.cotacoes USING btree (tenant_id);


--
-- Name: idx_dm_created; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_dm_created ON public.direct_messages USING btree (created_at DESC);


--
-- Name: idx_dm_from_to; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_dm_from_to ON public.direct_messages USING btree (from_account, to_account);


--
-- Name: idx_dm_read_status; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_dm_read_status ON public.direct_messages USING btree (to_account, read_at);


--
-- Name: idx_dm_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_dm_tenant ON public.direct_messages USING btree (tenant_id);


--
-- Name: idx_enderecos_cliente; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_enderecos_cliente ON public.cliente_enderecos USING btree (cliente_id);


--
-- Name: idx_flash_promos_raffle; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_flash_promos_raffle ON public.raffle_flash_promos USING btree (raffle_id, ends_at);


--
-- Name: idx_gm_group; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_gm_group ON public.group_messages USING btree (group_chat_id, created_at DESC);


--
-- Name: idx_gm_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_gm_tenant ON public.group_messages USING btree (tenant_id);


--
-- Name: idx_group_chats_sector; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_group_chats_sector ON public.group_chats USING btree (sector_id);


--
-- Name: idx_group_chats_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_group_chats_tenant ON public.group_chats USING btree (tenant_id);


--
-- Name: idx_har_chat_id; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_har_chat_id ON public.human_api_requests USING btree (chat_id) WHERE (chat_id IS NOT NULL);


--
-- Name: idx_human_api_account; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_human_api_account ON public.human_api_requests USING btree (account_id);


--
-- Name: idx_human_api_status; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_human_api_status ON public.human_api_requests USING btree (status);


--
-- Name: idx_human_api_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_human_api_tenant ON public.human_api_requests USING btree (tenant_id);


--
-- Name: idx_internal_msgs_sector; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_internal_msgs_sector ON public.internal_messages USING btree (sector_id);


--
-- Name: idx_internal_msgs_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_internal_msgs_tenant ON public.internal_messages USING btree (tenant_id);


--
-- Name: idx_internal_msgs_thread; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_internal_msgs_thread ON public.internal_messages USING btree (thread_id);


--
-- Name: idx_internal_msgs_to; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_internal_msgs_to ON public.internal_messages USING btree (to_account, read_at);


--
-- Name: idx_jobs_published; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_jobs_published ON public.jobs USING btree (published_at DESC);


--
-- Name: idx_jobs_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_jobs_tenant ON public.jobs USING btree (tenant_id, active);


--
-- Name: idx_knowledge_promoted; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_knowledge_promoted ON public.knowledge_learning USING btree (promoted);


--
-- Name: idx_knowledge_sector; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_knowledge_sector ON public.knowledge_learning USING btree (sector_id);


--
-- Name: idx_knowledge_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_knowledge_tenant ON public.knowledge_learning USING btree (tenant_id);


--
-- Name: idx_metrics_chat_created; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_metrics_chat_created ON public.nw_router_metrics USING btree (chat_id, created_at DESC);


--
-- Name: idx_metrics_handler_created; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_metrics_handler_created ON public.nw_router_metrics USING btree (handler, created_at DESC);


--
-- Name: idx_msg_int_chat_id; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_msg_int_chat_id ON public.mensagens_internas USING btree (chat_id) WHERE (chat_id IS NOT NULL);


--
-- Name: idx_msg_int_nao_lida; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_msg_int_nao_lida ON public.mensagens_internas USING btree (tenant_id, lida) WHERE (lida = false);


--
-- Name: idx_msg_int_pedido; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_msg_int_pedido ON public.mensagens_internas USING btree (pedido_id);


--
-- Name: idx_msg_int_setor; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_msg_int_setor ON public.mensagens_internas USING btree (tenant_id, setor);


--
-- Name: idx_msg_int_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_msg_int_tenant ON public.mensagens_internas USING btree (tenant_id);


--
-- Name: idx_notif_errors_created; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_notif_errors_created ON public.notification_errors USING btree (created_at DESC);


--
-- Name: idx_notif_errors_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_notif_errors_tenant ON public.notification_errors USING btree (tenant_id);


--
-- Name: idx_nw_auto_chat; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_nw_auto_chat ON public.nw_auto_replies USING btree (chat_id);


--
-- Name: idx_nw_auto_created; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_nw_auto_created ON public.nw_auto_replies USING btree (created_at DESC);


--
-- Name: idx_nw_auto_instance; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_nw_auto_instance ON public.nw_auto_replies USING btree (instance_id);


--
-- Name: idx_nw_auto_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_nw_auto_tenant ON public.nw_auto_replies USING btree (tenant_id, created_at DESC);


--
-- Name: idx_nw_chat_sectors_sector; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_nw_chat_sectors_sector ON public.nw_chat_sectors USING btree (sector_id);


--
-- Name: idx_nw_event_logs_created; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_nw_event_logs_created ON public.nw_event_logs USING btree (created_at DESC);


--
-- Name: idx_nw_event_logs_event; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_nw_event_logs_event ON public.nw_event_logs USING btree (event);


--
-- Name: idx_nw_event_logs_instance; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_nw_event_logs_instance ON public.nw_event_logs USING btree (instance_id);


--
-- Name: idx_nw_event_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_nw_event_tenant ON public.nw_event_logs USING btree (tenant_id, created_at DESC);


--
-- Name: idx_orders_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_orders_tenant ON public.orders USING btree (tenant_id);


--
-- Name: idx_pedido_itens_pedido; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_pedido_itens_pedido ON public.pedido_itens USING btree (pedido_id);


--
-- Name: idx_pedido_status_log; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_pedido_status_log ON public.pedido_status_log USING btree (pedido_id, created_at);


--
-- Name: idx_pedidos_auditor; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_pedidos_auditor ON public.pedidos USING btree (auditor_id) WHERE (auditor_id IS NOT NULL);


--
-- Name: idx_pedidos_cliente; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_pedidos_cliente ON public.pedidos USING btree (cliente_id);


--
-- Name: idx_pedidos_embalador; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_pedidos_embalador ON public.pedidos USING btree (embalador_id) WHERE (embalador_id IS NOT NULL);


--
-- Name: idx_pedidos_expedidor; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_pedidos_expedidor ON public.pedidos USING btree (expedidor_id) WHERE (expedidor_id IS NOT NULL);


--
-- Name: idx_pedidos_financeiro; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_pedidos_financeiro ON public.pedidos USING btree (tenant_id, financeiro_status) WHERE (financeiro_status IS NOT NULL);


--
-- Name: idx_pedidos_fiscal; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_pedidos_fiscal ON public.pedidos USING btree (fiscal_id) WHERE (fiscal_id IS NOT NULL);


--
-- Name: idx_pedidos_separador; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_pedidos_separador ON public.pedidos USING btree (separador_id) WHERE (separador_id IS NOT NULL);


--
-- Name: idx_pedidos_status; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_pedidos_status ON public.pedidos USING btree (tenant_id, status);


--
-- Name: idx_pedidos_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_pedidos_tenant ON public.pedidos USING btree (tenant_id);


--
-- Name: idx_produtos_sku_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE UNIQUE INDEX idx_produtos_sku_tenant ON public.produtos USING btree (sku, tenant_id) WHERE (sku IS NOT NULL);


--
-- Name: idx_produtos_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_produtos_tenant ON public.produtos USING btree (tenant_id);


--
-- Name: idx_promotions_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_promotions_tenant ON public.promotions USING btree (tenant_id);


--
-- Name: idx_protocol_flags_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_protocol_flags_tenant ON public.protocol_flags USING btree (tenant_id);


--
-- Name: idx_protocol_flags_thread; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_protocol_flags_thread ON public.protocol_flags USING btree (thread_id);


--
-- Name: idx_protocol_flags_type; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_protocol_flags_type ON public.protocol_flags USING btree (type);


--
-- Name: idx_protocol_ratings_chat; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_protocol_ratings_chat ON public.protocol_ratings USING btree (chat_id);


--
-- Name: idx_protocol_ratings_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_protocol_ratings_tenant ON public.protocol_ratings USING btree (tenant_id);


--
-- Name: idx_prt_token; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_prt_token ON public.password_reset_tokens USING btree (token);


--
-- Name: idx_prt_user; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_prt_user ON public.password_reset_tokens USING btree (user_id);


--
-- Name: idx_raffle_discounts_raffle; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_raffle_discounts_raffle ON public.raffle_discounts USING btree (raffle_id) WHERE (active = true);


--
-- Name: idx_raffles_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_raffles_tenant ON public.raffles USING btree (tenant_id);


--
-- Name: idx_rec_prox; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_rec_prox ON public.pedidos_recorrentes USING btree (proximo_em) WHERE ((ativo = true) AND (pausado = false));


--
-- Name: idx_rec_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_rec_tenant ON public.pedidos_recorrentes USING btree (tenant_id);


--
-- Name: idx_rec_user; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_rec_user ON public.pedidos_recorrentes USING btree (user_id);


--
-- Name: idx_responsaveis_cliente; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_responsaveis_cliente ON public.cliente_responsaveis USING btree (cliente_id);


--
-- Name: idx_resumes_cpf; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_resumes_cpf ON public.resumes USING btree (tenant_id, user_cpf);


--
-- Name: idx_sector_brain_sector; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_sector_brain_sector ON public.sector_brain_nodes USING btree (sector_id, active);


--
-- Name: idx_sectors_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_sectors_tenant ON public.sectors USING btree (tenant_id, active);


--
-- Name: idx_team_members_account; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_team_members_account ON public.team_members USING btree (account_id);


--
-- Name: idx_team_members_duty; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_team_members_duty ON public.team_members USING btree (sector_id, on_duty);


--
-- Name: idx_team_members_sector; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_team_members_sector ON public.team_members USING btree (sector_id);


--
-- Name: idx_telefones_cliente; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_telefones_cliente ON public.cliente_telefones USING btree (cliente_id);


--
-- Name: idx_tickets_cpf; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_tickets_cpf ON public.tickets USING btree (usuario_cpf);


--
-- Name: idx_tickets_raffle; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_tickets_raffle ON public.tickets USING btree (raffle_id);


--
-- Name: idx_tickets_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_tickets_tenant ON public.tickets USING btree (tenant_id);


--
-- Name: idx_users_email; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE UNIQUE INDEX idx_users_email ON public.users USING btree (email) WHERE (email IS NOT NULL);


--
-- Name: idx_users_email_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE UNIQUE INDEX idx_users_email_tenant ON public.users USING btree (email, tenant_id) WHERE (email IS NOT NULL);


--
-- Name: idx_users_portal_session; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_users_portal_session ON public.users USING btree (portal_session_id) WHERE (portal_session_id IS NOT NULL);


--
-- Name: idx_users_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_users_tenant ON public.users USING btree (tenant_id);


--
-- Name: idx_wa_logs_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_wa_logs_tenant ON public.whatsapp_logs USING btree (tenant_id);


--
-- Name: idx_wpp_reat_chat; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_wpp_reat_chat ON public.wpp_reativacao_log USING btree (chat_id);


--
-- Name: idx_wpp_reat_cliente; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_wpp_reat_cliente ON public.wpp_reativacao_log USING btree (cliente_id);


--
-- Name: idx_wpp_reat_tenant; Type: INDEX; Schema: public; Owner: newwhats
--

CREATE INDEX idx_wpp_reat_tenant ON public.wpp_reativacao_log USING btree (tenant_id);


--
-- Name: accounts accounts_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.accounts
    ADD CONSTRAINT accounts_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: admins admins_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.admins
    ADD CONSTRAINT admins_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: admins admins_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.admins
    ADD CONSTRAINT admins_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: benefit_clubs benefit_clubs_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.benefit_clubs
    ADD CONSTRAINT benefit_clubs_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: broadcast_last_seen broadcast_last_seen_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.broadcast_last_seen
    ADD CONSTRAINT broadcast_last_seen_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.accounts(id) ON DELETE CASCADE;


--
-- Name: broadcast_last_seen broadcast_last_seen_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.broadcast_last_seen
    ADD CONSTRAINT broadcast_last_seen_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id) ON DELETE CASCADE;


--
-- Name: broadcasts broadcasts_from_account_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.broadcasts
    ADD CONSTRAINT broadcasts_from_account_fkey FOREIGN KEY (from_account) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: broadcasts broadcasts_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.broadcasts
    ADD CONSTRAINT broadcasts_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: cliente_enderecos cliente_enderecos_cliente_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cliente_enderecos
    ADD CONSTRAINT cliente_enderecos_cliente_id_fkey FOREIGN KEY (cliente_id) REFERENCES public.clientes(id) ON DELETE CASCADE;


--
-- Name: cliente_responsaveis cliente_responsaveis_cliente_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cliente_responsaveis
    ADD CONSTRAINT cliente_responsaveis_cliente_id_fkey FOREIGN KEY (cliente_id) REFERENCES public.clientes(id) ON DELETE CASCADE;


--
-- Name: cliente_responsaveis cliente_responsaveis_telefone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cliente_responsaveis
    ADD CONSTRAINT cliente_responsaveis_telefone_id_fkey FOREIGN KEY (telefone_id) REFERENCES public.cliente_telefones(id) ON DELETE SET NULL;


--
-- Name: cliente_telefones cliente_telefones_cliente_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cliente_telefones
    ADD CONSTRAINT cliente_telefones_cliente_id_fkey FOREIGN KEY (cliente_id) REFERENCES public.clientes(id) ON DELETE CASCADE;


--
-- Name: clientes clientes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.clientes
    ADD CONSTRAINT clientes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE SET NULL;


--
-- Name: club_dependents club_dependents_member_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_dependents
    ADD CONSTRAINT club_dependents_member_id_fkey FOREIGN KEY (member_id) REFERENCES public.club_members(id) ON DELETE CASCADE;


--
-- Name: club_faqs club_faqs_club_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_faqs
    ADD CONSTRAINT club_faqs_club_id_fkey FOREIGN KEY (club_id) REFERENCES public.benefit_clubs(id) ON DELETE CASCADE;


--
-- Name: club_faqs club_faqs_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_faqs
    ADD CONSTRAINT club_faqs_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: club_members club_members_club_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_members
    ADD CONSTRAINT club_members_club_id_fkey FOREIGN KEY (club_id) REFERENCES public.benefit_clubs(id);


--
-- Name: club_members club_members_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_members
    ADD CONSTRAINT club_members_plan_id_fkey FOREIGN KEY (plan_id) REFERENCES public.club_plans(id);


--
-- Name: club_members club_members_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_members
    ADD CONSTRAINT club_members_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: club_partners club_partners_club_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_partners
    ADD CONSTRAINT club_partners_club_id_fkey FOREIGN KEY (club_id) REFERENCES public.benefit_clubs(id);


--
-- Name: club_partners club_partners_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_partners
    ADD CONSTRAINT club_partners_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: club_payments club_payments_member_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_payments
    ADD CONSTRAINT club_payments_member_id_fkey FOREIGN KEY (member_id) REFERENCES public.club_members(id);


--
-- Name: club_payments club_payments_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_payments
    ADD CONSTRAINT club_payments_plan_id_fkey FOREIGN KEY (plan_id) REFERENCES public.club_plans(id);


--
-- Name: club_plans club_plans_club_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.club_plans
    ADD CONSTRAINT club_plans_club_id_fkey FOREIGN KEY (club_id) REFERENCES public.benefit_clubs(id);


--
-- Name: cotacao_flash_promos cotacao_flash_promos_produto_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacao_flash_promos
    ADD CONSTRAINT cotacao_flash_promos_produto_id_fkey FOREIGN KEY (produto_id) REFERENCES public.produtos(id) ON DELETE SET NULL;


--
-- Name: cotacao_funcao_team cotacao_funcao_team_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacao_funcao_team
    ADD CONSTRAINT cotacao_funcao_team_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id) ON DELETE CASCADE;


--
-- Name: cotacao_itens cotacao_itens_cotacao_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacao_itens
    ADD CONSTRAINT cotacao_itens_cotacao_id_fkey FOREIGN KEY (cotacao_id) REFERENCES public.cotacoes(id) ON DELETE CASCADE;


--
-- Name: cotacao_itens cotacao_itens_produto_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacao_itens
    ADD CONSTRAINT cotacao_itens_produto_id_fkey FOREIGN KEY (produto_id) REFERENCES public.produtos(id) ON DELETE SET NULL;


--
-- Name: cotacoes cotacoes_cliente_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacoes
    ADD CONSTRAINT cotacoes_cliente_id_fkey FOREIGN KEY (cliente_id) REFERENCES public.clientes(id) ON DELETE SET NULL;


--
-- Name: cotacoes cotacoes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.cotacoes
    ADD CONSTRAINT cotacoes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE SET NULL;


--
-- Name: direct_messages direct_messages_from_account_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.direct_messages
    ADD CONSTRAINT direct_messages_from_account_fkey FOREIGN KEY (from_account) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: direct_messages direct_messages_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.direct_messages
    ADD CONSTRAINT direct_messages_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: direct_messages direct_messages_to_account_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.direct_messages
    ADD CONSTRAINT direct_messages_to_account_fkey FOREIGN KEY (to_account) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: group_chats group_chats_sector_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_chats
    ADD CONSTRAINT group_chats_sector_id_fkey FOREIGN KEY (sector_id) REFERENCES public.sectors(id) ON DELETE CASCADE;


--
-- Name: group_chats group_chats_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_chats
    ADD CONSTRAINT group_chats_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: group_last_read group_last_read_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_last_read
    ADD CONSTRAINT group_last_read_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.accounts(id) ON DELETE CASCADE;


--
-- Name: group_last_read group_last_read_group_chat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_last_read
    ADD CONSTRAINT group_last_read_group_chat_id_fkey FOREIGN KEY (group_chat_id) REFERENCES public.group_chats(id) ON DELETE CASCADE;


--
-- Name: group_messages group_messages_from_account_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_messages
    ADD CONSTRAINT group_messages_from_account_fkey FOREIGN KEY (from_account) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: group_messages group_messages_group_chat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_messages
    ADD CONSTRAINT group_messages_group_chat_id_fkey FOREIGN KEY (group_chat_id) REFERENCES public.group_chats(id) ON DELETE CASCADE;


--
-- Name: group_messages group_messages_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.group_messages
    ADD CONSTRAINT group_messages_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: human_api_requests human_api_requests_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.human_api_requests
    ADD CONSTRAINT human_api_requests_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: human_api_requests human_api_requests_sector_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.human_api_requests
    ADD CONSTRAINT human_api_requests_sector_id_fkey FOREIGN KEY (sector_id) REFERENCES public.sectors(id) ON DELETE SET NULL;


--
-- Name: human_api_requests human_api_requests_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.human_api_requests
    ADD CONSTRAINT human_api_requests_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: internal_messages internal_messages_from_account_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.internal_messages
    ADD CONSTRAINT internal_messages_from_account_fkey FOREIGN KEY (from_account) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: internal_messages internal_messages_sector_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.internal_messages
    ADD CONSTRAINT internal_messages_sector_id_fkey FOREIGN KEY (sector_id) REFERENCES public.sectors(id) ON DELETE SET NULL;


--
-- Name: internal_messages internal_messages_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.internal_messages
    ADD CONSTRAINT internal_messages_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: internal_messages internal_messages_to_account_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.internal_messages
    ADD CONSTRAINT internal_messages_to_account_fkey FOREIGN KEY (to_account) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: job_applications job_applications_job_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.job_applications
    ADD CONSTRAINT job_applications_job_id_fkey FOREIGN KEY (job_id) REFERENCES public.jobs(id) ON DELETE CASCADE;


--
-- Name: job_applications job_applications_resume_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.job_applications
    ADD CONSTRAINT job_applications_resume_id_fkey FOREIGN KEY (resume_id) REFERENCES public.resumes(id);


--
-- Name: job_applications job_applications_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.job_applications
    ADD CONSTRAINT job_applications_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: jobs jobs_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.jobs
    ADD CONSTRAINT jobs_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: knowledge_learning knowledge_learning_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.knowledge_learning
    ADD CONSTRAINT knowledge_learning_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: knowledge_learning knowledge_learning_sector_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.knowledge_learning
    ADD CONSTRAINT knowledge_learning_sector_id_fkey FOREIGN KEY (sector_id) REFERENCES public.sectors(id) ON DELETE SET NULL;


--
-- Name: knowledge_learning knowledge_learning_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.knowledge_learning
    ADD CONSTRAINT knowledge_learning_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: mensagens_internas mensagens_internas_pedido_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.mensagens_internas
    ADD CONSTRAINT mensagens_internas_pedido_id_fkey FOREIGN KEY (pedido_id) REFERENCES public.pedidos(id) ON DELETE CASCADE;


--
-- Name: nw_chat_sectors nw_chat_sectors_sector_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.nw_chat_sectors
    ADD CONSTRAINT nw_chat_sectors_sector_id_fkey FOREIGN KEY (sector_id) REFERENCES public.sectors(id) ON DELETE SET NULL;


--
-- Name: orders orders_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.orders
    ADD CONSTRAINT orders_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: password_reset_tokens password_reset_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.password_reset_tokens
    ADD CONSTRAINT password_reset_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: pedido_itens pedido_itens_pedido_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedido_itens
    ADD CONSTRAINT pedido_itens_pedido_id_fkey FOREIGN KEY (pedido_id) REFERENCES public.pedidos(id) ON DELETE CASCADE;


--
-- Name: pedido_itens pedido_itens_produto_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedido_itens
    ADD CONSTRAINT pedido_itens_produto_id_fkey FOREIGN KEY (produto_id) REFERENCES public.produtos(id) ON DELETE SET NULL;


--
-- Name: pedido_status_log pedido_status_log_pedido_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedido_status_log
    ADD CONSTRAINT pedido_status_log_pedido_id_fkey FOREIGN KEY (pedido_id) REFERENCES public.pedidos(id) ON DELETE CASCADE;


--
-- Name: pedidos pedidos_auditor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos
    ADD CONSTRAINT pedidos_auditor_id_fkey FOREIGN KEY (auditor_id) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: pedidos pedidos_cliente_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos
    ADD CONSTRAINT pedidos_cliente_id_fkey FOREIGN KEY (cliente_id) REFERENCES public.clientes(id) ON DELETE SET NULL;


--
-- Name: pedidos pedidos_cotacao_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos
    ADD CONSTRAINT pedidos_cotacao_id_fkey FOREIGN KEY (cotacao_id) REFERENCES public.cotacoes(id) ON DELETE SET NULL;


--
-- Name: pedidos pedidos_cupom_emitido_por_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos
    ADD CONSTRAINT pedidos_cupom_emitido_por_fkey FOREIGN KEY (cupom_emitido_por) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: pedidos pedidos_embalador_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos
    ADD CONSTRAINT pedidos_embalador_id_fkey FOREIGN KEY (embalador_id) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: pedidos pedidos_endereco_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos
    ADD CONSTRAINT pedidos_endereco_id_fkey FOREIGN KEY (endereco_id) REFERENCES public.cliente_enderecos(id) ON DELETE SET NULL;


--
-- Name: pedidos pedidos_expedidor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos
    ADD CONSTRAINT pedidos_expedidor_id_fkey FOREIGN KEY (expedidor_id) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: pedidos pedidos_fiscal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos
    ADD CONSTRAINT pedidos_fiscal_id_fkey FOREIGN KEY (fiscal_id) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: pedidos_recorrentes pedidos_recorrentes_cliente_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos_recorrentes
    ADD CONSTRAINT pedidos_recorrentes_cliente_id_fkey FOREIGN KEY (cliente_id) REFERENCES public.clientes(id) ON DELETE SET NULL;


--
-- Name: pedidos_recorrentes pedidos_recorrentes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos_recorrentes
    ADD CONSTRAINT pedidos_recorrentes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: pedidos pedidos_separador_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos
    ADD CONSTRAINT pedidos_separador_id_fkey FOREIGN KEY (separador_id) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: pedidos pedidos_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.pedidos
    ADD CONSTRAINT pedidos_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE SET NULL;


--
-- Name: price_logs price_logs_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.price_logs
    ADD CONSTRAINT price_logs_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.orders(id) ON DELETE SET NULL;


--
-- Name: price_logs price_logs_raffle_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.price_logs
    ADD CONSTRAINT price_logs_raffle_id_fkey FOREIGN KEY (raffle_id) REFERENCES public.raffles(id) ON DELETE CASCADE;


--
-- Name: price_logs price_logs_rule_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.price_logs
    ADD CONSTRAINT price_logs_rule_id_fkey FOREIGN KEY (rule_id) REFERENCES public.raffle_price_rules(id) ON DELETE SET NULL;


--
-- Name: promotions promotions_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.promotions
    ADD CONSTRAINT promotions_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: protocol_flags protocol_flags_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.protocol_flags
    ADD CONSTRAINT protocol_flags_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: protocol_flags protocol_flags_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.protocol_flags
    ADD CONSTRAINT protocol_flags_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: protocol_ratings protocol_ratings_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.protocol_ratings
    ADD CONSTRAINT protocol_ratings_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.accounts(id) ON DELETE SET NULL;


--
-- Name: protocol_ratings protocol_ratings_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.protocol_ratings
    ADD CONSTRAINT protocol_ratings_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: raffle_claims raffle_claims_raffle_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_claims
    ADD CONSTRAINT raffle_claims_raffle_id_fkey FOREIGN KEY (raffle_id) REFERENCES public.raffles(id) ON DELETE CASCADE;


--
-- Name: raffle_claims raffle_claims_ticket_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_claims
    ADD CONSTRAINT raffle_claims_ticket_id_fkey FOREIGN KEY (ticket_id) REFERENCES public.tickets(id);


--
-- Name: raffle_discounts raffle_discounts_raffle_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_discounts
    ADD CONSTRAINT raffle_discounts_raffle_id_fkey FOREIGN KEY (raffle_id) REFERENCES public.raffles(id) ON DELETE CASCADE;


--
-- Name: raffle_draw_logs raffle_draw_logs_raffle_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_draw_logs
    ADD CONSTRAINT raffle_draw_logs_raffle_id_fkey FOREIGN KEY (raffle_id) REFERENCES public.raffles(id) ON DELETE CASCADE;


--
-- Name: raffle_flash_promos raffle_flash_promos_raffle_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_flash_promos
    ADD CONSTRAINT raffle_flash_promos_raffle_id_fkey FOREIGN KEY (raffle_id) REFERENCES public.raffles(id) ON DELETE CASCADE;


--
-- Name: raffle_price_rules raffle_price_rules_raffle_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_price_rules
    ADD CONSTRAINT raffle_price_rules_raffle_id_fkey FOREIGN KEY (raffle_id) REFERENCES public.raffles(id) ON DELETE CASCADE;


--
-- Name: raffle_results raffle_results_raffle_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_results
    ADD CONSTRAINT raffle_results_raffle_id_fkey FOREIGN KEY (raffle_id) REFERENCES public.raffles(id) ON DELETE CASCADE;


--
-- Name: raffle_results raffle_results_winner_ticket_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffle_results
    ADD CONSTRAINT raffle_results_winner_ticket_id_fkey FOREIGN KEY (winner_ticket_id) REFERENCES public.tickets(id);


--
-- Name: raffles raffles_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.raffles
    ADD CONSTRAINT raffles_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: resumes resumes_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.resumes
    ADD CONSTRAINT resumes_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: sector_brain_nodes sector_brain_nodes_sector_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.sector_brain_nodes
    ADD CONSTRAINT sector_brain_nodes_sector_id_fkey FOREIGN KEY (sector_id) REFERENCES public.sectors(id) ON DELETE CASCADE;


--
-- Name: sectors sectors_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.sectors
    ADD CONSTRAINT sectors_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: team_members team_members_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.team_members
    ADD CONSTRAINT team_members_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.accounts(id) ON DELETE CASCADE;


--
-- Name: team_members team_members_sector_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.team_members
    ADD CONSTRAINT team_members_sector_id_fkey FOREIGN KEY (sector_id) REFERENCES public.sectors(id) ON DELETE CASCADE;


--
-- Name: tenant_config tenant_config_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.tenant_config
    ADD CONSTRAINT tenant_config_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id) ON DELETE CASCADE;


--
-- Name: tickets tickets_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.tickets
    ADD CONSTRAINT tickets_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.orders(id) ON DELETE SET NULL;


--
-- Name: tickets tickets_raffle_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.tickets
    ADD CONSTRAINT tickets_raffle_id_fkey FOREIGN KEY (raffle_id) REFERENCES public.raffles(id) ON DELETE CASCADE;


--
-- Name: tickets tickets_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.tickets
    ADD CONSTRAINT tickets_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: users users_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: whatsapp_logs whatsapp_logs_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.whatsapp_logs
    ADD CONSTRAINT whatsapp_logs_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);


--
-- Name: whatsapp_logs whatsapp_logs_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.whatsapp_logs
    ADD CONSTRAINT whatsapp_logs_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE SET NULL;


--
-- Name: wpp_reativacao_log wpp_reativacao_log_cliente_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: newwhats
--

ALTER TABLE ONLY public.wpp_reativacao_log
    ADD CONSTRAINT wpp_reativacao_log_cliente_id_fkey FOREIGN KEY (cliente_id) REFERENCES public.clientes(id) ON DELETE SET NULL;


--
-- PostgreSQL database dump complete
--

\unrestrict Hb2HcJmDeNvO1dffNkKGoSH9xaGi0o15et9OhFfpFNDbLg3kODphATphu3Q5gRj

