feat: a ready sheet can carry the empty strips cut from its top and bottom, and prints without them
All checks were successful
Build and deploy / Validate source (push) Successful in 7s
Build and deploy / Integration suite on a real stack (push) Successful in 7m49s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m23s
All checks were successful
Build and deploy / Validate source (push) Successful in 7s
Build and deploy / Integration suite on a real stack (push) Successful in 7m49s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m23s
Step 1 of trimming empty strips (Marcus, 2026-11-18): the server side. - ProductionSource has trim_top_cm and trim_bottom_cm (default 0); only a measured finished sheet may carry them, and length_cm is what is left, billed and printed. - The generator leaves those file rows out (whole decode and banded PNG reading), and the proportion check compares the art with what is left. A PDF with a cut, or a cut that does not match the file, goes to hand preparation. - The Prumo report says "Faixas vazias cortadas: N cm". The Site does not send the cut yet (step 2). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -127,6 +127,11 @@ class ProductionSource(StrictModel):
|
||||
rotation_degrees: Literal[0, 90] = 0
|
||||
mirrored: bool = False
|
||||
measurement: Literal['file', 'customer']
|
||||
# The fully transparent strips the Site cut from the top and the bottom of
|
||||
# a ready sheet (Marcus, 2026-11-18): length_cm is what is left, billed
|
||||
# and printed; the file itself is length_cm plus both trims long.
|
||||
trim_top_cm: Decimal = Field(default=Decimal(0), ge=0, le=6000)
|
||||
trim_bottom_cm: Decimal = Field(default=Decimal(0), ge=0, le=6000)
|
||||
|
||||
class ProductionPlacement(StrictModel):
|
||||
source_index: int = Field(ge=0, le=199, strict=True)
|
||||
@@ -224,6 +229,8 @@ class Item(StrictModel):
|
||||
raise ValueError('Production source does not fit the selected product')
|
||||
if is_sheet and (source.rotation_degrees or source.mirrored):
|
||||
raise ValueError('Finished sheets cannot be rotated or mirrored by the layout')
|
||||
if (source.trim_top_cm or source.trim_bottom_cm) and (not is_sheet or source.measurement != 'file'):
|
||||
raise ValueError('Only a measured finished sheet has its empty strips cut')
|
||||
# A textile transfer is pressed face down: mirrored, it prints backwards.
|
||||
if self.mode == 'avulsa' and source.mirrored:
|
||||
raise ValueError('Textile artwork cannot be mirrored')
|
||||
|
||||
Reference in New Issue
Block a user