Files
wyndham-ARR/channel_analytics/README.md
2026-07-29 16:38:05 +08:00

24 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Channel analytics database provider
`channel_analytics` implements BI Schema 1.2 and paginated channel detail directly from the current ARR daily facts. It does not read a monthly workbook, `dashboard.json`, `report_versions`, or a frozen report manifest.
Read model:
- available months and source pins: `finance.current_daily_versions`;
- channels/order/counts: `finance.daily_channel_metrics` for those current versions;
- aggregates and detail: `finance.v_active_daily_facts` (`current + retained` only);
- projection identity: deterministic SHA-256 over the selected business date, current daily version ID and source artifact SHA-256.
Dashboard rules:
- sold rooms = `sum(NO_OF_ROOMS)`;
- total price = `sum(TOTAL PRICE)` without multiplying again;
- room nights = `sum(NIGHTS * NO_OF_ROOMS)`;
- room types sort by sold rooms descending, then name;
- channels follow first current business date/order, then channel name;
- the channel × room-type matrix and company totals use the same current facts.
The detail response contains only arrival, departure, nights, room count, company, rate code, room type, real price, and total price. It never returns guest name, confirmation number, displayed room number, comments, traces, products, source coordinates, credentials, or object keys.
`DASHBOARD_DATABASE_URL` may use a dedicated read-only role; otherwise it falls back to `ARR_DATABASE_URL`. Transactions are `REPEATABLE READ READ ONLY`, and this validation build rejects any database other than `booking_test`.