-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschemas.py
56 lines (40 loc) · 1.15 KB
/
schemas.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
52
53
54
55
56
from typing import Optional
from uuid import UUID
from pydantic import BaseModel, Field
from config import PropertiesStatus, PropertiesType, RoleUser
class PropertyRequest(BaseModel):
address_id: Optional[UUID]
type: PropertiesType
price: float = Field(ge=0)
status: PropertiesStatus
title: str = Field(min_length=1, max_length=100)
subtitle: str = Field(min_length=1, max_length=100)
size: float = Field(ge=0)
bedrooms: int = Field(ge=0)
rooms: int = Field(ge=0)
bathrooms: int = Field(ge=0)
description: str = Field(min_length=1)
video: Optional[str] = None
map: Optional[str] = None
class CreateAgentRequest(BaseModel):
name: str
email: str
username: str
password: str
phone: str
role: RoleUser
class Token(BaseModel):
access_token: str
token_type: str
class StateRequest(BaseModel):
state: str
class AgentVerification(BaseModel):
password: str
new_password: str = Field(min_length=6)
class CityRequest(BaseModel):
city: str
state_id: Optional[UUID]
class AddressRequest(BaseModel):
state_id: Optional[UUID]
city_id: Optional[UUID]
address: str