-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschemas.py
More file actions
97 lines (81 loc) · 2.38 KB
/
Copy pathschemas.py
File metadata and controls
97 lines (81 loc) · 2.38 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
from pydantic import BaseModel, EmailStr, constr, Field
from enum import Enum
from typing import Optional, List
class UserCreate(BaseModel):
Username: str
Password: str
Email: str
class LoginSchema(BaseModel):
username_or_email: str
password: str
class LoginResult(BaseModel):
userId: str
name: str
token: str
class LoginResponse(BaseModel):
status_code: int
error: bool
message: str
loginResult: LoginResult
class DeleteAccountRequest(BaseModel):
password: str
class UpdateAccountRequest(BaseModel):
current_password: str = Field(..., description="Current password of the user")
new_password: Optional[str] = Field(None, description="New password to set")
new_email: Optional[str] = Field(None, description="New email to set")
class IngredientResponse(BaseModel):
Id_Ingredients: int
nama: str
rating: Optional[str]
benefitidn: Optional[str] = None
class search_ingredients(BaseModel):
nama: Optional[str] = None
rating: Optional[List[str]] = None
benefitidn: Optional[List[str]] = None
class IngredientDetailResponse(BaseModel):
Id_Ingredients: int
nama: str
rating: Optional[str]
deskripsiidn: Optional[str]
benefitidn: Optional[str]
kategoriidn: Optional[str]
keyidn: Optional[str]
class AddNoteRequest(BaseModel):
Id_Ingredients: int
preference: str # "good" atau "bad"
class DeleteNoteRequest(BaseModel):
Id_Ingredients: int
class NoteDetail(BaseModel):
id: int
name: str
rating: str
category: str
preference: Optional[str]
class UserNotesResponse(BaseModel):
status_code: int
message: str
error: bool
data: Optional[List[NoteDetail]] = None
class ProductResponse(BaseModel):
Id_Products: int
nama_product: str
merk: Optional[str]
deskripsi: Optional[str]
url_gambar: Optional[str]
class search_products(BaseModel):
nama_atau_merk: Optional[str] = None
kategori: Optional[List[str]] = None
jenis_kulit: Optional[List[str]] = None
class ProductDetailResponse(BaseModel):
Id_Products: int
nama_product: str
merk: Optional[str]
jenis_product: Optional[str]
kategori: Optional[str]
jenis_kulit: Optional[str]
url_gambar: Optional[str]
key_ingredients: Optional[str]
ingredients: Optional[str]
deskripsi: Optional[str]
no_BPOM: Optional[str]
kegunaan: Optional[str]