feat: prepare ARR for controlled public deployment
This commit is contained in:
28
database/007_report_channel_facts_view.sql
Normal file
28
database/007_report_channel_facts_view.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
-- Privacy-minimized immutable-version facts for monthly BI and channel details
|
||||
-- PostgreSQL 15+
|
||||
-- Target database: booking_test (connect to that database before running).
|
||||
-- Additive migration; do not edit applied migrations 001-006 in place.
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE VIEW finance.v_report_channel_facts AS
|
||||
SELECT
|
||||
records.daily_version_id,
|
||||
records.id AS daily_record_id,
|
||||
records.arrival,
|
||||
records.departure,
|
||||
records.nights,
|
||||
records.no_of_rooms,
|
||||
records.company_name,
|
||||
records.rate_code,
|
||||
records.room_category_label,
|
||||
records.real_price,
|
||||
records.total_price,
|
||||
records.channel_key
|
||||
FROM finance.daily_records AS records
|
||||
WHERE records.outcome = 'retained';
|
||||
|
||||
COMMENT ON VIEW finance.v_report_channel_facts IS
|
||||
'Privacy-minimized retained facts queried through report_daily_versions; supports immutable report snapshots without guest name, confirmation number, displayed room number, comments, traces, products, or source coordinates.';
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user