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 }, },