feat: validate currency for stall shipping zones

This commit is contained in:
Vlad Stan 2023-03-02 10:36:39 +02:00
parent 16a6104b25
commit c0dce31231
2 changed files with 11 additions and 0 deletions

View file

@ -69,6 +69,13 @@ class PartialStall(BaseModel):
shipping_zones: List[PartialZone] = []
config: StallConfig = StallConfig()
def validate_stall(self):
for z in self.shipping_zones:
if z.currency != self.currency:
raise ValueError(
f"Sipping zone '{z.name}' has different currency than stall."
)
class Stall(PartialStall):
id: str