Skip to content

Commit

Permalink
TABP-176 Add FeaturedHotels response to viewmodel mappers
Browse files Browse the repository at this point in the history
  • Loading branch information
izzat5233 committed Aug 4, 2024
1 parent ad56890 commit 2a75ed3
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using AutoMapper;
using TravelAccommodationBookingPlatform.Application.Hotels.Commands.CreateHotel;
using TravelAccommodationBookingPlatform.Application.Hotels.Queries.FeaturedHotels;
using TravelAccommodationBookingPlatform.Application.Hotels.Queries.HotelSearch;
using TravelAccommodationBookingPlatform.Presentation.Hotels.Requests;
using TravelAccommodationBookingPlatform.Presentation.Hotels.ViewModels;
Expand All @@ -19,5 +20,15 @@ public HotelProfile()
.IncludeMembers(src => src.HotelSummary);
CreateMap<HotelSearchResponse.AvailableFiltersResult, HotelSearchViewModel.AvailableFiltersResult>();
CreateMap<HotelSearchResponse, HotelSearchViewModel>();

// FeaturedHotels
CreateMap<FeaturedHotelsResponse.FeaturedHotelSummary, FeaturedHotelsViewModel.FeaturedHotelResult>();
CreateMap<FeaturedHotelsResponse.FeaturedDealResult, FeaturedHotelsViewModel.PriceDeal>()
.ForMember(dest => dest.Minimum, opt => opt.MapFrom(src => src.MinimumPriceDeal))
.ForMember(dest => dest.Maximum, opt => opt.MapFrom(src => src.MaximumPriceDeal));
CreateMap<FeaturedHotelsResponse.FeaturedDealResult, FeaturedHotelsViewModel.FeaturedHotelResult>()
.IncludeMembers(src => src.Hotel)
.ForMember(dest => dest.PriceDeal, opt => opt.MapFrom(src => src));
CreateMap<FeaturedHotelsResponse, FeaturedHotelsViewModel>();
}
}

0 comments on commit 2a75ed3

Please sign in to comment.