CREATE TABLE public.payments
(
    id               uuid      NOT NULL DEFAULT uuid_generate_v4(),
    partner_id       varchar   NOT NULL,
    order_id         varchar   NOT NULL,
    reference_id     varchar   NOT NULL,
    channel          varchar   NOT NULL,
    payment_type     varchar   NOT NULL,
    amount           numeric   NOT NULL,
    state            varchar   NOT NULL,
    request_metadata json      NOT NULL,
    created_at       timestamp NOT NULL,
    updated_at       timestamp NOT NULL,
    finished_at      timestamp NOT NULL,
    CONSTRAINT payment_pkey PRIMARY KEY (id)
);