feat: validate currency for stall shipping zones
This commit is contained in:
parent
16a6104b25
commit
c0dce31231
2 changed files with 11 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue