From 420bb5aedc4b8b0226ae2c74d9de0a585ad59500 Mon Sep 17 00:00:00 2001 From: "Aaron K. Clark" Date: Tue, 19 May 2026 11:02:38 -0500 Subject: [PATCH] docs(openapi): pin BillingType + InventoryItem schema field constraints Extends the field-length / numeric-bound pinning sweep started in #270 (Customer), #272 (Company), and #276 (Worker) to the two remaining single-table entity components. BillingType: - btName: minLength: 1, maxLength: 255 (per zod min(1).max(255)) - btHourlyRate: minimum: 0 (per zod nonnegative()) InventoryItem: - invitDescription: minLength: 1, maxLength: 1000 (per zod min(1).max(1000)) \`finite\` is implicit in OpenAPI's number type per the spec (no NaN / Infinity in JSON), so no extra annotation is needed there. SDK generators now carry the bounds into client-side types for these two entities, matching the rest of the spec. No behavior change. 760 tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/config/openapi.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/config/openapi.js b/app/config/openapi.js index db165bb..30bbd43 100644 --- a/app/config/openapi.js +++ b/app/config/openapi.js @@ -79,8 +79,13 @@ const billingTypeSchema = { type: 'object', properties: { btId: { type: 'integer', readOnly: true }, - btName: { type: 'string' }, - btHourlyRate: { type: 'number' }, + // Mirror billingtype.schema.js: min(1).max(255) on btName, + // finite + non-negative on btHourlyRate. Pinning the bounds + // here lets SDK generators (openapi-typescript et al.) carry + // the constraints into client types. Same pattern as Customer + // (#270), Company (#272), Worker (#276). + btName: { type: 'string', minLength: 1, maxLength: 255 }, + btHourlyRate: { type: 'number', minimum: 0 }, btCompId: { type: 'integer' }, btArch: { type: 'boolean', readOnly: true }, }, @@ -90,7 +95,10 @@ const inventoryItemSchema = { type: 'object', properties: { invitId: { type: 'integer', readOnly: true }, - invitDescription: { type: 'string' }, + // Mirror inventoryitem.schema.js: min(1).max(1000) on + // invitDescription, finite on invitQty. Same pattern as the + // other entity component-schema pinning PRs. + invitDescription: { type: 'string', minLength: 1, maxLength: 1000 }, invitQty: { type: 'number' }, invitCompId: { type: 'integer' }, invitArch: { type: 'boolean', readOnly: true },