Squashed commit of the following:
commit893b229cc6Author: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 22:14:08 2025 -0500 j commit06f539aea2Author: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 21:55:30 2025 -0500 fk commitd0c2960ec9Author: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 21:50:53 2025 -0500 frick commit6b1362c166Author: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 21:49:40 2025 -0500 database commit8cadc6df4cAuthor: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 21:38:09 2025 -0500 asdf commit1ca6f98684Author: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 21:32:50 2025 -0500 fffff commit8bb337a9c3Author: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 21:31:13 2025 -0500 ffff commit65aba280c5Author: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 21:26:16 2025 -0500 aa commit59ef03a59eAuthor: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 21:24:21 2025 -0500 asdf commitf44d5740fcAuthor: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 21:23:32 2025 -0500 aaa commit13c96b1643Author: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 21:18:54 2025 -0500 sdf commit949c795fd1Author: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 21:17:53 2025 -0500 asdf commit8c3cd423feAuthor: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 20:56:01 2025 -0500 app2 commit78eafc739eAuthor: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 20:54:55 2025 -0500 app commitdc47eced14Author: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 20:43:15 2025 -0500 asdfasdfasdf commite24bcae88cAuthor: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 20:39:44 2025 -0500 a commitc894451bfeAuthor: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 20:38:20 2025 -0500 req commit3d09869562Author: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 20:33:27 2025 -0500 wrong number = code dont work lol i love computers commit4c93a1271bAuthor: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 20:29:39 2025 -0500 q commit1f5361da88Author: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 18:27:20 2025 -0500 same as original code now -5 days of my life commit511b070cbbAuthor: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 13:52:28 2025 -0500 pricey worky commit964fdd641bAuthor: zman <joshua.k.rzemien@gmail.com> Date: Fri Feb 7 11:37:29 2025 -0500 prep for pricing service work commita78c3bcba3Author: zman <joshua.k.rzemien@gmail.com> Date: Wed Feb 5 21:51:22 2025 -0500 more stuff yay commitbd9cfca7a9Author: zman <joshua.k.rzemien@gmail.com> Date: Tue Feb 4 22:30:33 2025 -0500 GIGA FIXED EVERYTHING OMG commit85510a4671Author: zman <joshua.k.rzemien@gmail.com> Date: Tue Feb 4 00:01:34 2025 -0500 data model change and some new services
This commit is contained in:
0
app/schemas/__init__.py
Normal file
0
app/schemas/__init__.py
Normal file
11
app/schemas/base.py
Normal file
11
app/schemas/base.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from pydantic import BaseModel
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
# Base schemas with shared attributes
|
||||
class BaseSchema(BaseModel):
|
||||
date_created: datetime
|
||||
date_modified: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True # Allows conversion from SQLAlchemy models
|
||||
66
app/schemas/box.py
Normal file
66
app/schemas/box.py
Normal file
@@ -0,0 +1,66 @@
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from app.schemas.base import BaseSchema
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
#BOX
|
||||
class BoxSchema(BaseSchema):
|
||||
product_id: str = Field(..., title="Product ID")
|
||||
type: str = Field(..., title="Box Type (collector, play, draft)")
|
||||
set_code: str = Field(..., title="Set Code")
|
||||
sku: Optional[str] = Field(None, title="SKU")
|
||||
num_cards_expected: Optional[int] = Field(None, title="Number of cards expected")
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
# CREATE
|
||||
# REQUEST
|
||||
class CreateBoxRequest(BaseModel):
|
||||
type: str = Field(..., title="Box Type (collector, play, draft)")
|
||||
set_code: str = Field(..., title="Set Code")
|
||||
sku: Optional[str] = Field(None, title="SKU")
|
||||
num_cards_expected: Optional[int] = Field(None, title="Number of cards expected")
|
||||
|
||||
# RESPONSE
|
||||
class CreateBoxResponse(BaseModel):
|
||||
status_code: int = Field(..., title="status_code")
|
||||
success: bool = Field(..., title="success")
|
||||
box: list[BoxSchema] = Field(..., title="box")
|
||||
|
||||
# UPDATE
|
||||
# REQUEST
|
||||
class UpdateBoxRequest(BaseModel):
|
||||
type: Optional[str] = Field(None, title="Box Type (collector, play, draft)")
|
||||
set_code: Optional[str] = Field(None, title="Set Code")
|
||||
sku: Optional[str] = Field(None, title="SKU")
|
||||
num_cards_expected: Optional[int] = Field(None, title="Number of cards expected")
|
||||
|
||||
# GET
|
||||
# RESPONSE
|
||||
class GetBoxResponse(BaseModel):
|
||||
status_code: int = Field(..., title="status_code")
|
||||
success: bool = Field(..., title="success")
|
||||
boxes: list[BoxSchema] = Field(..., title="boxes")
|
||||
|
||||
|
||||
# OPEN BOX
|
||||
class OpenBoxSchema(BaseModel):
|
||||
id: str = Field(..., title="id")
|
||||
num_cards_actual: Optional[int] = Field(None, title="Number of cards actual")
|
||||
date_opened: Optional[datetime] = Field(None, title="Date Opened")
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
# CREATE
|
||||
# REQUEST
|
||||
class CreateOpenBoxRequest(BaseModel):
|
||||
product_id: str = Field(..., title="Product ID")
|
||||
file_ids: list[str] = Field(None, title="File IDs")
|
||||
num_cards_actual: Optional[int] = Field(None, title="Number of cards actual")
|
||||
date_opened: Optional [str] = Field(None, title="Date Opened")
|
||||
|
||||
# RESPONSE
|
||||
class CreateOpenBoxResponse(BaseModel):
|
||||
status_code: int = Field(..., title="status_code")
|
||||
success: bool = Field(..., title="success")
|
||||
open_box: list[OpenBoxSchema] = Field(..., title="open_box")
|
||||
51
app/schemas/file.py
Normal file
51
app/schemas/file.py
Normal file
@@ -0,0 +1,51 @@
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
# FILE
|
||||
class FileSchema(BaseModel):
|
||||
id: str = Field(..., title="id")
|
||||
filename: str = Field(..., title="filename")
|
||||
type: str = Field(..., title="type")
|
||||
filesize_kb: float = Field(..., title="filesize_kb")
|
||||
source: str = Field(..., title="source")
|
||||
status: str = Field(..., title="status")
|
||||
service: Optional[str] = Field(None, title="service")
|
||||
date_created: datetime = Field(..., title="date_created")
|
||||
date_modified: datetime = Field(..., title="date_modified")
|
||||
|
||||
# This enables ORM mode
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
# CREATE
|
||||
# REQUEST
|
||||
class CreateFileRequest(BaseModel):
|
||||
source: str = Field(..., title="source")
|
||||
type: str = Field(..., title="type")
|
||||
# optional
|
||||
service: Optional[str] = Field(None, title="Service")
|
||||
filename: Optional[str] = Field(None, title="Filename")
|
||||
|
||||
# RESPONSE
|
||||
class CreateFileResponse(BaseModel):
|
||||
status_code: int = Field(..., title="status_code")
|
||||
success: bool = Field(..., title="success")
|
||||
files: list[FileSchema] = Field(..., title="files")
|
||||
|
||||
# GET
|
||||
# RESPONSE
|
||||
class GetFileResponse(BaseModel):
|
||||
status_code: int = Field(..., title="status_code")
|
||||
success: bool = Field(..., title="success")
|
||||
files: list[FileSchema] = Field(..., title="files")
|
||||
# QUERY PARAMS
|
||||
class GetFileQueryParams(BaseModel):
|
||||
status: Optional[str] = Field(None, title="status")
|
||||
|
||||
# DELETE
|
||||
# RESPONSE
|
||||
class DeleteFileResponse(BaseModel):
|
||||
status_code: int = Field(..., title="status_code")
|
||||
success: bool = Field(..., title="success")
|
||||
files: list[FileSchema] = Field(..., title="files")
|
||||
5
app/schemas/inventory.py
Normal file
5
app/schemas/inventory.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class UpdateInventoryResponse(BaseModel):
|
||||
success: bool = Field(..., title="Success")
|
||||
19
app/schemas/order.py
Normal file
19
app/schemas/order.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
# FILE
|
||||
class OrderSchema(BaseModel):
|
||||
id: str = Field(..., title="id")
|
||||
filename: str = Field(..., title="filename")
|
||||
type: str = Field(..., title="type")
|
||||
filesize_kb: float = Field(..., title="filesize_kb")
|
||||
source: str = Field(..., title="source")
|
||||
status: str = Field(..., title="status")
|
||||
service: Optional[str] = Field(None, title="service")
|
||||
date_created: datetime = Field(..., title="date_created")
|
||||
date_modified: datetime = Field(..., title="date_modified")
|
||||
|
||||
# This enables ORM mode
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
Reference in New Issue
Block a user