CREATE TABLE sales_tax_periods (
    id                      SERIAL PRIMARY KEY,
    period_start            DATE NOT NULL,
    period_end              DATE NOT NULL,
    total_sales             NUMERIC(10,2),
    nontaxable_sales        NUMERIC(10,2),
    taxable_sales           NUMERIC(10,2),
    tax_collected           NUMERIC(10,2),
    adjustment_amount       NUMERIC(10,2) DEFAULT 0,
    adjustment_reason       TEXT,
    adjustment_account_id   VARCHAR(50),
    adjustment_account_name VARCHAR(200),
    net_paid                NUMERIC(10,2),
    bank_account_id         VARCHAR(50),
    bank_account_name       VARCHAR(200),
    sales_tax_payable_id    VARCHAR(50),
    sales_tax_payable_name  VARCHAR(200),
    qbo_journal_entry_id    VARCHAR(50),
    booked_at               TIMESTAMP,
    created_at              TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at              TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE(period_start, period_end)
);
