feat: part number format validation on creation #80

Closed
opened 2026-02-13 19:03:33 +00:00 by forbes · 0 comments
Owner

Ref: docs/ROADMAP.md § Near-Term Priorities / Tier 0 Completion

The API currently accepts any part number string without validating it against the schema format. A part number created with schema kindred-rd should be validated to match the expected pattern (e.g. F01-0001).

Tasks:

  • On item creation, validate the generated/provided part number against the schema definition
  • Reject part numbers that don't match the expected segment pattern
  • Return a clear error message identifying which segment failed validation
  • Skip validation when no schema is specified (freeform mode)

Files:

  • internal/api/handlers.go — add validation call in item creation handler
  • internal/partnum/ or internal/schema/ — implement validation function
  • Add corresponding tests
**Ref:** `docs/ROADMAP.md` § Near-Term Priorities / Tier 0 Completion The API currently accepts any part number string without validating it against the schema format. A part number created with schema `kindred-rd` should be validated to match the expected pattern (e.g. `F01-0001`). **Tasks:** - [ ] On item creation, validate the generated/provided part number against the schema definition - [ ] Reject part numbers that don't match the expected segment pattern - [ ] Return a clear error message identifying which segment failed validation - [ ] Skip validation when no schema is specified (freeform mode) **Files:** - `internal/api/handlers.go` — add validation call in item creation handler - `internal/partnum/` or `internal/schema/` — implement validation function - Add corresponding tests
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/silo#80