From dc269f13ee74f2b73a98cb59ac2c4ae508ee47a5 Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Mon, 20 Jul 2026 10:24:55 +0000 Subject: [PATCH] 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 --- src/db.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/db.js b/src/db.js index ec4445c..180ea13 100644 --- a/src/db.js +++ b/src/db.js @@ -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