feat(suppliers): add 'contractor' to supplier_type enum#176
Merged
Conversation
The IT-centric supplier_type set had no home for physical works contractors (rock/concrete, blasting, tank cleaning, coating, marine), which were landing in 'other'. Adds 'contractor' everywhere the enum is defined: the 0.7.1 release migration (appended to v0.7.1.sql — one migration per release), SupplierTypes, openapi.yaml, the CLI --type help (also syncs the stale hint), and the web picker. No data migration; existing rows stay valid. Regression test creates a supplier of every type and reclassifies other -> contractor. Closes #175.
unidoc-alip
approved these changes
Jul 14, 2026
unidoc-alip
left a comment
Collaborator
There was a problem hiding this comment.
Clean, narrowly-scoped addition of contractor to the supplier_type enum, applied consistently across the DB constraint, Go validation list, OpenAPI schema, CLI help, and Vue picker — all driven from a single source of truth (db.SupplierTypes server-side, supplierTypes client-side), so no stray duplicate lists were missed. Regression test covers creation of every type plus the other → contractor reclassification path. Security review found no new attack surface (validation continues to route through the existing validateEnum allowlist; no new injection, XSS, or auth paths).
No must-fix or should-fix issues identified.
Findings
No findings — code review and security review both came back clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #175.
Adds
contractorto thesupplier_typeenum — the IT-centric set (cloud/saas/consulting/hosting/infrastructure/software/other) had no home for physical works contractors, so they were landing inother.Everywhere the enum is defined:
v0.7.1.sql(one migration per release — not a new file), wideningsuppliers_supplier_type_check.db/suppliers.goSupplierTypes,api/openapi.yamlenum,cmd/isms/supplier.go--typehelp (also syncs the stale hint that was missing infrastructure/software),web/src/views/Suppliers.vuepicker.No data migration; existing rows stay valid. Regression test (
tests/test_supplier_types.py) creates a supplier of every type and reclassifiesother→contractor.go build+build-web+ gofmt green.