Card Binder Schema Changes #495
Labels
No labels
blocked
duplicate
needs
approval
needs
criteria
needs
estimate
needs
tests
question
step
doing
step
review
step
testing
step
todo
step
uat
type
admin
type
alert
type
bug
type
change
type
defect
type
dependencies
type
epic
type
idea
type
incident
type
investigation
type
spike
type
story
wontfix
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
#496 Card Binder Service
External/card-drop
#499 Inventory Service AvailableQuantity function
External/card-drop
Reference
External/card-drop#495
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Epic: #281
Story Points: 5
SO THAT I can save card binder info persistently
Acceptance Criteria
GIVEN I am a developer
WHEN the project is migrated
THEN the database schema will include the data required for the new Card Binder feature
Subtasks
BinderSlotentity and migrationNotes
Story point estimate: 5
BinderSlotentity + EF migrationid,UserIdFK,PageNumber,SlotIndex,CardNumber); follows existing patterns in the codebaseTotal: 5
Criteria are specific enough to size — entity fields and subtasks are well defined, and epic #281 provides broader Card Binder context. Moving to
needs/testsfor QA script authoring.QA test scripts (against acceptance criteria and subtasks)
Preconditions for all scripts unless noted:
develop(or target branch) builds and existing migrations apply cleanly before this change (baseline).TC-01 — Migration applies cleanly
Covers: GIVEN a developer WHEN the project is migrated THEN schema includes Card Binder data
BinderSlotstate), run the project migration command (e.g.yarn db:migrate/dotnet ef database update— per repo convention).Expect: migration succeeds with no errors;
BinderSlottable is created.Expect: idempotent / no-op; no duplicate-table or constraint errors.
TC-02 —
BinderSlottable structureCovers: entity fields from Notes (
id,UserId,PageNumber,SlotIndex,CardNumber)\d/ SSMS /information_schema).Expect:
idUserIdPageNumberSlotIndexCardNumberPageNumberto 1–3 (per issue: "don't constrain in db").SlotIndexto 1–9 (1-based is app convention, not enforced at DB layer unless documented otherwise).TC-03 — Foreign key behaviour
Covers:
UserIdFK integrityBinderSlotrow with a validUserId.Expect: insert succeeds.
UserId.Expect: FK violation / rejected.
Expect: behaviour matches project convention (CASCADE delete slots, RESTRICT, or soft-delete) — document which was chosen.
TC-04 —
BinderSlotentity mappingCovers: Add
BinderSlotentity subtaskBinderSlotentity class; confirm property names and types match the migration columns.DbContext/ TypeORM entity list).id.Expect: all fields persist and read back correctly (
PageNumber,SlotIndex,CardNumber,UserId).TC-05 — Slot indexing convention (app layer)
Covers:
SlotIndex1-based (1..9)SlotIndexis 1-based for downstream binder UI/commands (#496+).Expect: no off-by-one assumptions in tests; convention is documented.
TC-06 — Page number flexibility
Covers:
PageNumberint, up to 3 for now, not DB-constrainedPageNumber= 1, 2, 3.Expect: all succeed.
PageNumber= 4 (or higher).Expect: succeeds at DB level (no check constraint); app validation may come later in command issues.
TC-07 — Multiple slots per user/page
Covers: schema supports binder layout persistence
UserId, insert 9 slots onPageNumber= 1 with distinctSlotIndex(1–9) and distinctCardNumbervalues.Expect: all 9 rows persist.
PageNumber= 2) with at least one slot.Expect: rows coexist; no unintended unique constraint on
(UserId, PageNumber)unless explicitly required (default: multiple slots per page allowed).TC-08 — Unit / integration tests
Covers: Add tests subtask
yarn test(or project test runner) includes newBinderSlot/ migration tests.Expect:
UserIdrejected.TC-09 — Documentation
Covers: Add documentation subtask
docs/page, or entity XML/JSDoc — per repo convention).Expect: documents
BinderSlotcolumns, FK to user, 1-basedSlotIndex, and thatPageNumberis not DB-capped (app limits to 3 pages for now).TC-10 — Downstream readiness smoke (schema only)
Covers: "data required for the new Card Binder feature"
PageNumber,SlotIndex.Expect: data is queryable in the shape future binder commands will need; no missing columns for persisting card numbers per slot.
Criteria and field spec are specific enough to script without going back to
needs/criteria. Moving toneeds/approval.