Refactor code list management - reconcile code_list_items vs code_list_members tables

Resolved 💬 3 comments Opened Dec 1, 2025 by stewartbourke487 Closed Jan 31, 2026

Summary

The code list management system appears to be over-engineered with two separate table structures that need reconciliation:

  1. code_list_items - Simple structure used by CodeListService.cs
  • list_hdr_id → links to code_list_header.id
  • item_code, item_description
  • Currently used by the API
  1. code_list_members - More complex versioned structure
  • version_id → links to code_list_versions.id
  • code, description, start_date, end_date, change_type
  • Supports versioning via code_list_versions table
  • Not currently used by the API

Problem

When seeding new code lists, it's unclear which table to populate. The versioned structure (code_list_members) was designed but the service layer uses the simpler code_list_items table.

Tasks

  • [ ] Understand the original design intent for both tables
  • [ ] Decide which approach to use going forward:
  • Option A: Use simple code_list_items and remove versioning tables
  • Option B: Update CodeListService to use versioned code_list_members table
  • [ ] Migrate existing data to chosen structure
  • [ ] Remove unused tables/code
  • [ ] Update documentation

Related Files

  • server/Integrin.Server/Services/CodeList/CodeListService.cs - Uses code_list_items
  • docs/mvp/300_Code_List_Management_Design.md - Design documentation
  • SQL scripts in agent-os/specs/2025-11-29-continue-cbam-entity-with-parties/sql/

---
🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗