using System.Collections.Generic;
using ResponseModel = Sepehr.ApiGateway.Partners.Contracts.Hotel.Availability.V2.SearchByCityAndDate.ResponseModel;

namespace SepehrHotelApiSampleClient.Availability.SearchByCityAndDate.WinForms.ViewModels
{
    public class Hotel
    {
        public int SepehrGlobalId { get; set; }

        public string Name { get; set; }

        public List<RoomType> RoomTypeList { get; set; }

        public Hotel(ResponseModel.Hotel hotel)
        {
            SepehrGlobalId = hotel.SepehrGlobalId;
            Name = hotel.Name;
            RoomTypeList = hotel.RoomTypeList.ConvertAll(roomType => new RoomType
            {
                SepehrGlobalId = roomType.SepehrGlobalId,
                Name = roomType.Name,
                AvailableRoomCount = roomType.AvailableRoomCount,
                AdultCapacity = roomType.AdultCapacity,
                ChildCapacity = roomType.ChildCapacity,
                ChildAge = 5,
                ExtrabedCapacity = roomType.ExtrabedCapacity,
                RateDetailList = roomType.RateDetailList.ConvertAll(rateDetail => new RateDetail
                {
                    Date = rateDetail.Date,
                    Room_BoardPrice_TaxIncluded = rateDetail.Room_BoardPrice_TaxIncluded,
                    Room_NetPrice_TaxExcluded = rateDetail.Room_NetPrice_TaxExcluded,
                    Room_NetPrice_TaxIncluded = rateDetail.Room_NetPrice_TaxIncluded,
                    Extrabed_BoardPrice_TaxIncluded = rateDetail.Extrabed_BoardPrice_TaxIncluded,
                    Extrabed_NetPrice_TaxExcluded = rateDetail.Extrabed_NetPrice_TaxExcluded,
                    Extrabed_NetPrice_TaxIncluded = rateDetail.Extrabed_NetPrice_TaxIncluded,
                }),
                Hotel = this,
            });
        }
    }
}
