init
This commit is contained in:
@@ -1,82 +0,0 @@
|
||||
from .product_schemas import (
|
||||
ProductCreate,
|
||||
ProductResponse,
|
||||
ProductMaterialItemUpdate,
|
||||
ProductBOMUpdate,
|
||||
ProductMaterialItemResponse,
|
||||
ProductBOMResponse
|
||||
)
|
||||
from .supplier_schemas import SupplierCreate, SupplierResponse
|
||||
from .customer_schemas import CustomerCreate, CustomerResponse
|
||||
from .warehouse_schemas import WarehouseCreate, WarehouseResponse
|
||||
from .inventory_schemas import InventoryResponse, InventoryCreate, InventoryUpdate
|
||||
from .stock_movement_schemas import StockMovementCreate, StockMovementResponse
|
||||
from .purchase_order_schemas import (
|
||||
PurchaseOrderCreate,
|
||||
PurchaseOrderResponse,
|
||||
PurchaseOrderItemCreate,
|
||||
PurchaseOrderItemResponse,
|
||||
PurchaseOrderDetailResponse,
|
||||
PurchaseOrderReceiveItem,
|
||||
PurchaseOrderReceiveRequest
|
||||
)
|
||||
from .sales_order_schemas import (
|
||||
SalesOrderCreate,
|
||||
SalesOrderResponse,
|
||||
SalesOrderItemCreate,
|
||||
SalesOrderItemResponse,
|
||||
SalesOrderDetailResponse,
|
||||
ProductionMaterialPlanItemResponse,
|
||||
SalesOrderProductionPlanResponse,
|
||||
SalesOrderIssueRequest,
|
||||
SalesOrderIssueResponse,
|
||||
SalesOrderStatusUpdate
|
||||
)
|
||||
from .finance_schemas import (
|
||||
FinanceAllocationCreate,
|
||||
FinanceTransactionCreate,
|
||||
ReceiptCreate,
|
||||
PaymentCreate,
|
||||
FinanceAllocationResponse,
|
||||
FinanceTransactionResponse,
|
||||
FinanceSummaryResponse,
|
||||
ReceivableItemResponse,
|
||||
PayableItemResponse,
|
||||
PartnerStatementItemResponse,
|
||||
FinancePartnerStatementResponse,
|
||||
PartnerProductStatementItemResponse,
|
||||
FinancePartnerProductStatementResponse
|
||||
)
|
||||
from .material_schemas import (
|
||||
MaterialPriceHistoryCreate,
|
||||
MaterialPriceHistoryResponse,
|
||||
MaterialSupplierCreate,
|
||||
MaterialSupplierResponse,
|
||||
MaterialPriceTrendResponse
|
||||
)
|
||||
|
||||
from .common_schemas import PaginatedResponse
|
||||
|
||||
__all__ = [
|
||||
"PaginatedResponse",
|
||||
"ProductCreate", "ProductResponse", "ProductMaterialItemUpdate", "ProductBOMUpdate",
|
||||
"ProductMaterialItemResponse", "ProductBOMResponse",
|
||||
"SupplierCreate", "SupplierResponse",
|
||||
"CustomerCreate", "CustomerResponse",
|
||||
"WarehouseCreate", "WarehouseResponse",
|
||||
"InventoryResponse", "InventoryCreate", "InventoryUpdate",
|
||||
"StockMovementCreate", "StockMovementResponse",
|
||||
"PurchaseOrderCreate", "PurchaseOrderResponse", "PurchaseOrderItemCreate",
|
||||
"PurchaseOrderItemResponse", "PurchaseOrderDetailResponse", "PurchaseOrderReceiveItem", "PurchaseOrderReceiveRequest",
|
||||
"SalesOrderCreate", "SalesOrderResponse", "SalesOrderItemCreate", "SalesOrderItemResponse", "SalesOrderDetailResponse",
|
||||
"ProductionMaterialPlanItemResponse", "SalesOrderProductionPlanResponse",
|
||||
"SalesOrderIssueRequest", "SalesOrderIssueResponse", "SalesOrderStatusUpdate",
|
||||
"FinanceAllocationCreate", "FinanceTransactionCreate",
|
||||
"ReceiptCreate", "PaymentCreate",
|
||||
"FinanceAllocationResponse", "FinanceTransactionResponse",
|
||||
"FinanceSummaryResponse", "ReceivableItemResponse", "PayableItemResponse",
|
||||
"PartnerStatementItemResponse", "FinancePartnerStatementResponse",
|
||||
"PartnerProductStatementItemResponse", "FinancePartnerProductStatementResponse",
|
||||
"MaterialPriceHistoryCreate", "MaterialPriceHistoryResponse",
|
||||
"MaterialSupplierCreate", "MaterialSupplierResponse", "MaterialPriceTrendResponse",
|
||||
]
|
||||
@@ -1,11 +0,0 @@
|
||||
from typing import TypeVar, Generic, List
|
||||
from pydantic import BaseModel
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
class PaginatedResponse(BaseModel, Generic[T]):
|
||||
items: List[T]
|
||||
total: int
|
||||
skip: int
|
||||
limit: int
|
||||
@@ -1,24 +0,0 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class CustomerCreate(BaseModel):
|
||||
code: Optional[str] = None
|
||||
name: str
|
||||
contact_person: Optional[str] = None
|
||||
phone: Optional[str] = None
|
||||
email: Optional[str] = None
|
||||
address: Optional[str] = None
|
||||
|
||||
|
||||
class CustomerResponse(BaseModel):
|
||||
id: int
|
||||
code: Optional[str]
|
||||
name: str
|
||||
contact_person: Optional[str]
|
||||
phone: Optional[str]
|
||||
email: Optional[str]
|
||||
is_active: bool
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
@@ -1,152 +0,0 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List, Literal
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
TxnType = Literal["receipt", "payment"]
|
||||
PartnerType = Literal["customer", "supplier"]
|
||||
OrderType = Literal["sales", "purchase"]
|
||||
TxnStatus = Literal["confirmed", "voided"]
|
||||
|
||||
|
||||
class FinanceAllocationCreate(BaseModel):
|
||||
order_type: OrderType
|
||||
order_id: int
|
||||
allocated_amount: Decimal = Field(gt=0)
|
||||
|
||||
|
||||
class FinanceTransactionCreate(BaseModel):
|
||||
amount: Decimal = Field(gt=0)
|
||||
txn_date: Optional[datetime] = None
|
||||
method: str = "bank"
|
||||
account_name: Optional[str] = None
|
||||
remark: Optional[str] = None
|
||||
allocations: List[FinanceAllocationCreate]
|
||||
|
||||
|
||||
class ReceiptCreate(FinanceTransactionCreate):
|
||||
customer_id: int
|
||||
|
||||
|
||||
class PaymentCreate(FinanceTransactionCreate):
|
||||
supplier_id: int
|
||||
|
||||
|
||||
class FinanceAllocationResponse(BaseModel):
|
||||
id: int
|
||||
order_type: str
|
||||
order_id: int
|
||||
allocated_amount: Decimal
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class FinanceTransactionResponse(BaseModel):
|
||||
id: int
|
||||
txn_no: str
|
||||
txn_type: TxnType
|
||||
partner_type: PartnerType
|
||||
partner_id: int
|
||||
amount: Decimal
|
||||
txn_date: datetime
|
||||
method: str
|
||||
account_name: Optional[str]
|
||||
status: TxnStatus
|
||||
remark: Optional[str]
|
||||
created_at: datetime
|
||||
allocations: List[FinanceAllocationResponse] = []
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class FinanceSummaryResponse(BaseModel):
|
||||
receivable_total: Decimal
|
||||
payable_total: Decimal
|
||||
monthly_receipt_total: Decimal
|
||||
monthly_payment_total: Decimal
|
||||
selected_year: int
|
||||
selected_quarter: Optional[int] = None
|
||||
period_label: str
|
||||
period_receipt_total: Decimal = Decimal("0")
|
||||
period_payment_total: Decimal = Decimal("0")
|
||||
overdue_receivable_count: int = 0
|
||||
overdue_payable_count: int = 0
|
||||
|
||||
|
||||
class ReceivableItemResponse(BaseModel):
|
||||
order_id: int
|
||||
order_no: str
|
||||
customer_id: int
|
||||
customer_name: str
|
||||
order_date: datetime
|
||||
total_amount: Decimal
|
||||
received_amount: Decimal
|
||||
receivable_amount: Decimal
|
||||
status: str
|
||||
|
||||
|
||||
class PayableItemResponse(BaseModel):
|
||||
order_id: int
|
||||
order_no: str
|
||||
supplier_id: int
|
||||
supplier_name: str
|
||||
order_date: datetime
|
||||
total_amount: Decimal
|
||||
paid_amount: Decimal
|
||||
payable_amount: Decimal
|
||||
status: str
|
||||
|
||||
|
||||
class PartnerStatementItemResponse(BaseModel):
|
||||
partner_id: int
|
||||
partner_name: str
|
||||
order_count: int
|
||||
transaction_count: int
|
||||
order_total: Decimal
|
||||
settled_total: Decimal
|
||||
transaction_total: Decimal
|
||||
outstanding_total: Decimal
|
||||
period_year: int
|
||||
period_quarter: Optional[int] = None
|
||||
|
||||
|
||||
class FinancePartnerStatementResponse(BaseModel):
|
||||
partner_type: PartnerType
|
||||
year: int
|
||||
quarter: Optional[int] = None
|
||||
period_label: str
|
||||
order_total: Decimal
|
||||
settled_total: Decimal
|
||||
transaction_total: Decimal
|
||||
outstanding_total: Decimal
|
||||
items: List[PartnerStatementItemResponse] = []
|
||||
|
||||
|
||||
class PartnerProductStatementItemResponse(BaseModel):
|
||||
partner_id: int
|
||||
partner_name: str
|
||||
product_id: int
|
||||
product_sku: Optional[str] = None
|
||||
product_name: str
|
||||
order_count: int
|
||||
order_quantity: Decimal
|
||||
order_amount: Decimal
|
||||
settled_amount: Decimal
|
||||
outstanding_amount: Decimal
|
||||
period_year: int
|
||||
period_quarter: Optional[int] = None
|
||||
|
||||
|
||||
class FinancePartnerProductStatementResponse(BaseModel):
|
||||
partner_type: PartnerType
|
||||
year: int
|
||||
quarter: Optional[int] = None
|
||||
period_label: str
|
||||
partner_id: Optional[int] = None
|
||||
order_amount_total: Decimal
|
||||
settled_amount_total: Decimal
|
||||
outstanding_amount_total: Decimal
|
||||
items: List[PartnerProductStatementItemResponse] = []
|
||||
@@ -1,34 +0,0 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
class InventoryResponse(BaseModel):
|
||||
id: int
|
||||
product_id: int
|
||||
product_name: str
|
||||
product_sku: str
|
||||
warehouse_id: int
|
||||
warehouse_name: str
|
||||
quantity: Decimal
|
||||
locked_quantity: Decimal
|
||||
available_quantity: Decimal
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class InventoryCreate(BaseModel):
|
||||
product_id: int
|
||||
warehouse_id: int
|
||||
quantity: Decimal = Decimal("0")
|
||||
locked_quantity: Decimal = Decimal("0")
|
||||
batch_number: Optional[str] = None
|
||||
location: Optional[str] = None
|
||||
|
||||
|
||||
class InventoryUpdate(BaseModel):
|
||||
quantity: Optional[Decimal] = None
|
||||
locked_quantity: Optional[Decimal] = None
|
||||
batch_number: Optional[str] = None
|
||||
location: Optional[str] = None
|
||||
@@ -1,80 +0,0 @@
|
||||
"""
|
||||
物料管理相关数据模型
|
||||
|
||||
定义物料价格历史和物料供应商关联的数据结构
|
||||
"""
|
||||
from pydantic import BaseModel, Field
|
||||
from datetime import datetime
|
||||
from typing import Optional, List, Dict
|
||||
|
||||
|
||||
class MaterialPriceHistoryCreate(BaseModel):
|
||||
"""创建物料价格历史的请求模型"""
|
||||
price: float = Field(..., gt=0, description="物料价格")
|
||||
supplier_id: Optional[int] = Field(None, description="供应商ID")
|
||||
remark: Optional[str] = Field(None, description="备注")
|
||||
|
||||
|
||||
class MaterialPriceHistoryResponse(BaseModel):
|
||||
"""物料价格历史的响应模型"""
|
||||
id: int
|
||||
product_id: int
|
||||
product_sku: str
|
||||
product_name: str
|
||||
price: float
|
||||
effective_date: datetime
|
||||
supplier_id: Optional[int]
|
||||
supplier_name: Optional[str]
|
||||
remark: Optional[str]
|
||||
created_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class MaterialSupplierCreate(BaseModel):
|
||||
"""创建物料供应商关联的请求模型"""
|
||||
supplier_id: int = Field(..., description="供应商ID")
|
||||
is_primary: bool = Field(False, description="是否为主要供应商")
|
||||
contact_person: Optional[str] = Field(None, description="联系人")
|
||||
contact_phone: Optional[str] = Field(None, description="联系电话")
|
||||
lead_time: Optional[int] = Field(None, ge=1, description="交货周期(天)")
|
||||
min_order_quantity: Optional[int] = Field(None, ge=1, description="最小订购量")
|
||||
|
||||
|
||||
class MaterialSupplierResponse(BaseModel):
|
||||
"""物料供应商关联的响应模型"""
|
||||
id: int
|
||||
product_id: int
|
||||
product_sku: str
|
||||
product_name: str
|
||||
supplier_id: int
|
||||
supplier_name: str
|
||||
is_primary: bool
|
||||
contact_person: Optional[str]
|
||||
contact_phone: Optional[str]
|
||||
lead_time: Optional[int]
|
||||
min_order_quantity: Optional[int]
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class PriceHistoryItem(BaseModel):
|
||||
"""价格历史项"""
|
||||
date: datetime
|
||||
price: float
|
||||
supplier_name: Optional[str]
|
||||
|
||||
|
||||
class MaterialPriceTrendResponse(BaseModel):
|
||||
"""物料价格趋势的响应模型"""
|
||||
product_id: int
|
||||
product_sku: str
|
||||
product_name: str
|
||||
current_price: float
|
||||
price_change: float
|
||||
price_change_percent: float
|
||||
price_history: List[PriceHistoryItem]
|
||||
@@ -1,63 +0,0 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional, List
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
class ProductCreate(BaseModel):
|
||||
sku: str
|
||||
name: str
|
||||
description: Optional[str] = None
|
||||
category: Optional[str] = None
|
||||
unit: str = "件"
|
||||
item_type: str = "finished"
|
||||
cost_price: Decimal = Decimal("0")
|
||||
sale_price: Decimal = Decimal("0")
|
||||
min_stock: int = 0
|
||||
max_stock: int = 1000
|
||||
|
||||
|
||||
class ProductResponse(BaseModel):
|
||||
id: int
|
||||
sku: str
|
||||
name: str
|
||||
description: Optional[str]
|
||||
category: Optional[str]
|
||||
unit: str
|
||||
item_type: str
|
||||
cost_price: Decimal
|
||||
sale_price: Decimal
|
||||
min_stock: int
|
||||
max_stock: int
|
||||
material_cost: Decimal = Decimal("0")
|
||||
is_active: bool
|
||||
created_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class ProductMaterialItemUpdate(BaseModel):
|
||||
material_id: int
|
||||
quantity: Decimal
|
||||
loss_rate: Decimal = Decimal("0")
|
||||
|
||||
|
||||
class ProductBOMUpdate(BaseModel):
|
||||
items: List[ProductMaterialItemUpdate]
|
||||
|
||||
|
||||
class ProductMaterialItemResponse(BaseModel):
|
||||
material_id: int
|
||||
material_sku: str
|
||||
material_name: str
|
||||
quantity: Decimal
|
||||
unit_cost: Decimal
|
||||
line_cost: Decimal
|
||||
|
||||
|
||||
class ProductBOMResponse(BaseModel):
|
||||
product_id: int
|
||||
product_name: str
|
||||
total_material_cost: Decimal
|
||||
items: List[ProductMaterialItemResponse]
|
||||
@@ -1,66 +0,0 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List
|
||||
from datetime import datetime, date
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
class PurchaseOrderItemCreate(BaseModel):
|
||||
product_id: int
|
||||
quantity: int = Field(..., gt=0, description="采购数量")
|
||||
unit_price: Optional[Decimal] = Field(None, description="单价(可选,不填则使用物料成本价格)")
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
class PurchaseOrderCreate(BaseModel):
|
||||
supplier_id: int
|
||||
expected_date: Optional[date] = None
|
||||
remark: Optional[str] = None
|
||||
items: List[PurchaseOrderItemCreate] = Field(min_length=1)
|
||||
|
||||
|
||||
class PurchaseOrderResponse(BaseModel):
|
||||
id: int
|
||||
order_no: str
|
||||
supplier_name: str
|
||||
order_date: datetime
|
||||
expected_date: Optional[date]
|
||||
status: str
|
||||
receipt_status: str # "pending" | "partial_received" | "received" | "cancelled"
|
||||
payment_status: str # "unpaid" | "paid"
|
||||
total_amount: Decimal
|
||||
paid_amount: Decimal
|
||||
remark: Optional[str]
|
||||
created_at: datetime
|
||||
received_date: Optional[datetime]
|
||||
paid_date: Optional[datetime]
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class PurchaseOrderItemResponse(BaseModel):
|
||||
id: int
|
||||
product_id: int
|
||||
product_sku: str
|
||||
product_name: str
|
||||
quantity: int
|
||||
received_quantity: int
|
||||
unit_price: Decimal
|
||||
amount: Decimal
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
class PurchaseOrderDetailResponse(PurchaseOrderResponse):
|
||||
supplier_id: int
|
||||
items: List[PurchaseOrderItemResponse]
|
||||
|
||||
|
||||
class PurchaseOrderReceiveItem(BaseModel):
|
||||
item_id: int
|
||||
receive_quantity: int = Field(gt=0)
|
||||
|
||||
|
||||
class PurchaseOrderReceiveRequest(BaseModel):
|
||||
warehouse_id: Optional[int] = None
|
||||
items: List[PurchaseOrderReceiveItem] = Field(min_length=1)
|
||||
remark: Optional[str] = None
|
||||
@@ -1,104 +0,0 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List
|
||||
from datetime import datetime, date
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
class SalesOrderItemCreate(BaseModel):
|
||||
product_id: Optional[int] = None
|
||||
product_sku: Optional[str] = None
|
||||
product_name: Optional[str] = None
|
||||
product_category: Optional[str] = None
|
||||
product_unit: Optional[str] = "件"
|
||||
quantity: int = Field(gt=0)
|
||||
unit_price: Decimal = Field(ge=0)
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
class SalesOrderCreate(BaseModel):
|
||||
customer_id: int
|
||||
delivery_date: Optional[date] = None
|
||||
remark: Optional[str] = None
|
||||
items: List[SalesOrderItemCreate] = Field(min_length=1)
|
||||
|
||||
|
||||
class SalesOrderResponse(BaseModel):
|
||||
id: int
|
||||
order_no: str
|
||||
customer_name: str
|
||||
order_date: datetime
|
||||
delivery_date: Optional[date]
|
||||
manufacturing_date: Optional[date]
|
||||
actual_delivery_date: Optional[datetime]
|
||||
actual_payment_date: Optional[datetime]
|
||||
status: str
|
||||
delivery_status: str # "manufacturing" | "delivered" | "cancelled"
|
||||
payment_status: str # "unpaid" | "paid"
|
||||
production_status: str
|
||||
production_no: Optional[str]
|
||||
planned_material_cost: Decimal
|
||||
actual_material_cost: Decimal
|
||||
total_amount: Decimal
|
||||
received_amount: Decimal
|
||||
remark: Optional[str]
|
||||
created_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class SalesOrderItemResponse(BaseModel):
|
||||
id: int
|
||||
product_id: int
|
||||
quantity: int
|
||||
delivered_quantity: int
|
||||
unit_price: Decimal
|
||||
amount: Decimal
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
class SalesOrderDetailResponse(SalesOrderResponse):
|
||||
customer_id: int
|
||||
items: List[SalesOrderItemResponse]
|
||||
|
||||
|
||||
class ProductionMaterialPlanItemResponse(BaseModel):
|
||||
material_id: int
|
||||
material_sku: str
|
||||
material_name: str
|
||||
required_quantity: Decimal
|
||||
available_quantity: Decimal
|
||||
shortage_quantity: Decimal
|
||||
unit_cost: Decimal
|
||||
required_cost: Decimal
|
||||
|
||||
|
||||
class SalesOrderProductionPlanResponse(BaseModel):
|
||||
sales_order_id: int
|
||||
order_no: str
|
||||
customer_name: str
|
||||
production_no: str
|
||||
planned_material_cost: Decimal
|
||||
items: List[ProductionMaterialPlanItemResponse]
|
||||
|
||||
|
||||
class SalesOrderIssueRequest(BaseModel):
|
||||
warehouse_id: int
|
||||
production_no: Optional[str] = None
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
class SalesOrderIssueResponse(BaseModel):
|
||||
sales_order_id: int
|
||||
order_no: str
|
||||
production_no: str
|
||||
movement_count: int
|
||||
planned_material_cost: Decimal
|
||||
actual_material_cost: Decimal
|
||||
cost_deviation: Decimal
|
||||
cost_deviation_rate: Decimal
|
||||
production_status: str
|
||||
|
||||
|
||||
class SalesOrderStatusUpdate(BaseModel):
|
||||
status: str
|
||||
@@ -1,31 +0,0 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
class StockMovementCreate(BaseModel):
|
||||
product_id: int
|
||||
product_sku: Optional[str] = None
|
||||
warehouse_id: int
|
||||
movement_type: str
|
||||
quantity: Decimal
|
||||
unit_price: Optional[Decimal] = None
|
||||
remark: Optional[str] = None
|
||||
|
||||
|
||||
class StockMovementResponse(BaseModel):
|
||||
id: int
|
||||
product_id: int
|
||||
product_sku: Optional[str]
|
||||
product_name: str
|
||||
movement_type: str
|
||||
quantity: Decimal
|
||||
before_quantity: Decimal
|
||||
after_quantity: Decimal
|
||||
reference_no: Optional[str]
|
||||
remark: Optional[str]
|
||||
created_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
@@ -1,24 +0,0 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class SupplierCreate(BaseModel):
|
||||
code: Optional[str] = None
|
||||
name: str
|
||||
contact_person: Optional[str] = None
|
||||
phone: Optional[str] = None
|
||||
email: Optional[str] = None
|
||||
address: Optional[str] = None
|
||||
|
||||
|
||||
class SupplierResponse(BaseModel):
|
||||
id: int
|
||||
code: Optional[str]
|
||||
name: str
|
||||
contact_person: Optional[str]
|
||||
phone: Optional[str]
|
||||
email: Optional[str]
|
||||
is_active: bool
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
@@ -1,23 +0,0 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class WarehouseCreate(BaseModel):
|
||||
code: Optional[str] = None
|
||||
name: str
|
||||
address: Optional[str] = None
|
||||
manager: Optional[str] = None
|
||||
phone: Optional[str] = None
|
||||
|
||||
|
||||
class WarehouseResponse(BaseModel):
|
||||
id: int
|
||||
code: Optional[str]
|
||||
name: str
|
||||
address: Optional[str]
|
||||
manager: Optional[str]
|
||||
is_active: bool
|
||||
is_default: bool
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user