diff --git a/avt_fresh/client.py b/avt_fresh/client.py index a16bcd4..476f92f 100644 --- a/avt_fresh/client.py +++ b/avt_fresh/client.py @@ -1,8 +1,11 @@ import typing +import rich.repr + WHAT = "client" +@rich.repr.auto class FreshbooksContact(typing.NamedTuple): contact_id: int first_name: str @@ -22,6 +25,7 @@ class FreshbooksContact(typing.NamedTuple): } +@rich.repr.auto class FreshbooksClient(typing.NamedTuple): client_id: int email: str diff --git a/avt_fresh/invoice.py b/avt_fresh/invoice.py index 4106807..479de9c 100644 --- a/avt_fresh/invoice.py +++ b/avt_fresh/invoice.py @@ -3,6 +3,9 @@ import decimal import functools import typing +import rich.repr + + WHAT = "invoice" @@ -22,6 +25,7 @@ class InvalidField(Exception): pass +@rich.repr.auto class FreshbooksLine(typing.NamedTuple): invoice_id: int client_id: int @@ -54,15 +58,16 @@ class FreshbooksLine(typing.NamedTuple): "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 + # 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 +@rich.repr.auto class FreshbooksInvoice(typing.NamedTuple): lines: list[FreshbooksLine] notes: str @@ -115,15 +120,15 @@ class FreshbooksInvoice(typing.NamedTuple): 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 __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]: