Initial commit: Ebook Translation System with Docker setup
This commit is contained in:
47
ebook_backend&admin_panel/admin-backend/schemas.py
Normal file
47
ebook_backend&admin_panel/admin-backend/schemas.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import List
|
||||
|
||||
class AdminLogin(BaseModel):
|
||||
"""
|
||||
Schema for admin login credentials.
|
||||
|
||||
Attributes:
|
||||
username (str): Admin username.
|
||||
password (str): Admin password.
|
||||
"""
|
||||
username: str
|
||||
password: str
|
||||
|
||||
|
||||
class CodeItem(BaseModel):
|
||||
"""
|
||||
Schema representing a coupon code and its usage count.
|
||||
|
||||
Attributes:
|
||||
code (str): The coupon code.
|
||||
usage (int): Number of times the code has been used.
|
||||
"""
|
||||
code: str
|
||||
usage: int
|
||||
|
||||
|
||||
class CouponUploadItem(BaseModel):
|
||||
"""
|
||||
Schema for an individual coupon code to be uploaded.
|
||||
|
||||
Attributes:
|
||||
code (str): The coupon code.
|
||||
usage (int): Optional initial usage count (default is 0).
|
||||
"""
|
||||
code: str
|
||||
usage: int = 0
|
||||
|
||||
|
||||
class CouponUpload(BaseModel):
|
||||
"""
|
||||
Schema for bulk coupon upload containing a list of coupon items.
|
||||
|
||||
Attributes:
|
||||
codes (List[CouponUploadItem]): List of coupon entries.
|
||||
"""
|
||||
codes: List[CouponUploadItem]
|
||||
Reference in New Issue
Block a user