using System;
using System.Collections.Generic;

using skydiveLogs_api.Business.Interfaces;
using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainService.Repositories;


namespace skydiveLogs_api.Business
{
    public class UserImageService : IUserImageService
    {
        public UserImageService(IUserImageRepository imageRepository)
        {
            _imageRepository = imageRepository;
        }

        public void AddNewImage(UserImage newImage, User connectedUser)
        {
            newImage.User = connectedUser;
            _imageRepository.Add(newImage);
        }

        public void DeleteImageById(int id)
        {
            throw new NotImplementedException();
        }

        public UserImage GetImageById(int id)
        {
            return _imageRepository.GetById(id);
        }

        public IEnumerable<UserImage> GetAllImages(User connectedUser)
        {
            return _imageRepository.GetAll(connectedUser);
        }

        public void UpdateImage(int id, UserImage Image)
        {
            throw new NotImplementedException();
        }

        private readonly IUserImageRepository _imageRepository;
    }
}
