This commit is contained in:
2023-07-25 22:10:03 +03:00
parent ce2ae68c9f
commit 5ecefe5756
30 changed files with 2321 additions and 123 deletions
@@ -0,0 +1,20 @@
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))
;
}
}
+4 -18
View File
@@ -1,27 +1,13 @@
namespace MyOffice.Web.Models.Motion;
using MyOffice.Services.Account.Domain;
public class MotionRequest
{
public DateTime Date { get; set; }
public string Item { get; set; } = null!;
public string? ItemId { get; set; } = null!;
public string? AccountId { get; set; } = null!;
public string? Description { get; set; }
public decimal? Plus { get; set; }
public decimal? Minus { get; set; }
}
public static class MotionRequestExtension
{
public static MotionAddUpdate FromModel(this MotionRequest input)
{
return new MotionAddUpdate
{
Date = input.Date,
Item = input.Item,
Minus = input.Minus ?? 0,
Plus = input.Plus ?? 0,
Description = input.Description,
};
}
}
public decimal? AmountBalancing { get; set; }
}
@@ -7,6 +7,7 @@
{
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; }