-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.py
More file actions
34 lines (23 loc) · 746 Bytes
/
client.py
File metadata and controls
34 lines (23 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from typing import TYPE_CHECKING
from pydantic import EmailStr
from sqlmodel import Field, Relationship, SQLModel
if TYPE_CHECKING:
from .gig import Gig
class ClientBase(SQLModel):
email_address: EmailStr
first_name: str
last_name: str
phone_number: str # TODO: Change to PhoneNumber
address: str
city: str
province: str | None
zip: str | None
country: str | None
class Client(ClientBase, table=True):
id: int = Field(default=None, primary_key=True)
gigs: list["Gig"] = Relationship(back_populates="client")
# todo: Add relationship to invoices
# todo: Add communication log and relationship to it
class ClientCreate(ClientBase): ...
class ClientPublic(ClientBase):
id: int