feat(ticket): update email integration to use new priority constants for ticket classification feat(procurement): add procurement overview page with dynamic data loading and display test(subscriptions): add tests for billing calendar to ensure correct invoice dates feat(reminder): implement automated task lists with user-defined rules for reminders feat(migrations): create tables for managing delefiber product prices and mobile recorder provisioning history test(mobile_recorder): add tests for provisioning mobile recorders to ensure correct asset creation and updates
17 lines
797 B
SQL
17 lines
797 B
SQL
-- Local standard selling prices for products offered from a shared/delefiber.
|
|
CREATE TABLE IF NOT EXISTS internet_connections_delefiber_product_prices (
|
|
id SERIAL PRIMARY KEY,
|
|
connection_id INTEGER NOT NULL REFERENCES internet_connections_connections(id) ON DELETE CASCADE,
|
|
product_id INTEGER NOT NULL REFERENCES products(id) ON DELETE RESTRICT,
|
|
monthly_price NUMERIC(12,2) NOT NULL CHECK (monthly_price >= 0),
|
|
notes TEXT,
|
|
is_active BOOLEAN NOT NULL DEFAULT TRUE,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
UNIQUE (connection_id, product_id)
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_delefiber_product_prices_connection
|
|
ON internet_connections_delefiber_product_prices(connection_id)
|
|
WHERE is_active = TRUE;
|