add barcode scan
This commit is contained in:
61
lib/fcs/common/domain/entities/package.dart
Normal file
61
lib/fcs/common/domain/entities/package.dart
Normal file
@@ -0,0 +1,61 @@
|
||||
import 'package:fcs/fcs/common/domain/vo/shipment_status.dart';
|
||||
|
||||
class Package {
|
||||
String id;
|
||||
String trackingID;
|
||||
String userID;
|
||||
String userName;
|
||||
String phoneNumber;
|
||||
String status;
|
||||
|
||||
String shipmentNumber;
|
||||
String senderFCSID;
|
||||
String senderName;
|
||||
String receiverFCSID;
|
||||
String receiverName;
|
||||
String receiverAddress;
|
||||
String receiverNumber;
|
||||
String boxNumber;
|
||||
String cargoDesc;
|
||||
String market;
|
||||
|
||||
int rate;
|
||||
int weight;
|
||||
String packageType;
|
||||
String pickUpID;
|
||||
List<String> photos;
|
||||
String remark;
|
||||
DateTime arrivedDate;
|
||||
|
||||
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;
|
||||
|
||||
Package({
|
||||
this.id,
|
||||
this.trackingID,
|
||||
this.userID,
|
||||
this.shipmentNumber,
|
||||
this.senderFCSID,
|
||||
this.senderName,
|
||||
this.receiverFCSID,
|
||||
this.receiverName,
|
||||
this.receiverNumber,
|
||||
this.receiverAddress,
|
||||
this.boxNumber,
|
||||
this.rate,
|
||||
this.weight,
|
||||
this.packageType,
|
||||
this.pickUpID,
|
||||
this.remark,
|
||||
this.status,
|
||||
this.arrivedDate,
|
||||
this.cargoDesc,
|
||||
this.market,
|
||||
this.shipmentHistory,
|
||||
});
|
||||
}
|
||||
25
lib/fcs/common/domain/entities/shipment.dart
Normal file
25
lib/fcs/common/domain/entities/shipment.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
class Shipment {
|
||||
DateTime shipDate;
|
||||
String shipmentNumber;
|
||||
DateTime cutoffDate;
|
||||
String shipType;
|
||||
DateTime arrivalDate;
|
||||
DateTime departureDate;
|
||||
String consignee;
|
||||
String port;
|
||||
String destination;
|
||||
String status;
|
||||
String remark;
|
||||
Shipment(
|
||||
{this.shipDate,
|
||||
this.shipmentNumber,
|
||||
this.cutoffDate,
|
||||
this.shipType,
|
||||
this.status,
|
||||
this.arrivalDate,
|
||||
this.departureDate,
|
||||
this.consignee,
|
||||
this.port,
|
||||
this.destination,
|
||||
this.remark});
|
||||
}
|
||||
@@ -29,6 +29,7 @@ class User {
|
||||
return User(
|
||||
id: json['id'],
|
||||
name: json['user_name'],
|
||||
fcsID: json['fcs_id'],
|
||||
phoneNumber: json['phone_number'],
|
||||
status: json['status'],
|
||||
);
|
||||
@@ -90,6 +91,12 @@ class User {
|
||||
(privileges != null ? privileges.contains('sp') : false);
|
||||
}
|
||||
|
||||
bool hasPackages() {
|
||||
return hasSysAdmin() ||
|
||||
hasAdmin() ||
|
||||
(privileges != null ? privileges.contains('p') : false);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'User{name: $name, phoneNumber: $phoneNumber,status:$status}';
|
||||
|
||||
6
lib/fcs/common/domain/vo/shipment_status.dart
Normal file
6
lib/fcs/common/domain/vo/shipment_status.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
class ShipmentStatus {
|
||||
String status;
|
||||
DateTime date;
|
||||
bool done;
|
||||
ShipmentStatus({this.status, this.date, this.done});
|
||||
}
|
||||
15
lib/fcs/common/domain/vo/shipping_address.dart
Normal file
15
lib/fcs/common/domain/vo/shipping_address.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
class ShippingAddress {
|
||||
String fullName;
|
||||
String addressLine1;
|
||||
String addressLine2;
|
||||
String city;
|
||||
String state;
|
||||
String phoneNumber;
|
||||
ShippingAddress(
|
||||
{this.fullName,
|
||||
this.addressLine1,
|
||||
this.addressLine2,
|
||||
this.city,
|
||||
this.state,
|
||||
this.phoneNumber});
|
||||
}
|
||||
Reference in New Issue
Block a user