using CMSMicroservice.Application.CityCQ.Queries.GetAllCitiesByFilter;
using CMSMicroservice.Domain.Entities.Geography;
using Mapster;

namespace CMSMicroservice.Application.Profiles;

public class CityProfile : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        config.NewConfig<City, GetAllCitiesByFilterResponseModel>()
            .Map(dest => dest.Id, src => src.Id)
            .Map(dest => dest.ExternalId, src => src.ExternalId)
            .Map(dest => dest.Name, src => src.Name)
            .Map(dest => dest.Native, src => src.Native)
            .Map(dest => dest.Latitude, src => src.Latitude)
            .Map(dest => dest.Longitude, src => src.Longitude)
            .Map(dest => dest.StateId, src => src.StateId)
            .Map(dest => dest.StateName, src => src.State.Name)
            .Map(dest => dest.StateNative, src => src.State.Native);
    }
}
