This commit is contained in:
2020-12-03 08:26:58 +06:30
parent c79fab4cc7
commit 57e08502b7
44 changed files with 2631 additions and 419 deletions

View File

@@ -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 {

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

View File

@@ -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);

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