using CafeCritic.Models;
using CafeCritic.ViewModels;

namespace CafeCritic.Mappers;

public class CafeMapper
{
    public static Cafe AddCafeCafe(AddCafeViewModel vm, string image)
    {
        return new Cafe
        {
            Title = vm.Title,
            Image = image,
            Description = vm.Description
        };
    }
    
    public static CafeViewModel CafeCafeVm(Cafe cafe)
    {
        return new CafeViewModel
        {
            Id = cafe.Id,
            Title = cafe.Title,
            Image = cafe.Image,
            Description = cafe.Description
        };
    }

    public static CafeDetailViewModel CafeCafeDetailViewModel(Cafe cafe)
    {
        return new CafeDetailViewModel
        {
            Id = cafe.Id,
            Title = cafe.Title,
            Image = cafe.Image,
            Description = cafe.Description,
            Gallery = cafe.Gallery,
            Reviews = cafe.Reviews
        };
    }
}