update carton and cargo type

This commit is contained in:
tzw
2025-03-12 17:49:27 +06:30
parent 05e912ea68
commit e208734dfa
32 changed files with 1141 additions and 462 deletions

View File

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