Files
PowderCoatingLogix/MIGRATION_VERIFICATION_CHECKLIST.md
T
2026-04-23 21:38:24 -04:00

6.0 KiB

Lookup Table Migration Verification Checklist

Automated Verification

Build Verification

  • Status: PASSED
  • Details: Solution builds with 0 errors, 44 pre-existing warnings
  • Verified: All code compiles successfully after enum-to-lookup conversion

Application Startup

  • Status: PASSED
  • Details: Application starts without errors
  • Verified: Web application initializes and runs successfully

Migration File

  • Status: PASSED
  • File: 20260213183913_ConvertEnumsToLookupTables.cs
  • Details:
    • Created 3 new lookup tables
    • Seeded 28 lookup records per company (16+5+7)
    • Preserved all existing job/quote data via temp columns
    • Added foreign key relationships with Restrict delete behavior
    • Created unique composite indexes (CompanyId + StatusCode/PriorityCode)

Manual Verification Steps

Database Verification

Run the SQL verification script:

sqlcmd -S .\SQLEXPRESS -d PowderCoatingDb -i scripts\VerifyLookupMigration.sql

Expected Results:

  • ✓ 3 lookup tables exist
  • ✓ Each company has 16 job statuses, 5 priorities, 7 quote statuses
  • ✓ All foreign key relationships exist
  • ✓ No orphaned records (all Jobs/Quotes reference valid lookup IDs)
  • ✓ No duplicate status codes per company
  • ✓ Each company has exactly one "Approved" quote status
  • ✓ System-defined statuses exist (PENDING, COMPLETED, CANCELLED)

UI Verification

  1. Jobs Management

    • Navigate to Jobs > Create New Job
    • Verify status dropdown shows all 16 statuses
    • Verify priority dropdown shows all 5 priorities
    • Create a test job - verify it saves successfully
    • Edit the job - verify status/priority can be changed
    • Navigate to Jobs > Index
    • Verify status badges display with correct colors
    • Verify priority badges display with correct colors
    • Verify sorting by status/priority works
    • Verify filtering by status works
  2. Quotes Management

    • Navigate to Quotes > Create New Quote
    • Create a test quote - verify it saves successfully
    • Navigate to Quotes > Index
    • Verify status filter dropdown shows all 7 statuses
    • Verify status badges display with correct colors
    • Try converting an approved quote to job - verify it works
  3. Company Settings - Data Lookups

    • Navigate to Company Settings > Data Lookups tab
    • Verify Job Statuses sub-tab loads successfully
    • Verify all 16 default statuses are displayed
    • Verify usage counts are accurate
    • Click "Add Job Status" - verify prompt appears
    • Try creating a custom status (e.g., "CUSTOM_STATUS")
    • Verify new status appears in table
    • Try editing a custom status - verify it updates
    • Try deleting an unused custom status - verify it's removed
    • Try deleting a system-defined status - verify it's blocked
    • Try deleting a status in use - verify it's blocked
    • Switch to Job Priorities sub-tab - verify it loads
    • Switch to Quote Statuses sub-tab - verify it loads
  4. Dashboard

    • Navigate to Dashboard
    • Verify job status statistics display correctly
    • Verify status badges use correct colors from lookup table
  5. Reports

    • Navigate to Reports
    • Verify reports display correctly with new lookup-based statuses

Data Integrity Checks

Jobs Table

  • All existing jobs maintained their status/priority
  • No jobs have NULL JobStatusId
  • No jobs have NULL JobPriorityId
  • Status/priority display names match lookup table values

Quotes Table

  • All existing quotes maintained their status
  • No quotes have NULL QuoteStatusId
  • Status display names match lookup table values
  • Quote-to-job conversion still requires "Approved" status

JobStatusHistory Table

  • All status transitions preserved
  • FromStatusId and ToStatusId reference valid lookup IDs

Performance Verification

Query Performance

  • Jobs Index page loads quickly with 100+ jobs
  • Quotes Index page loads quickly with 100+ quotes
  • Status dropdown loads instantly
  • No N+1 query issues (use .Include() for eager loading)

Scalability

  • Test with 1,000+ jobs - verify performance is acceptable
  • Test with 10,000+ jobs - verify no timeouts
  • Verify indexes are being used (check execution plans)

Rollback Plan

If any critical issues are found:

  1. Database Rollback:

    cd src/PowderCoating.Web
    dotnet ef database update AddProfilePictureFilePath --project ../PowderCoating.Infrastructure --context ApplicationDbContext
    

    This rolls back to the previous migration before the lookup conversion.

  2. Code Rollback:

    git revert <commit-hash>
    

    Revert the commits that implemented the lookup conversion.

Known Limitations

  1. Drag-and-Drop Reordering: Not yet implemented (future enhancement)
  2. Modal Forms: Currently using simple prompts (can be enhanced with Bootstrap modals)
  3. Remaining Enums: EquipmentStatus, MaintenanceStatus, JobPhotoType not converted (by design)

Success Criteria

Migration is considered successful if:

  • Zero compilation errors
  • Application starts without errors
  • All existing data preserved (no data loss)
  • Jobs/Quotes can be created/edited/deleted
  • Status/Priority dropdowns work correctly
  • Color-coded badges display properly
  • Company Settings lookup management works
  • Multi-tenancy isolation maintained (companies see only their lookups)
  • Business rules enforced (e.g., only one "Approved" quote status)

Sign-Off

  • Developer Verification Complete: _______________ Date: _______________
  • QA Testing Complete: _______________ Date: _______________
  • User Acceptance Complete: _______________ Date: _______________

Migration Date: February 13, 2026 Migration File: 20260213183913_ConvertEnumsToLookupTables.cs Enums Converted: JobStatus (16), JobPriority (5), QuoteStatus (7) Total Lookup Records Created: 28 per company