Initial roborto accounting implementation
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
"""Immutable issue-time client snapshots."""
|
||||
from dataclasses import dataclass
|
||||
from roborto_accounting.persistence.models import Client
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ClientSnapshot:
|
||||
name: str
|
||||
billing_address: str | None
|
||||
email: str | None
|
||||
phone: str | None
|
||||
contact_person: str | None
|
||||
tax_identifier: str | None
|
||||
|
||||
def snapshot_client(client: Client) -> ClientSnapshot:
|
||||
return ClientSnapshot(name=client.name, billing_address=client.billing_address,
|
||||
email=client.email, phone=client.phone,
|
||||
contact_person=client.contact_person,
|
||||
tax_identifier=client.tax_identifier)
|
||||
Reference in New Issue
Block a user