Add edit capability to reports app for Directors Forecast

Adds a third capability 'edit' (Edit Directors Forecast) for the reports
app to gate pickup/dry/wet override saves and snapshot creation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-20 10:24:55 +00:00
parent 8f1e985cbc
commit dc269f13ee

View file

@ -129,8 +129,7 @@ export async function initDb() {
('rates', 'Rate Monitor', 'Competitor rate monitoring and direct booking engine rates', '/rates', 'Tag', '#7b4f00', 'Finance', '10.10.10.115', 3080),
('maintenance', 'Maintenance', 'Maintenance log book — faults, recurring tasks, assets and contractors', '/maintenance', 'Wrench', '#b45309', 'Operations', '10.10.10.121', 3080),
('reports', 'Reports', 'Custom reports for NewBook, ResOS, SambaPOS and internal data', '/reports', 'BarChart2', '#1d4ed8', 'Management', '10.10.10.122', 3080),
('kds', 'Kitchen Display', 'SambaPOS ticket feed and course flow display', '/kds', 'Monitor', '#0d9488', 'Kitchen', '10.10.10.125', 3080),
('directors-report', 'Directors Forecast', 'Monthly revenue forecast report — OTB, pickup, budget and year-on-year comparison', '/directors-report', 'FileBarChart', '#7c3aed', 'Management', '10.10.10.123', 3080)
('kds', 'Kitchen Display', 'SambaPOS ticket feed and course flow display', '/kds', 'Monitor', '#0d9488', 'Kitchen', '10.10.10.125', 3080)
ON CONFLICT (slug) DO UPDATE SET
name = EXCLUDED.name,
icon = EXCLUDED.icon,
@ -287,8 +286,9 @@ export async function initDb() {
SELECT a.id, c.slug, c.name, c.description, c.sort_order
FROM apps a
CROSS JOIN (VALUES
('view', 'View & Run Reports', 'Browse and run all custom reports', 1),
('export', 'Export to CSV', 'Download report results as a CSV file', 2)
('view', 'View & Run Reports', 'Browse and run all custom reports', 1),
('export', 'Export to CSV', 'Download report results as a CSV file', 2),
('edit', 'Edit Directors Forecast', 'Edit pickup/dry/wet overrides and save forecast snapshots', 3)
) AS c(slug, name, description, sort_order)
WHERE a.slug = 'reports'
ON CONFLICT (app_id, slug) DO UPDATE SET