forked from pgorecki/python-ddd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcatalog.py
More file actions
35 lines (23 loc) · 636 Bytes
/
Copy pathcatalog.py
File metadata and controls
35 lines (23 loc) · 636 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
35
from uuid import UUID, uuid4
from pydantic import BaseModel
class CurrentUser(BaseModel):
id: UUID
username: str
@classmethod
def fake_user(cls):
return CurrentUser(id=uuid4(), username="fake_user")
class ListingWriteModel(BaseModel):
title: str
description: str
ask_price_amount: float
ask_price_currency: str = "USD"
class ListingPublishModel(BaseModel):
id: UUID
class ListingReadModel(BaseModel):
id: UUID
title: str = ""
description: str
ask_price_amount: float
ask_price_currency: str
class ListingIndexModel(BaseModel):
data: list[ListingReadModel]