- Add /admin/display-settings page with Kiosk and Mobile sections - Company category checkbox filter + excluded companies searchable multi-select - New DB tables: company_categories, company_types (migration 064) - Sync COMPANY_CATEGORIES via CompanyCategories entity (id/name/isActive) - Sync COMPANY_TYPES via Companies.companyType picklist - Add to EntityType, ENTITY_DEPENDENCIES, sync-helpers, entity-mapper, entity-sync - New API routes: /api/admin/display-settings (GET/POST), /api/data/company-categories, /api/data/companies-list - Update all 4 routes (kiosk/stats, kiosk/activity, mobile/tickets, mobile/dashboard) to filter by kiosk_settings company_category_ids + excluded_company_ids - Add Display Settings nav link (SlidersHorizontal icon) to Admin menu - Seed kiosk_settings: kiosk_company_category_ids=1, mobile_company_category_ids=1
31 lines
1.5 KiB
SQL
31 lines
1.5 KiB
SQL
-- Company Categories picklist table (synced from Autotask Companies.companyCategoryID field)
|
|
CREATE TABLE IF NOT EXISTS company_categories (
|
|
value INTEGER PRIMARY KEY,
|
|
label VARCHAR(200) NOT NULL,
|
|
is_active BOOLEAN DEFAULT true,
|
|
sort_order INTEGER DEFAULT 0,
|
|
synced_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
-- Company Types picklist table (synced from Autotask Companies.companyType field)
|
|
CREATE TABLE IF NOT EXISTS company_types (
|
|
value INTEGER PRIMARY KEY,
|
|
label VARCHAR(200) NOT NULL,
|
|
is_active BOOLEAN DEFAULT true,
|
|
sort_order INTEGER DEFAULT 0,
|
|
synced_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_company_categories_active ON company_categories(is_active);
|
|
CREATE INDEX IF NOT EXISTS idx_company_types_active ON company_types(is_active);
|
|
|
|
-- Seed new display settings keys into kiosk_settings
|
|
INSERT INTO kiosk_settings (setting_key, setting_value, description) VALUES
|
|
('kiosk_company_category_ids', '1', 'Comma-separated company category IDs to include in kiosk (default: 1=Recurring Revenue Customer)'),
|
|
('mobile_company_category_ids', '1', 'Comma-separated company category IDs to include in mobile (default: 1=Recurring Revenue Customer)'),
|
|
('mobile_excluded_company_ids', '', 'Comma-separated company IDs to exclude from mobile dashboard')
|
|
ON CONFLICT (setting_key) DO NOTHING;
|