Files
fcs/lib/data/provider/fcs_shipment_data_provider.dart
2020-10-19 05:13:49 +06:30

29 lines
1.0 KiB
Dart

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 {
return await requestAPI("/fcs_shipments", "POST",
payload: fcsShipment.toMap(), token: await getToken());
}
Future<void> updateFcsShipment(FcsShipment fcsShipment) async {
return await requestAPI("/fcs_shipments", "PUT",
payload: fcsShipment.toMap(), token: await getToken());
}
Future<void> deleteFcsShipment(FcsShipment fcsShipment) async {
return await requestAPI("/fcs_shipments", "DELETE",
payload: fcsShipment.toMap(), token: await getToken());
}
Future<void> ship(FcsShipment fcsShipment) async {
return await requestAPI("/fcs_shipments/ship", "PUT",
payload: fcsShipment.toMap(), token: await getToken());
}
}