Merge branch 'master' of https://git.mokkon.com/sainw/fcs
This commit is contained in:
@@ -3,6 +3,7 @@ class CargoType {
|
||||
String name;
|
||||
double rate;
|
||||
double weight;
|
||||
bool isChecked;
|
||||
|
||||
double get calAmount => (calRate ?? 0) * (calWeight ?? 0);
|
||||
|
||||
@@ -19,13 +20,15 @@ class CargoType {
|
||||
calRate: map['cal_rate']?.toDouble() ?? 0,
|
||||
);
|
||||
}
|
||||
CargoType(
|
||||
{this.id,
|
||||
this.name,
|
||||
this.rate,
|
||||
this.weight,
|
||||
this.calWeight,
|
||||
this.calRate});
|
||||
CargoType({
|
||||
this.id,
|
||||
this.name,
|
||||
this.rate,
|
||||
this.weight,
|
||||
this.calWeight,
|
||||
this.calRate,
|
||||
this.isChecked = false,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
|
||||
8
lib/domain/entities/carton_size.dart
Normal file
8
lib/domain/entities/carton_size.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
class CartonSize {
|
||||
String id;
|
||||
String name;
|
||||
double length;
|
||||
double width;
|
||||
double height;
|
||||
CartonSize({this.id, this.name, this.length, this.width, this.height});
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:fcs/domain/vo/delivery_address.dart';
|
||||
import 'package:fcs/domain/vo/shipment_status.dart';
|
||||
@@ -36,42 +38,47 @@ class Package {
|
||||
DateTime arrivedDate;
|
||||
DeliveryAddress deliveryAddress;
|
||||
|
||||
//for packages in processing
|
||||
List<File> photoFiles;
|
||||
|
||||
int get amount => rate != null && weight != null ? rate * weight : 0;
|
||||
|
||||
String get packageNumber =>
|
||||
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
|
||||
double get price => rate.toDouble() * weight;
|
||||
|
||||
Package(
|
||||
{this.id,
|
||||
this.trackingID,
|
||||
this.userID,
|
||||
this.userName,
|
||||
this.fcsID,
|
||||
this.phoneNumber,
|
||||
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,
|
||||
this.currentStatusDate,
|
||||
this.photoUrls,
|
||||
this.desc,
|
||||
this.deliveryAddress,
|
||||
this.isChecked = false});
|
||||
Package({
|
||||
this.id,
|
||||
this.trackingID,
|
||||
this.userID,
|
||||
this.userName,
|
||||
this.fcsID,
|
||||
this.phoneNumber,
|
||||
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,
|
||||
this.currentStatusDate,
|
||||
this.photoUrls,
|
||||
this.desc,
|
||||
this.deliveryAddress,
|
||||
this.isChecked = false,
|
||||
this.photoFiles,
|
||||
});
|
||||
|
||||
factory Package.fromMap(Map<String, dynamic> map, String docID) {
|
||||
var _currentStatusDate = (map['status_date'] as Timestamp);
|
||||
|
||||
36
lib/domain/entities/processing.dart
Normal file
36
lib/domain/entities/processing.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
|
||||
class Processing {
|
||||
String id;
|
||||
//for consignee
|
||||
String userID;
|
||||
String userName;
|
||||
String userPhoneNumber;
|
||||
//for shipper
|
||||
String fcsID;
|
||||
String shipperName;
|
||||
String shipperPhoneNumber;
|
||||
|
||||
List<Package> packages;
|
||||
|
||||
Processing(
|
||||
{this.id,
|
||||
this.userID,
|
||||
this.userName,
|
||||
this.userPhoneNumber,
|
||||
this.fcsID,
|
||||
this.shipperName,
|
||||
this.shipperPhoneNumber,
|
||||
this.packages});
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => other is Processing && other.id == id;
|
||||
|
||||
@override
|
||||
int get hashCode => id.hashCode;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Processing{id: $id}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user