import 'package:hl_lieferservice/feature/cars/service/cars_service.dart';

import '../../../model/car.dart';

class CarsRepository {
  CarService service;

  CarsRepository({required this.service});

  Future<List<Car>> getAll(String teamId) async {
    return service.getCars(int.parse(teamId));
  }

  Future<void> delete(String carId, String teamId) async {
    return service.removeCar(int.parse(carId), int.parse(teamId));
  }

  Future<void> edit(String teamId, Car newCar) async {
    return service.editCar(newCar);
  }

  Future<Car> add(String teamId, String plate) async {
    return service.addCar(plate, int.parse(teamId));
  }
}