better reprs
This commit is contained in:
@@ -54,6 +54,14 @@ class FreshbooksLine(typing.NamedTuple):
|
|||||||
"quantity": str(self.quantity),
|
"quantity": str(self.quantity),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def __rich_repr__(self):
|
||||||
|
yield "line_id", self.line_id
|
||||||
|
yield "description", self.description
|
||||||
|
yield "amount", self.amount
|
||||||
|
yield "quantity", self.quantity
|
||||||
|
yield "rate", self.rate
|
||||||
|
yield "name", self.name
|
||||||
|
|
||||||
|
|
||||||
class FreshbooksInvoice(typing.NamedTuple):
|
class FreshbooksInvoice(typing.NamedTuple):
|
||||||
lines: list[FreshbooksLine]
|
lines: list[FreshbooksLine]
|
||||||
@@ -107,6 +115,16 @@ class FreshbooksInvoice(typing.NamedTuple):
|
|||||||
status=kwargs["v3_status"],
|
status=kwargs["v3_status"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def __rich_repr__(self):
|
||||||
|
yield "invoice_id", self.invoice_id
|
||||||
|
yield "organization", self.organization
|
||||||
|
yield "date", self.date
|
||||||
|
yield "status", self.status
|
||||||
|
yield "amount", self.amount
|
||||||
|
yield "lines", self.lines
|
||||||
|
yield "contacts", self.contacts
|
||||||
|
yield "invoice_number", self.number
|
||||||
|
|
||||||
|
|
||||||
def get_all_draft_invoices(*, get_func: typing.Callable) -> list[FreshbooksInvoice]:
|
def get_all_draft_invoices(*, get_func: typing.Callable) -> list[FreshbooksInvoice]:
|
||||||
return _get(get_func=get_func, status="draft")
|
return _get(get_func=get_func, status="draft")
|
||||||
|
|||||||
Reference in New Issue
Block a user