This commit is contained in:
2023-12-16 21:18:01 +02:00
parent 775146ee86
commit 2feaf50802
46 changed files with 641 additions and 429 deletions
@@ -1,4 +1,8 @@
namespace MyOffice.Services.Account.Domain;
/// <see cref="MyOffice.Data.Models.Accounts.AccountCategory"/>
namespace MyOffice.Services.Account.Domain;
using AutoMapper;
using MyOffice.Data.Models.Accounts;
public class AccountCategoryDto
{
@@ -6,4 +10,15 @@ public class AccountCategoryDto
public Guid UserId { get; set; }
public string Name { get; set; } = null!;
public bool AllowDelete { get; set; }
}
public class AccountCategoryDtoProfile: Profile
{
public AccountCategoryDtoProfile()
{
CreateMap<AccountCategory, AccountCategoryDto>()
.ForMember(x => x.Id, o => o.MapFrom(x => x.Id))
.ForMember(x => x.AllowDelete, o => o.MapFrom(x => !x.Accounts!.Any()))
;
}
}