forked from pgorecki/python-ddd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbidding.py
More file actions
33 lines (22 loc) · 681 Bytes
/
Copy pathbidding.py
File metadata and controls
33 lines (22 loc) · 681 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
from datetime import datetime
from pydantic import BaseModel
from seedwork.domain.value_objects import GenericUUID
class BidReadModel(BaseModel):
amount: float
currency: str
bidder_id: GenericUUID
bidder_username: str
class Config:
arbitrary_types_allowed = True
class BiddingResponse(BaseModel):
listing_id: GenericUUID
auction_status: str = "active" # active, ended
auction_end_date: datetime
bids: list[BidReadModel]
class Config:
arbitrary_types_allowed = True
class PlaceBidRequest(BaseModel):
bidder_id: GenericUUID
amount: float
class Config:
arbitrary_types_allowed = True