Skip to content

docs(schema): EPIC-03 work items schema, API contract, and ADR-012#96

Merged
steilerDev merged 1 commit into
betafrom
arch/3-work-items-schema-api-design
Feb 16, 2026
Merged

docs(schema): EPIC-03 work items schema, API contract, and ADR-012#96
steilerDev merged 1 commit into
betafrom
arch/3-work-items-schema-api-design

Conversation

@steilerDev
Copy link
Copy Markdown
Owner

Summary

Designs the complete database schema, API contract, shared type specifications, and pagination conventions for EPIC-03 (Work Items Core CRUD & Properties). This is the architecture-only deliverable that all 8 implementation stories (#87-#94) build against.

Artifacts Produced

Source tree:

  • server/src/db/migrations/0002_create_work_items.sql -- 6 new tables with indexes and constraints

GitHub Wiki (already pushed):

  • Schema page -- Full documentation for all EPIC-03 tables: work_items, tags, work_item_tags, work_item_notes, work_item_subtasks, work_item_dependencies
  • API Contract page -- 19 endpoint specifications covering:
    • Work Items CRUD (5 endpoints)
    • Tags CRUD (4 endpoints)
    • Notes CRUD (4 endpoints)
    • Subtasks CRUD + reorder (5 endpoints)
    • Dependencies CRUD (3 endpoints -- note: the note had a typo; there are actually 3)
  • Architecture page -- Pagination, filtering, and sorting conventions
  • ADR-012 -- Pagination, Filtering, and Sorting Conventions (offset-based)
  • ADR Index -- Updated with ADR-012

Key Design Decisions

  1. No priority column: Requirements specify Tags for custom organization. Users can create priority tags ("High Priority", "Critical") rather than being forced into a fixed enum.
  2. 4 status values: not_started, in_progress, completed, blocked. "Cancelled" omitted (delete achieves this). "On hold" mapped to "blocked" (better fit for construction).
  3. Composite PKs for junction/dependency tables: No surrogate IDs on work_item_tags or work_item_dependencies.
  4. Notes NOT embedded in detail response: Fetched separately to allow future pagination.
  5. Offset-based pagination (ADR-012): Simple, sufficient for <1000 items.
  6. created_by on work_items: Tracks who created each item. Uses SET NULL on delete to preserve work items when users are removed.
  7. Dependencies use predecessor_id/successor_id as composite PK: Delete endpoint uses /:id/dependencies/:predecessorId.
  8. New error codes: CIRCULAR_DEPENDENCY and DUPLICATE_DEPENDENCY added to the ErrorCode union.

Stories Supported

All 8 EPIC-03 stories can now be implemented against these contracts:

Test plan

  • npm run lint passes
  • npm run format:check passes
  • npm run typecheck passes
  • npm run build succeeds
  • npm test -- 614 tests pass
  • Migration SQL syntax verified against existing migration patterns
  • Wiki pages are internally consistent (Schema matches API Contract matches migration SQL)

🤖 Generated with Claude Code

Add migration 0002_create_work_items.sql with 6 tables:
- work_items: core entity with status, dates, scheduling constraints
- tags: user-defined labels for organizing work items
- work_item_tags: many-to-many junction table
- work_item_notes: free-form notes attributed to users
- work_item_subtasks: ordered checklist items
- work_item_dependencies: predecessor/successor relationships with 4 dependency types

GitHub Wiki updated with:
- Schema page: full EPIC-03 table documentation with rationale
- API Contract: 19 endpoint specifications for work items, tags, notes, subtasks, dependencies
- Architecture: pagination, filtering, and sorting conventions
- ADR-012: Pagination, Filtering, and Sorting Conventions

Fixes #87

Co-Authored-By: Claude product-architect (Opus 4.6) <noreply@anthropic.com>
@steilerDev steilerDev merged commit dacb33a into beta Feb 16, 2026
4 checks passed
@steilerDev steilerDev deleted the arch/3-work-items-schema-api-design branch February 16, 2026 20:51
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.7.0-beta.21 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.8.0-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants