- Introduced Technician Dashboard V1 (tech_v1_overview.html) with KPI cards and new cases overview. - Implemented Technician Dashboard V2 (tech_v2_workboard.html) featuring a workboard layout for daily tasks and opportunities. - Developed Technician Dashboard V3 (tech_v3_table_focus.html) with a power table for detailed case management. - Created a dashboard selector page (technician_dashboard_selector.html) for easy navigation between dashboard versions. - Added user dashboard preferences migration (130_user_dashboard_preferences.sql) to store default dashboard paths. - Enhanced sag_sager table with assigned group ID (131_sag_assignment_group.sql) for better case management. - Updated sag_subscriptions table to include cancellation rules and billing dates (132_subscription_cancellation.sql, 134_subscription_billing_dates.sql). - Implemented subscription staging for CRM integration (136_simply_subscription_staging.sql). - Added a script to move time tracking section in detail view (move_time_section.py). - Created a test script for subscription processing (test_subscription_processing.py).
18 lines
1.1 KiB
SQL
18 lines
1.1 KiB
SQL
-- Migration 132: Add cancellation rules to subscriptions
|
|
-- Adds fields for notice period, cancellation date, and termination order tracking
|
|
|
|
ALTER TABLE sag_subscriptions
|
|
ADD COLUMN IF NOT EXISTS notice_period_days INTEGER DEFAULT 30 CHECK (notice_period_days >= 0),
|
|
ADD COLUMN IF NOT EXISTS cancelled_at TIMESTAMP,
|
|
ADD COLUMN IF NOT EXISTS cancelled_by_user_id INTEGER REFERENCES users(user_id),
|
|
ADD COLUMN IF NOT EXISTS cancellation_sag_id INTEGER REFERENCES sag_sager(id),
|
|
ADD COLUMN IF NOT EXISTS cancellation_reason TEXT;
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_sag_subscriptions_cancelled_at ON sag_subscriptions(cancelled_at);
|
|
|
|
COMMENT ON COLUMN sag_subscriptions.notice_period_days IS 'Number of days notice required for cancellation (default 30)';
|
|
COMMENT ON COLUMN sag_subscriptions.cancelled_at IS 'When the cancellation was requested';
|
|
COMMENT ON COLUMN sag_subscriptions.cancelled_by_user_id IS 'User who requested cancellation';
|
|
COMMENT ON COLUMN sag_subscriptions.cancellation_sag_id IS 'Case created for the cancellation process';
|
|
COMMENT ON COLUMN sag_subscriptions.cancellation_reason IS 'Reason for cancellation';
|