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,17 @@
namespace MyOffice.Services.Account.Domain;
using Data.Models.Accounts;
using Data.Models.Users;
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; }
}
@@ -0,0 +1,7 @@
namespace MyOffice.Services.Account.Domain;
public class AccountAccountCategoryDto
{
public Guid CategoryId { get; set; }
public AccountCategoryDto? Category { get; set; } = null!;
}
@@ -0,0 +1,6 @@
public class AccountCategoryDto
{
public Guid Id { get; set; }
public Guid UserId { get; set; }
public string Name { get; set; } = null!;
}
+1 -71
View File
@@ -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!;
}
@@ -4,8 +4,11 @@
{
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 decimal AmountBalancing { get; set; }
}
}
@@ -0,0 +1,17 @@
namespace MyOffice.Services.Account.Domain;
using Data.Models.Currencies;
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; }
}