<gh_stars>0using System;
using AutoMapper;

namespace ServerlessApp
{
    public class MappingProfile : Profile
    {
        public MappingProfile()
        {
            // Console.WriteLine("Sample debug output");
            /* TODO: Register mappings */

            CreateMap<FunctionRequest, LegacySystemRequest>()
                    .ForMember(dest =>
                        dest.Id,
                        opt => opt.MapFrom(src => src.Reference));

            CreateMap<LegacySystemResponse, FunctionResponse>()
                    .ForMember(dest =>
                        dest.CreatedAt,
                        opt => opt.MapFrom(src => src.Timestamp))
                    .ForMember(dest =>
                        dest.Success,
                        opt => opt.MapFrom(src => src.ErrorCode == 0? true:false));
        }
    }
}
/*
These classes are already defined in the project within 'ServerlessApp' namespace. Please do not uncomment it!

Code snippets:

public class FunctionRequest
{
    public string CorrelationId { get; set; }
    public string Reference { get; set; }
}

public class LegacySystemRequest
{
    public string CorrelationId { get; set; }
    public string Id { get; set; }
}

public class FunctionResponse
{
    public bool Success { get; set; }
    public string Message { get; set; }
    public DateTime CreatedAt { get; set; }
}

public class LegacySystemResponse
{
    public int ErrorCode { get; set; }
    public string Message { get; set; }
    public DateTime Timestamp { get; set; }
}
*/
