27 lines
754 B
C#
27 lines
754 B
C#
namespace MyOffice.Web.Models.Motion;
|
|
|
|
using AutoMapper;
|
|
using MyOffice.Services.Account.Domain;
|
|
|
|
public class MotionViewModel : BaseViewModel
|
|
{
|
|
public string Id { get; set; } = null!;
|
|
public DateTime Date { get; set; }
|
|
public string AccountId { get; set; } = null!;
|
|
public string Item { get; set; } = null!;
|
|
public string? Description { get; set; }
|
|
public decimal Plus { get; set; }
|
|
public decimal Minus { get; set; }
|
|
}
|
|
|
|
public class MotionViewModelProfile : Profile
|
|
{
|
|
public MotionViewModelProfile()
|
|
{
|
|
CreateMap<MotionDto, MotionViewModel>()
|
|
.ForMember(x => x.Item, x => x.MapFrom(m => m.Item.Name))
|
|
.ForMember(x => x.Minus, x => x.MapFrom(m => m.AmountMinus))
|
|
.ForMember(x => x.Plus, x => x.MapFrom(m => m.AmountPlus))
|
|
;
|
|
}
|
|
} |