提取修改猪群数量逻辑
This commit is contained in:
@@ -24,6 +24,8 @@ var (
|
||||
ErrPenNotFound = errors.New("指定的猪栏不存在")
|
||||
// ErrPenNotAssociatedWithBatch 表示猪栏未与该批次关联
|
||||
ErrPenNotAssociatedWithBatch = errors.New("猪栏未与该批次关联")
|
||||
// ErrInvalidOperation 非法操作
|
||||
ErrInvalidOperation = errors.New("非法操作")
|
||||
)
|
||||
|
||||
// --- 领域服务接口 ---
|
||||
@@ -51,4 +53,6 @@ type PigBatchService interface {
|
||||
SellPigs(batchID uint, quantity int, unitPrice float64, tatalPrice float64, traderName string, tradeDate time.Time, remarks string, operatorID uint) error
|
||||
// BuyPigs 处理买猪的业务逻辑。
|
||||
BuyPigs(batchID uint, quantity int, unitPrice float64, tatalPrice float64, traderName string, tradeDate time.Time, remarks string, operatorID uint) error
|
||||
|
||||
UpdatePigBatchQuantity(operatorID uint, batchID uint, changeType models.LogChangeType, changeAmount int, changeReason string, happenedAt time.Time) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user