feat: progressive price bands per product (front 8.2)
A price may carry up to five bands, "from N m, R$ Y": the order's total billed metres of that product chooses one price for its whole quantity, the manual-file extra still on top. Bands start and become history with their price row. The Site charges the same band for the cart, shows "Faltam X m para R$ Y o metro" and lists the bands under the price table; the Kanban's Site tab edits them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -357,10 +357,18 @@ class SiteProductToggle(StrictModel):
|
||||
enabled: bool
|
||||
|
||||
|
||||
class PriceBand(StrictModel):
|
||||
"""Uma faixa por metragem: a partir de X m, o metro passa a custar Y."""
|
||||
from_metres: Decimal
|
||||
unit_cents: int = Field(strict=True)
|
||||
|
||||
|
||||
class SitePriceNew(StrictModel):
|
||||
"""Um novo preço e a data em que começa; sem data, começa agora."""
|
||||
unit_cents: int = Field(ge=0, le=10000000, strict=True)
|
||||
starts_at: datetime | None = None
|
||||
# As faixas viajam com o preço (front 8.2); vazio é o preço único.
|
||||
bands: list[PriceBand] = Field(default_factory=list)
|
||||
|
||||
|
||||
class Contraction(StrictModel):
|
||||
|
||||
Reference in New Issue
Block a user