//
// Copyright (c) alveus.dev. All rights reserved. Licensed under the MIT License.
//
using Astral.Core.Entities;
using Astral.Services.Dtos;
using AutoMapper;
namespace Astral.Services.Profiles;
///
/// Profile for AutoMapper.
///
public class AutomapperProfile : Profile
{
///
/// Initializes a new instance of the class.
///
public AutomapperProfile()
{
CreateMap()
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.RegistrationDate, opt => opt.MapFrom(src => src.CreatedAt))
.ForMember(dest => dest.RegistrationDateTicks, opt => opt.MapFrom(src => src.CreatedAt.Ticks))
.ForMember(dest => dest.UserRole, opt => opt.MapFrom(src => src.Role.ToString()));
CreateMap()
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.CreationDate, opt => opt.MapFrom(src => src.CreatedAt))
.ForMember(dest => dest.CreationDateTicks, opt => opt.MapFrom(src => src.CreatedAt.Ticks))
.ForMember(dest => dest.Title, opt => opt.MapFrom(src => src.Title))
.ForMember(dest => dest.Description, opt => opt.MapFrom(src => src.Description))
.ForMember(dest => dest.Internal, opt => opt.MapFrom(src => src.Internal));
}
}