update carton and cargo type
This commit is contained in:
@@ -145,4 +145,33 @@ class PackageSelectionModel extends BaseModel {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
Future<List<Package>> getActivePackages(
|
||||
{required String shipmentId,
|
||||
required String senderId,
|
||||
required String consigneeId}) async {
|
||||
List<Package> list = [];
|
||||
try {
|
||||
String path = "/$packages_collection";
|
||||
|
||||
var snaps = await FirebaseFirestore.instance
|
||||
.collection(path)
|
||||
.where("status",
|
||||
whereIn: [package_processed_status, package_packed_status])
|
||||
.where("sender_id", isEqualTo: senderId)
|
||||
.where("user_id", isEqualTo: consigneeId)
|
||||
// .where("fcs_shipment_id", isEqualTo: shipmentId)
|
||||
.where("is_deleted", isEqualTo: false)
|
||||
.orderBy("created_date", descending: true)
|
||||
.get(const GetOptions(source: Source.server));
|
||||
list = snaps.docs
|
||||
.map((documentSnapshot) =>
|
||||
Package.fromMap(documentSnapshot.data(), documentSnapshot.id))
|
||||
.toList();
|
||||
} catch (e) {
|
||||
log.warning("Error!! $e");
|
||||
list = [];
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user