From 34e2471b3c9c78258ecaa6079934bd91a6b545f1 Mon Sep 17 00:00:00 2001 From: "Aaron K. Clark" Date: Tue, 19 May 2026 11:30:45 -0500 Subject: [PATCH] docs(openapi): pin CustomerPayment cpayDescription length to match the validator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extends the field-length pinning sweep. \`cpayDescription\` is validated by zod as \`z.string().max(10000)\`; pinning the same \`maxLength\` in the OpenAPI spec lets SDK generators surface the constraint. \`cpayAmount\` has zod refinements (finite + non-zero) that don't have direct OpenAPI primitives; documented inline so future readers know to consult the validator for the full contract. Other schemas with free-text fields (PurchaseOrderVendor, PurchaseOrderHeader, PurchaseOrderLine) still have unpinned OpenAPI components — separate follow-up PRs. This batch just covers CustomerPayment so the change stays one-entity-per-PR. No behavior change — pure spec metadata. 761 tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/config/openapi.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/config/openapi.js b/app/config/openapi.js index a6829ab..052ad08 100644 --- a/app/config/openapi.js +++ b/app/config/openapi.js @@ -159,8 +159,15 @@ const customerPaymentSchema = { properties: { cpayId: { type: 'integer', readOnly: true }, cpayCustId: { type: 'integer' }, - cpayDescription: { type: 'string' }, + // customerpayment.schema.js: cpayDescription is optional and + // capped at 10000 chars (the same ceiling used for other free- + // text fields). Pinning maxLength here matches the validator. + cpayDescription: { type: 'string', maxLength: 10000 }, cpayDate: { type: 'string', format: 'date' }, + // cpayAmount must be finite + non-zero (a $0 ledger entry is + // operator error). The non-zero rule isn't expressible in + // OpenAPI's standard vocabulary, but operators can read the + // zod source for the full contract. cpayAmount: { type: 'number' }, cpayArch: { type: 'boolean', readOnly: true }, },