diff --git a/internal/infra/models/pig.go b/internal/infra/models/pig.go index 037b507..8042528 100644 --- a/internal/infra/models/pig.go +++ b/internal/infra/models/pig.go @@ -45,6 +45,11 @@ func (PigBatch) TableName() string { return "pig_batches" } +// IsActive 判断猪批次是否处于活跃状态 +func (pb PigBatch) IsActive() bool { + return pb.Status != BatchStatusSold && pb.Status != BatchStatusArchived +} + // LogChangeType 定义了猪批次数量变更的类型 type LogChangeType string