import 'package:fcs/data/provider/rate_data_provider.dart';
import 'package:fcs/domain/entities/cargo_type.dart';
import 'package:fcs/domain/entities/connectivity.dart';
import 'package:fcs/domain/entities/discount_by_weight.dart';
import 'package:fcs/domain/entities/custom_duty.dart';
import 'package:fcs/domain/entities/rate.dart';
import 'package:flutter/material.dart';

import 'rate_service.dart';

class RateServiceImp implements RateService {
  RateServiceImp({
    @required this.rateDataProvider,
    @required this.connectivity,
  });

  final Connectivity connectivity;
  final RateDataProvider rateDataProvider;

  @override
  Stream<Rate> getRateStream() {
    return rateDataProvider.rate();
  }

  @override
  Future<void> createCargoType(CargoType cargoType) {
    return rateDataProvider.createCargoType(cargoType);
  }

  @override
  Future<void> createCustomDuty(CustomDuty customDuty) {
    return rateDataProvider.createCustomDuty(customDuty);
  }

  @override
  Future<void> createDiscountByWeight(DiscountByWeight discountByWeight) {
    return rateDataProvider.createDiscountByWeight(discountByWeight);
  }

  @override
  Future<void> deleteCargoType(String id) {
    return rateDataProvider.deleteCargoType(id);
  }

  @override
  Future<void> deleteCustomDuty(String id) {
    return rateDataProvider.deleteCustomDuty(id);
  }

  @override
  Future<void> deleteDiscountByWeight(String id) {
    return rateDataProvider.deleteDiscountByWeight(id);
  }

  @override
  Future<void> updateCargoType(CargoType cargoType) {
    return rateDataProvider.updateCargoType(cargoType);
  }

  @override
  Future<void> updateCustomDuty(CustomDuty customDuty) {
    return rateDataProvider.updateCustomDuty(customDuty);
  }

  @override
  Future<void> updateDiscountByWeight(DiscountByWeight discountByWeight) {
    return rateDataProvider.updateDiscountByWeight(discountByWeight);
  }

  @override
  Future<void> updateRate(Rate rate) {
    return rateDataProvider.updateRates(rate);
  }
}
