namespace MyOffice.Web.Models.Motion;

using AutoMapper;
using Data.Models.Accounts;
using Services.Account.Domain;

public class AccountControllerProfile : Profile
{
	public AccountControllerProfile()
	{
		CreateMap<MotionRequest, MotionAddUpdate>();

		CreateMap<Motion, MotionViewModel>()
			.ForMember(x => x.Date, o => o.MapFrom(x => x.DateTime))
			.ForMember(x => x.Item, o => o.MapFrom(x => x.Item.ItemGlobal.Name))
			.ForMember(x => x.Plus, o => o.MapFrom(x => x.AmountPlus))
			.ForMember(x => x.Minus, o => o.MapFrom(x => x.AmountMinus))
			;
	}
}