add fcs shipment service

This commit is contained in:
Sai Naw Wun
2020-10-07 17:22:01 +06:30
parent 897e5c9b93
commit a0569a0986
5 changed files with 88 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
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());
}
}