fix: keep pallet labels on A4 templates

This commit is contained in:
2026-09-20 14:05:00 +08:00
parent ee97565f67
commit 493d62e04c
15 changed files with 269 additions and 27 deletions
@@ -4,6 +4,24 @@ info:
version: 1.0.0
description: Internal stateless PDF rendering API. This path must not be exposed through Gateway.
paths:
/internal/print/v1/pdfs/pallet-a4-labels:
post:
summary: Generate non-FBA pallet labels as landscape A4 pages
operationId: generatePalletA4Labels
security: [{ internalServiceToken: [] }]
parameters: [{ $ref: '#/components/parameters/RequestId' }]
requestBody:
required: true
content: { application/json: { schema: { $ref: '#/components/schemas/GenericPalletPdfRequest' } } }
responses:
'200':
description: PDF generation succeeded, or a business error was returned as ApiResponse JSON.
content:
application/pdf: { schema: { type: string, format: binary } }
application/json: { schema: { $ref: '#/components/schemas/ApiError' } }
'413':
description: Request body exceeds the configured limit.
content: { application/json: { schema: { $ref: '#/components/schemas/ApiError' } } }
/internal/print/v1/pdfs/fba-pallet-labels:
post:
summary: Generate shared domestic and overseas FBA pallet labels as landscape A4 pages
@@ -176,6 +194,29 @@ components:
schema:
type: string
schemas:
GenericPalletPdfRequest:
type: object
required: [templateCode, pageSpec, downloadFileName, labels]
properties:
templateCode: { type: string, enum: [PALLET_A4_LANDSCAPE_V1] }
pageSpec:
type: object
required: [widthMm, heightMm]
properties:
widthMm: { type: number, enum: [297] }
heightMm: { type: number, enum: [210] }
downloadFileName: { type: string, minLength: 4, maxLength: 120 }
labels:
type: array
minItems: 1
maxItems: 2000
items:
type: object
required: [heading, reference, palletCode]
properties:
heading: { type: string, minLength: 1, maxLength: 80 }
reference: { type: string, minLength: 1, maxLength: 80 }
palletCode: { type: string, minLength: 1, maxLength: 80, pattern: '^[\x20-\x7E]+$' }
FbaPalletPdfRequest:
type: object
required: [templateCode, pageSpec, downloadFileName, labels]