From 895ab33577ee6f5503f443d5f5a7d95e7edc096d Mon Sep 17 00:00:00 2001 From: "Aaron K. Clark" Date: Tue, 19 May 2026 11:40:43 -0500 Subject: [PATCH] docs(openapi): pin PurchaseOrderVendor schema field constraints Extends the field-length pinning sweep (Customer, Company, Worker, BillingType, InventoryItem, Job, CustomerPayment) to the PO Vendor component. The 15 string fields all gain explicit min/maxLength matching purchaseordervendor.schema.js: - The 3 NOT-NULL columns (povName, povMailingAddress1, povMailingCity): minLength: 1, maxLength: 255 - Other 255-cap fields: maxLength: 255 - Zip fields: maxLength: 32 (matching the schema's max(32)) - povPhone: maxLength: 64 - povEMail: maxLength: 255 + format: email SDK generators (openapi-typescript et al.) carry the bounds into client-side types. No behavior change. 761 tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/config/openapi.js | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/app/config/openapi.js b/app/config/openapi.js index 052ad08..12d0911 100644 --- a/app/config/openapi.js +++ b/app/config/openapi.js @@ -245,21 +245,27 @@ const purchaseOrderVendorSchema = { type: 'object', properties: { povId: { type: 'integer', readOnly: true }, - povName: { type: 'string' }, - povMailingAddress1: { type: 'string' }, - povMailingAddress2: { type: 'string' }, - povMailingCity: { type: 'string' }, - povMailingState: { type: 'string' }, - povMailingCountry: { type: 'string' }, - povMailingZip: { type: 'string' }, - povBillingAddress1: { type: 'string' }, - povBillingAddress2: { type: 'string' }, - povBillingCity: { type: 'string' }, - povBillingState: { type: 'string' }, - povBillingCountry: { type: 'string' }, - povBillingZip: { type: 'string' }, - povPhone: { type: 'string' }, - povEMail: { type: 'string', format: 'email' }, + // Lengths mirror purchaseordervendor.schema.js. The three + // NOT-NULL columns (povName, povMailingAddress1, povMailingCity) + // get minLength: 1; everything else is unbounded-but-capped + // per zod. Same pattern as Customer (#270), Company (#272), + // Worker (#276), BillingType+InventoryItem (#290), Job (#294), + // CustomerPayment (#296). + povName: { type: 'string', minLength: 1, maxLength: 255 }, + povMailingAddress1: { type: 'string', minLength: 1, maxLength: 255 }, + povMailingAddress2: { type: 'string', maxLength: 255 }, + povMailingCity: { type: 'string', minLength: 1, maxLength: 255 }, + povMailingState: { type: 'string', maxLength: 255 }, + povMailingCountry: { type: 'string', maxLength: 255 }, + povMailingZip: { type: 'string', maxLength: 32 }, + povBillingAddress1: { type: 'string', maxLength: 255 }, + povBillingAddress2: { type: 'string', maxLength: 255 }, + povBillingCity: { type: 'string', maxLength: 255 }, + povBillingState: { type: 'string', maxLength: 255 }, + povBillingCountry: { type: 'string', maxLength: 255 }, + povBillingZip: { type: 'string', maxLength: 32 }, + povPhone: { type: 'string', maxLength: 64 }, + povEMail: { type: 'string', format: 'email', maxLength: 255 }, povCompId: { type: 'integer' }, povArch: { type: 'boolean', readOnly: true }, },