入库操作

This commit is contained in:
dxc
2026-01-26 13:35:30 +08:00
parent 0081e7682d
commit 65d9e89c9a
33 changed files with 193 additions and 0 deletions

0
app/schemas/__init__.py Normal file
View File

View File

View File

@ -0,0 +1,14 @@
from app.extensions import ma
from app.models.stock import StockBuy
from marshmallow import fields
class StockBuySchema(ma.SQLAlchemyAutoSchema):
class Meta:
model = StockBuy
load_instance = True # 反序列化时自动创建模型实例
include_fk = True # 包含外键 material_id
# 必须字段校验
material_id = fields.Integer(required=True)
qty_inbound = fields.Decimal(required=True, as_string=True)
price_unit = fields.Decimal(missing=0, as_string=True)

View File

View File