forked from lnbits/events
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
49 lines (41 loc) · 912 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
from fastapi import Query
from pydantic import BaseModel, EmailStr
from typing import Optional
class CreateEvent(BaseModel):
wallet: str
name: str
info: str
banner: Optional[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)
class CreateTicket(BaseModel):
name: str
email: EmailStr
class Event(BaseModel):
id: str
wallet: str
name: str
info: str
banner: Optional[str]
closing_date: str
event_start_date: str
event_end_date: str
currency: str
amount_tickets: int
price_per_ticket: float
sold: int
time: int
class Ticket(BaseModel):
id: str
wallet: str
event: str
name: str
email: str
registered: bool
reg_timestamp: Optional[int]
paid: bool
time: int