import 'package:fcs/domain/entities/fcs_shipment.dart';
import 'package:fcs/domain/vo/delivery_address.dart';
import 'package:fcs/helpers/api_helper.dart';
import 'package:fcs/helpers/firebase_helper.dart';
import 'package:logging/logging.dart';

class DeliveryAddressDataProvider {
  final log = Logger('DeliveryAddressDataProvider');

  Future<void> createDeliveryAddress(DeliveryAddress deliveryAddress) async {
    return await requestAPI("/delivery_address", "POST",
        payload: deliveryAddress.toMap(), token: await getToken());
  }

  Future<void> updateDeliveryAddress(DeliveryAddress deliveryAddress) async {
    return await requestAPI("/delivery_address", "PUT",
        payload: deliveryAddress.toMap(), token: await getToken());
  }

  Future<void> deleteDeliveryAddress(DeliveryAddress deliveryAddress) async {
    return await requestAPI("/delivery_address", "DELETE",
        payload: deliveryAddress.toMap(), token: await getToken());
  }

  Future<void> selectDefalutDeliveryAddress(
      DeliveryAddress deliveryAddress) async {
    return await requestAPI("/delivery_address/defalut", "PUT",
        payload: deliveryAddress.toMap(), token: await getToken());
  }
}
