19 lines
669 B
Python
19 lines
669 B
Python
"""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)
|