from dataclasses import dataclass from apps.customers.domain.enums import CustomerType @dataclass(frozen=True, slots=True) class CustomerDetailsData: """Customer form input. ``personal_identity_code``: empty keeps the stored code, a value replaces it. ``remove_personal_id``: remove the stored code (admin and management only). """ name: str type: CustomerType business_id: str = "" personal_identity_code: str = "" remove_personal_id: bool = False @dataclass(frozen=True, slots=True) class ContactData: name: str title: str = "" phone: str = "" email: str = "" note: str = "" @dataclass(frozen=True, slots=True) class BillingUnitData: name: str billing_address: str = "" e_invoice_address: str = "" e_invoice_operator: str = "" reference: str = "" @dataclass(frozen=True, slots=True) class CustomerSummary: """What other modules (jobs, sales) see of a customer.""" id: int name: str type: CustomerType business_id: str | None is_internal: bool @dataclass(frozen=True, slots=True) class CustomerDetails: id: int name: str type: CustomerType business_id: str | None is_internal: bool personal_id_masked: str | None personal_id_full: str | None # only when explicitly requested by an authorized caller @dataclass(frozen=True, slots=True) class ContactView: id: int customer_id: int name: str title: str phone: str email: str note: str in_use: bool @dataclass(frozen=True, slots=True) class BillingUnitView: id: int customer_id: int name: str billing_address: str e_invoice_address: str e_invoice_operator: str reference: str in_use: bool