Merge main into front-8
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> # Conflicts: # .gitea/workflows/deploy.yml
This commit is contained in:
@@ -288,6 +288,19 @@ class QuoteRequest(StrictModel):
|
||||
raise ValueError('The delivery address CEP must be the CEP freight was quoted for')
|
||||
return self
|
||||
|
||||
class MontadorOrder(StrictModel):
|
||||
"""What the montador sends (front 7a.2b): the typed customer, pickup only
|
||||
and loose artwork only; the server prices and approves it as a quote."""
|
||||
request_key: UUID
|
||||
customer: Customer
|
||||
items: list[Item] = Field(min_length=1, max_length=30)
|
||||
|
||||
@model_validator(mode='after')
|
||||
def loose_art_only(self):
|
||||
if any(item.mode != 'avulsa' for item in self.items):
|
||||
raise ValueError('O montador só monta artes avulsas.')
|
||||
return self
|
||||
|
||||
class Review(StrictModel):
|
||||
items: list[Item] = Field(min_length=1, max_length=30)
|
||||
|
||||
@@ -499,3 +512,19 @@ class ArtworkSubmission(StrictModel):
|
||||
version: int = Field(ge=0, strict=True)
|
||||
files: list[FileReference] = Field(min_length=1, max_length=60)
|
||||
note: str = Field(min_length=1, max_length=1000)
|
||||
|
||||
class StampSize(StrictModel):
|
||||
"""One row of the montador's size table (Fase 2, front 7)."""
|
||||
letter: str = Field(pattern=r'^[A-Z]{1,2}$')
|
||||
width_cm: Decimal = Field(gt=0, le=56, decimal_places=2)
|
||||
|
||||
class StampSizeTable(StrictModel):
|
||||
"""The whole table, replaced in one go by Gestão."""
|
||||
sizes: list[StampSize] = Field(min_length=1, max_length=26)
|
||||
|
||||
@model_validator(mode='after')
|
||||
def letters_unique(self):
|
||||
letters = [row.letter for row in self.sizes]
|
||||
if len(letters) != len(set(letters)):
|
||||
raise ValueError('Cada tamanho tem uma letra própria.')
|
||||
return self
|
||||
|
||||
Reference in New Issue
Block a user