update cargo type input, add package count and carton count for shipment info
This commit is contained in:
@@ -314,4 +314,30 @@ class FcsShipmentModel extends BaseModel {
|
||||
}
|
||||
return fcsShipments;
|
||||
}
|
||||
|
||||
Future<int?> getPackageCount({required String fcsShipmentId}) async {
|
||||
String path = "/$packages_collection";
|
||||
|
||||
AggregateQuerySnapshot query = await FirebaseFirestore.instance
|
||||
.collection(path)
|
||||
.where("fcs_shipment_id", isEqualTo: fcsShipmentId)
|
||||
.where("delete_time", isEqualTo: 0)
|
||||
.count()
|
||||
.get();
|
||||
|
||||
return query.count;
|
||||
}
|
||||
|
||||
Future<int?> getCartonCount({required String fcsShipmentId}) async {
|
||||
String path = "/$cartons_collection";
|
||||
|
||||
AggregateQuerySnapshot query = await FirebaseFirestore.instance
|
||||
.collection(path)
|
||||
.where("fcs_shipment_id", isEqualTo: fcsShipmentId)
|
||||
.where("delete_time", isEqualTo: 0)
|
||||
.count()
|
||||
.get();
|
||||
|
||||
return query.count;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user