fix
This commit is contained in:
@@ -1,22 +1,7 @@
|
||||
namespace MyOffice.Web.Models.Account;
|
||||
|
||||
using Data.Models.Accounts;
|
||||
using Services.Account.Domain;
|
||||
|
||||
public class AccountDetailedViewModel
|
||||
public class AccountDetailedViewModel: BaseViewModel
|
||||
{
|
||||
public AccountViewModel Account { get; set; } = null!;
|
||||
public decimal Rest { get; set; }
|
||||
}
|
||||
|
||||
/*public static class AccountDetailedViewModelExtensions
|
||||
{
|
||||
public static AccountDetailedViewModel ToModel(this AccountDetailedDto input)
|
||||
{
|
||||
return new AccountDetailedViewModel
|
||||
{
|
||||
Account = input.Account.ToModel(),
|
||||
Rest = input.Rest,
|
||||
};
|
||||
}
|
||||
}*/
|
||||
@@ -1,7 +1,12 @@
|
||||
namespace MyOffice.Web.Models.Account;
|
||||
|
||||
using AutoMapper;
|
||||
|
||||
using MyOffice.Services.Currency.Domain;
|
||||
using MyOffice.Services.Identity;
|
||||
using Currency;
|
||||
using Item;
|
||||
using Motion;
|
||||
using Services.Account.Domain;
|
||||
using User;
|
||||
|
||||
@@ -67,5 +72,35 @@ public class AccountViewModelProfile : Profile
|
||||
CreateMap<AccountAccessInviteDto, AccountAccessInviteViewModel>()
|
||||
.ForMember(x => x.AllowWrite, o => o.MapFrom(x => x.IsAllowWrite))
|
||||
;
|
||||
|
||||
CreateMap<MotionDto, MotionViewModel>()
|
||||
;
|
||||
|
||||
CreateMap<ItemDto, ItemViewModel>()
|
||||
.ForMember(x => x.Category, o => o.MapFrom(x => x.Category!.Name))
|
||||
;
|
||||
|
||||
CreateMap<ItemCategoryDto, ItemCategoryViewModel>()
|
||||
.ForMember(x => x.Internal, o => o.MapFrom(x => x.IsInternal))
|
||||
.ForMember(x => x.AllowDelete, o => o.MapFrom(x => !x.Items.Any() && x.Id != x.UserId))
|
||||
.ForMember(x => x.SortOrder, o => o.MapFrom(x => x.Id == x.UserId ? 1 : 0))
|
||||
;
|
||||
|
||||
CreateMap<CurrencyGlobalDto, CurrencyGlobalViewModel>();
|
||||
|
||||
CreateMap<CurrencyDto, CurrencyViewModel>();
|
||||
|
||||
CreateMap<CurrencyRateDto, CurrencyRateViewModel>();
|
||||
|
||||
CreateMap<CurrencyWithRateDto, CurrencyViewModel>()
|
||||
.ForMember(x => x.Id, o => o.MapFrom(x => x.Currency.Id))
|
||||
.ForMember(x => x.Code, o => o.MapFrom(x => x.Currency.CurrencyGlobalId))
|
||||
.ForMember(x => x.Name, o => o.MapFrom(x => x.Currency.Name))
|
||||
.ForMember(x => x.ShortName, o => o.MapFrom(x => x.Currency.ShortName))
|
||||
.ForMember(x => x.Rate, o => o.MapFrom(x => x.Rate == null ? (decimal?)null : x.Rate.Rate))
|
||||
.ForMember(x => x.IsPrimary, o => o.MapFrom(x => x.Currency.IsPrimary))
|
||||
.ForMember(x => x.Quantity, o => o.MapFrom(x => x.Rate == null ? (int?)null : x.Rate.Quantity))
|
||||
.ForMember(x => x.RateDate, o => o.MapFrom(x => x.Rate == null ? (DateTime?)null : x.Rate.DateTime))
|
||||
;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
{
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
public class MotionsGetModel
|
||||
public class MotionsGetRequest
|
||||
{
|
||||
[Required]
|
||||
public DateTime From { get; set; }
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace MyOffice.Web.Models.Account;
|
||||
|
||||
using AutoMapper;
|
||||
using Core.Extensions;
|
||||
|
||||
public class ViewModelProfile : Profile
|
||||
{
|
||||
public ViewModelProfile()
|
||||
{
|
||||
CreateMap<Guid, string>().ConvertUsing(x => x.ToShort());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user