Pipelinen parannuksia building blockeilla
This commit is contained in:
38
zipit/template_runs/tmpl_inventory/schemas.py
Normal file
38
zipit/template_runs/tmpl_inventory/schemas.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from pydantic import BaseModel
|
||||
from datetime import date
|
||||
|
||||
class ProductCreate(BaseModel):
|
||||
product_id: int
|
||||
name: str
|
||||
description: str | None = None
|
||||
category: str
|
||||
|
||||
class ProductResponse(ProductCreate):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
class StorageLocationCreate(BaseModel):
|
||||
location_id: int
|
||||
name: str
|
||||
capacity: int = 0
|
||||
|
||||
class StorageLocationResponse(StorageLocationCreate):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
class TransferCreate(BaseModel):
|
||||
transfer_id: int
|
||||
product_id: int
|
||||
from_location_id: int
|
||||
to_location_id: int
|
||||
quantity: int = 0
|
||||
|
||||
class TransferResponse(TransferCreate):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user