-
Notifications
You must be signed in to change notification settings - Fork 5
/
models.py
51 lines (42 loc) · 966 Bytes
/
models.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from datetime import datetime
from typing import Optional
from fastapi import Query
from pydantic import BaseModel, EmailStr
class CreateEvent(BaseModel):
wallet: str
name: str
info: str
closing_date: str
event_start_date: str
event_end_date: str
currency: str = "sat"
amount_tickets: int = Query(..., ge=0)
price_per_ticket: float = Query(..., ge=0)
banner: Optional[str] = None
class CreateTicket(BaseModel):
name: str
email: EmailStr
class Event(BaseModel):
id: str
wallet: str
name: str
info: str
closing_date: str
event_start_date: str
event_end_date: str
currency: str
amount_tickets: int
price_per_ticket: float
time: datetime
sold: int = 0
banner: Optional[str] = None
class Ticket(BaseModel):
id: str
wallet: str
event: str
name: str
email: str
registered: bool
paid: bool
time: datetime
reg_timestamp: datetime