add fcs shipment in processing,update cargo types for carton
This commit is contained in:
@@ -37,7 +37,8 @@ class CustomerModel extends BaseModel {
|
||||
rowPerLoad: 30);
|
||||
}
|
||||
|
||||
Future<User> getUser(String? id) async {
|
||||
Future<User?> getUser(String? id) async {
|
||||
if (id == null) return null;
|
||||
String path = "/$user_collection";
|
||||
var snap = await FirebaseFirestore.instance.collection(path).doc(id).get();
|
||||
return User.fromMap(snap.data() as Map<String, dynamic>, snap.id);
|
||||
@@ -76,4 +77,20 @@ class CustomerModel extends BaseModel {
|
||||
Future<void> acceptRequest(String userID) {
|
||||
return Services.instance.userService.acceptRequest(userID);
|
||||
}
|
||||
|
||||
Future<User?> getUserByFCSId(String? fcsID) async {
|
||||
if (fcsID == null) return null;
|
||||
String path = "/$user_collection";
|
||||
var snap = await FirebaseFirestore.instance
|
||||
.collection(path)
|
||||
.where('fcs_id', isEqualTo: fcsID)
|
||||
.limit(1)
|
||||
.get();
|
||||
|
||||
if (snap.docs.isNotEmpty) {
|
||||
return User.fromMap(snap.docs.first.data(), snap.docs.first.id);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user