add barcode scan

This commit is contained in:
Sai Naw Wun
2020-09-15 07:13:41 +06:30
parent eccea7ee02
commit ad527409ec
61 changed files with 4387 additions and 488 deletions

View 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,
});
}

View 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});
}

View File

@@ -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}';

View File

@@ -0,0 +1,6 @@
class ShipmentStatus {
String status;
DateTime date;
bool done;
ShipmentStatus({this.status, this.date, this.done});
}

View 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});
}