Merge front 8.1: products and prices in the Site tab
All checks were successful
Build and deploy / Publish images (push) Successful in 1m6s
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 6m6s
Build and deploy / Secret scan and release gate (push) Successful in 5s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

# Conflicts:
#	app/schema.sql
This commit is contained in:
Cauê Faleiros
2026-11-09 14:10:56 -03:00
20 changed files with 550 additions and 35 deletions

View File

@@ -598,3 +598,22 @@ DO $$ BEGIN
INSERT INTO dtf_local.migrations VALUES('png-regenerate-v1');
END IF;
END $$;
-- Front 8: what the Site sells and at what price, edited in the Kanban's Site tab.
CREATE TABLE IF NOT EXISTS dtf_local.products (
id text PRIMARY KEY CHECK (id IN ('file','avulsa','uvfile','uv','tratamento')),
enabled boolean NOT NULL DEFAULT true,
updated_by text NOT NULL DEFAULT 'sistema',
updated_at timestamptz NOT NULL DEFAULT now()
);
INSERT INTO dtf_local.products(id) VALUES ('file'),('avulsa'),('uvfile'),('uv'),('tratamento')
ON CONFLICT (id) DO NOTHING;
CREATE TABLE IF NOT EXISTS dtf_local.product_prices (
id bigserial PRIMARY KEY,
product text NOT NULL REFERENCES dtf_local.products(id),
unit_cents integer NOT NULL CHECK (unit_cents >= 0 AND unit_cents <= 10000000),
starts_at timestamptz NOT NULL,
created_by text NOT NULL,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS product_prices_current ON dtf_local.product_prices(product, starts_at DESC);