using Exam.Models;
using Exam.Repositories;

namespace Exam.Services
{
    public class Service : IService
    {
        private readonly IRepository _repository;
        
        public Service(IRepository repository)
        {
            _repository = repository;
        }

        public int AddReservavtion(Reservation flight)
        {
            return _repository.AddReservavtion(flight);
        }

        public bool RemoveReservavtions(List<int> ids)
        {
            return _repository.RemoveReservavtions(ids);
        }

        public List<Flight> ShowFlightsByDateAndCity(DateTime date, string city)
        {
            return _repository.ShowFlightsByDateAndCity(date, city);
        }

        public List<Hotel> ShowHotelsByDateAndCity(DateTime date, string city)
        {
            return _repository.ShowHotelsByDateAndCity(date, city);
        }

        public void DecrementFlightSeats(int id)
        {
            _repository.DecrementFlightSeats(id);
        }
        public void DecrementHotelRooms(int id)
        {
            _repository.DecrementHotelRooms(id);
        }
    }
}
