2020-10-07 17:22:01 +06:30
|
|
|
import 'package:fcs/domain/entities/fcs_shipment.dart';
|
|
|
|
|
import 'package:fcs/helpers/api_helper.dart';
|
|
|
|
|
import 'package:fcs/helpers/firebase_helper.dart';
|
|
|
|
|
import 'package:logging/logging.dart';
|
|
|
|
|
|
|
|
|
|
class FcsShipmentDataProvider {
|
|
|
|
|
final log = Logger('FcsShipmentDataProvider');
|
|
|
|
|
|
|
|
|
|
Future<void> createFcsShipment(FcsShipment fcsShipment) async {
|
2024-03-01 17:33:14 +06:30
|
|
|
return await requestAPI("/fcs_shipments", "POST",
|
2020-10-07 17:22:01 +06:30
|
|
|
payload: fcsShipment.toMap(), token: await getToken());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> updateFcsShipment(FcsShipment fcsShipment) async {
|
2024-03-01 17:33:14 +06:30
|
|
|
return await requestAPI("/fcs_shipments", "PUT",
|
2020-10-07 17:22:01 +06:30
|
|
|
payload: fcsShipment.toMap(), token: await getToken());
|
|
|
|
|
}
|
2020-10-19 05:13:49 +06:30
|
|
|
|
2020-10-28 05:11:06 +06:30
|
|
|
Future<String> reportFcsShipment(FcsShipment fcsShipment) async {
|
|
|
|
|
dynamic data = await requestAPI("/fcs_shipments/report", "POST",
|
|
|
|
|
payload: fcsShipment.toMap(), token: await getToken());
|
|
|
|
|
return data["url"];
|
|
|
|
|
}
|
2024-02-21 17:05:20 +06:30
|
|
|
|
2024-09-22 16:49:59 +06:30
|
|
|
Future<void> updateFcsShipmentStatus(String id, String status) async {
|
|
|
|
|
return await requestAPI("/fcs_shipments/status", "PUT",
|
|
|
|
|
payload: {"id": id, "status": status}, token: await getToken());
|
2024-02-21 17:05:20 +06:30
|
|
|
}
|
2020-10-07 17:22:01 +06:30
|
|
|
}
|