Skip to content

feat(suppliers): add 'contractor' to supplier_type enum#176

Merged
unidoc-ahall merged 1 commit into
masterfrom
feat/supplier-type-contractor
Jul 14, 2026
Merged

feat(suppliers): add 'contractor' to supplier_type enum#176
unidoc-ahall merged 1 commit into
masterfrom
feat/supplier-type-contractor

Conversation

@unidoc-ahall

Copy link
Copy Markdown
Contributor

Closes #175.

Adds contractor to the supplier_type enum — the IT-centric set (cloud/saas/consulting/hosting/infrastructure/software/other) had no home for physical works contractors, so they were landing in other.

Everywhere the enum is defined:

  • Migration: appended to the existing 0.7.1 release file v0.7.1.sql (one migration per release — not a new file), widening suppliers_supplier_type_check.
  • db/suppliers.go SupplierTypes, api/openapi.yaml enum, cmd/isms/supplier.go --type help (also syncs the stale hint that was missing infrastructure/software), web/src/views/Suppliers.vue picker.

No data migration; existing rows stay valid. Regression test (tests/test_supplier_types.py) creates a supplier of every type and reclassifies othercontractor. go build + build-web + gofmt green.

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-ahall unidoc-ahall added this to the 0.7.1 milestone Jul 14, 2026
@unidoc-ahall unidoc-ahall requested a review from unidoc-alip July 14, 2026 13:08

@unidoc-alip unidoc-alip left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@unidoc-ahall unidoc-ahall merged commit 32bb8c5 into master Jul 14, 2026
1 of 2 checks passed
@unidoc-ahall unidoc-ahall deleted the feat/supplier-type-contractor branch July 14, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supplier register: add 'contractor' to supplier_type enum

2 participants