Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lexoffice_client/contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ class Roles(BaseModel):
customer: Optional[Role] = None
vendor: Optional[Role] = None

@model_validator(mode="after")
def check_model(self) -> "Roles":
if bool(self.customer) == bool(self.vendor):
raise ValueError("Exactly one of 'customer' or 'vendor' must be set.")
return self


class ContactReadOnly(BaseModel):
id: UUID
Expand Down
9 changes: 2 additions & 7 deletions lexoffice_client/voucher.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,9 @@ class VoucherWritable(BaseModel):
@model_validator(mode="after")
def check_model(self) -> "VoucherWritable":
if self.voucherStatus != VoucherStatus.UNCHECKED:
if (
not self.voucherNumber
or not self.voucherDate
or not self.totalGrossAmount
or not self.totalTaxAmount
):
if self.voucherNumber is None or self.voucherDate is None:
raise ValueError(
"voucherNumber, voucherDate, totalGrossAmount and totalTaxAmount are required when voucherStatus is not unchecked."
"voucherNumber, voucherDate are required when voucherStatus is not unchecked."
)
if not self.useCollectiveContact:
if not self.contactId:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="lexoffice-client",
version="0.1.4",
version="0.1.5",
author="James Maguire",
author_email="jvm986@gmail.com",
description="A Python client for the Lexoffice API",
Expand Down