fix
This commit is contained in:
@@ -1,13 +1,6 @@
|
||||
using MyOffice.Data.Models.Accounts;
|
||||
using MyOffice.Data.Models.Users;
|
||||
using MyOffice.Services.Account.Domain;
|
||||
|
||||
namespace MyOffice.Services.Account.Domain
|
||||
namespace MyOffice.Services.Account.Domain
|
||||
{
|
||||
using AutoMapper;
|
||||
using MyOffice.Data.Models.Accounts;
|
||||
using MyOffice.Data.Models.Currencies;
|
||||
using MyOffice.Data.Models.Users;
|
||||
using System;
|
||||
|
||||
public class AccountDto
|
||||
@@ -26,67 +19,4 @@ namespace MyOffice.Services.Account.Domain
|
||||
public List<AccountAccessDto>? AccessRights { get; set; }
|
||||
public List<AccountAccountCategoryDto>? Categories { get; set; }
|
||||
}
|
||||
|
||||
public class AccountAccessDto
|
||||
{
|
||||
public Guid AccountId { get; set; }
|
||||
public AccountDto? Account { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public User? User { get; set; }
|
||||
|
||||
public bool IsAllowRead { get; set; }
|
||||
public bool IsAllowWrite { get; set; }
|
||||
public bool IsAllowManage { get; set; }
|
||||
public AccountAccessTypeEnum Type { get; set; }
|
||||
}
|
||||
|
||||
public class AccountAccountCategoryDto
|
||||
{
|
||||
public Guid CategoryId { get; set; }
|
||||
public AccountCategoryDto? Category { get; set; } = null!;
|
||||
}
|
||||
|
||||
public class AccountMappingProfile : Profile
|
||||
{
|
||||
public AccountMappingProfile()
|
||||
{
|
||||
CreateMap<User, UserDto>();
|
||||
|
||||
CreateMap<Account, AccountDto>()
|
||||
.ForMember(x => x.HasMotions, o => o.MapFrom(x => x.Motions.Any()))
|
||||
;
|
||||
|
||||
CreateMap<AccountDetailed, AccountDetailedDto>();
|
||||
|
||||
CreateMap<AccountAccess, AccountAccessDto>();
|
||||
|
||||
CreateMap<AccountAccountCategory, AccountAccountCategoryDto>();
|
||||
|
||||
CreateMap<AccountCategory, AccountCategoryDto>()
|
||||
.ForMember(x => x.Id, o => o.MapFrom(x => x.Id))
|
||||
.ForMember(x => x.Id, o => o.MapFrom(x => x.Id))
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
public class UserDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string UserName { get; set; } = null!;
|
||||
public string Email { get; set; } = null!;
|
||||
public string? FirstName { get; set; }
|
||||
public string? LastName { get; set; }
|
||||
public string? FullName { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
|
||||
public string CurrencyId { get; set; }
|
||||
public CurrencyGlobal? Currency { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
public class AccountCategoryDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
}
|
||||
Reference in New Issue
Block a user