- New app_config key-value table for system settings, with in-memory cache (mirrors ModuleService pattern) - GET/PATCH /v1/config endpoints for reading and updating config (settings.view/settings.edit permissions) - Runtime log level: PATCH /v1/config/log_level applies immediately, persists across restarts - Startup loads log level from DB in onReady hook (env var is default, DB overrides) - Add structured request.log.info() to POS routes: transaction create/complete/void, drawer open/close, discount create/update/delete Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
12 lines
400 B
SQL
12 lines
400 B
SQL
CREATE TABLE IF NOT EXISTS "app_config" (
|
|
"key" varchar(100) PRIMARY KEY NOT NULL,
|
|
"value" text,
|
|
"description" text,
|
|
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
);
|
|
|
|
-- Seed default log level
|
|
INSERT INTO "app_config" ("key", "value", "description")
|
|
VALUES ('log_level', 'info', 'Application log level (fatal, error, warn, info, debug, trace)')
|
|
ON CONFLICT ("key") DO NOTHING;
|