aaa
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// Product stage entity - pure domain model
|
||||
/// Represents a product at a specific production stage with quantities
|
||||
class ProductStageEntity extends Equatable {
|
||||
final int productId;
|
||||
final int? productStageId;
|
||||
final int? actionTypeId;
|
||||
final int passedQuantity;
|
||||
final int issuedQuantity;
|
||||
final double issuedQuantityWeight;
|
||||
final double passedQuantityWeight;
|
||||
final String? stageName;
|
||||
final String createdDate;
|
||||
|
||||
const ProductStageEntity({
|
||||
required this.productId,
|
||||
required this.productStageId,
|
||||
required this.actionTypeId,
|
||||
required this.passedQuantity,
|
||||
required this.issuedQuantity,
|
||||
required this.issuedQuantityWeight,
|
||||
required this.passedQuantityWeight,
|
||||
required this.stageName,
|
||||
required this.createdDate,
|
||||
});
|
||||
|
||||
/// Get display name for the stage
|
||||
/// Returns "No Stage" if stageName is null
|
||||
String get displayName => stageName ?? 'No Stage';
|
||||
|
||||
/// Check if this is a valid stage (has a stage name)
|
||||
bool get hasStage => stageName != null && stageName!.isNotEmpty;
|
||||
|
||||
/// Check if this stage has any passed quantity
|
||||
bool get hasPassedQuantity => passedQuantity > 0;
|
||||
|
||||
/// Check if this stage has any issued quantity
|
||||
bool get hasIssuedQuantity => issuedQuantity > 0;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
productId,
|
||||
productStageId,
|
||||
actionTypeId,
|
||||
passedQuantity,
|
||||
issuedQuantity,
|
||||
issuedQuantityWeight,
|
||||
passedQuantityWeight,
|
||||
stageName,
|
||||
createdDate,
|
||||
];
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProductStageEntity(productId: $productId, stageName: $stageName, passedQuantity: $passedQuantity)';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user