clean up
This commit is contained in:
72
lib/domain/entities/box.dart
Normal file
72
lib/domain/entities/box.dart
Normal file
@@ -0,0 +1,72 @@
|
||||
import 'package:fcs/domain/vo/shipment_status.dart';
|
||||
import 'package:fcs/domain/vo/shipping_address.dart';
|
||||
|
||||
import 'cargo.dart';
|
||||
import 'package.dart';
|
||||
|
||||
class Box {
|
||||
String id;
|
||||
String shipmentNumber;
|
||||
String senderFCSID;
|
||||
String senderName;
|
||||
String receiverFCSID;
|
||||
String receiverName;
|
||||
String receiverAddress;
|
||||
String receiverNumber;
|
||||
String boxNumber;
|
||||
String status;
|
||||
String cargoDesc;
|
||||
int width;
|
||||
int height;
|
||||
int length;
|
||||
int shipmentWeight;
|
||||
|
||||
int rate;
|
||||
int weight;
|
||||
String packageType;
|
||||
String pickUpID;
|
||||
List<String> photos;
|
||||
String remark;
|
||||
DateTime arrivedDate;
|
||||
|
||||
List<Package> packages;
|
||||
|
||||
List<Cargo> cargoTypes;
|
||||
|
||||
ShippingAddress shippingAddress;
|
||||
|
||||
int get amount => rate != null && weight != null ? rate * weight : 0;
|
||||
|
||||
String get packageNumber =>
|
||||
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
|
||||
double get price => rate.toDouble() * weight;
|
||||
|
||||
List<ShipmentStatus> shipmentHistory;
|
||||
|
||||
Box(
|
||||
{this.id,
|
||||
this.shipmentNumber,
|
||||
this.senderFCSID,
|
||||
this.senderName,
|
||||
this.receiverFCSID,
|
||||
this.receiverName,
|
||||
this.receiverNumber,
|
||||
this.receiverAddress,
|
||||
this.boxNumber,
|
||||
this.width,
|
||||
this.height,
|
||||
this.length,
|
||||
this.shipmentWeight,
|
||||
this.rate,
|
||||
this.weight,
|
||||
this.packageType,
|
||||
this.pickUpID,
|
||||
this.remark,
|
||||
this.status,
|
||||
this.arrivedDate,
|
||||
this.cargoDesc,
|
||||
this.shipmentHistory,
|
||||
this.packages,
|
||||
this.cargoTypes,
|
||||
this.shippingAddress});
|
||||
}
|
||||
Reference in New Issue
Block a user