Add step type support for work order profiles and steps, update database schema, APIs, and UI components to handle configurable step types.

This commit is contained in:
2026-05-17 19:21:11 -04:00
parent 309f19520b
commit 6307babbfa
8 changed files with 481 additions and 89 deletions
+15
View File
@@ -0,0 +1,15 @@
-- Add step_type and type_config to profile steps and WO steps
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id = OBJECT_ID('wo_profile_steps') AND name = 'step_type')
ALTER TABLE wo_profile_steps ADD step_type NVARCHAR(30) NOT NULL DEFAULT 'work_step';
-- 'work_step' | 'photo' | 'inspection' | 'note'
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id = OBJECT_ID('wo_profile_steps') AND name = 'type_config')
ALTER TABLE wo_profile_steps ADD type_config NVARCHAR(MAX) NULL;
-- JSON; shape depends on step_type (see CLAUDE.md)
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id = OBJECT_ID('wo_steps') AND name = 'step_type')
ALTER TABLE wo_steps ADD step_type NVARCHAR(30) NOT NULL DEFAULT 'work_step';
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id = OBJECT_ID('wo_steps') AND name = 'type_config')
ALTER TABLE wo_steps ADD type_config NVARCHAR(MAX) NULL;