This commit is contained in:
2023-06-17 14:16:09 +03:00
parent 62178f1f32
commit 7ae5d3bc81
180 changed files with 12932 additions and 192 deletions
+12 -60
View File
@@ -1,70 +1,22 @@
namespace MyOffice.Data.Models.Account;
namespace MyOffice.Data.Models.Accounts;
using MyOffice.Data.Models.Users;
public class CurrencyGlobal
{
public string Id { get; set; }
public string Name { get; set; }
public string ShortName { get; set; }
public IEnumerable<Currency>? Currencies { get; set; }
public IEnumerable<Account>? Accounts { get; set; }
}
public class Currency
{
public Guid Id { get; set; }
public string CurrencyGlobalId { get; set; }
public CurrencyGlobal? CurrencyGlobal { get; set; }
public Guid UserId { get; set; }
public User? User { get; set; }
public string Name { get; set; }
public string ShortName { get; set; }
public IEnumerable<CurrencyRate>? Rates { get; set; }
}
public class CurrencyRate
{
public int Id { get; set; }
public Guid CurrencyId { get; set; }
public Currency? Currency { get; set; }
public DateTime DateTime { get; set; }
public decimal Rate { get; set; }
}
using Currencies;
public class Account
{
public Guid Id { get; set; }
public string CurrencyGlobalId { get; set; }
public string CurrencyGlobalId { get; set; } = null!;
public CurrencyGlobal? CurrencyGlobal { get; set; }
public string Name { get; set; }
public IEnumerable<AccountAccess> AccessRights { get; set; }
public IEnumerable<AccountMotion> Motions { get; set; }
public string Name { get; set; } = null!;
public IEnumerable<AccountAccess>? AccessRights { get; set; }
public IEnumerable<AccountMotion>? Motions { get; set; }
public IEnumerable<AccountAccountCategory>? Categories { get; set; }
}
public class AccountAccess
public class AccountDetailed
{
public int Id { get; set; }
public Guid AccountId { get; set; }
public Account? 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 class AccountMotion
{
public long Id { get; set; }
public DateTime CreatedOn { get; set; }
public DateTime DateTime { get; set; }
public Guid AccountId { get; set; }
public Account? Account { get; set; }
public Guid UserId { get; set; }
public User? User { get; set; }
public decimal AmountIn { get; set; }
public decimal AmountOut { get; set; }
public Account Account { get; set; } = null!;
public decimal TotalPlus { get; set; }
public decimal TotalMinus { get; set; }
public decimal Rest => TotalPlus - TotalMinus;
}
@@ -0,0 +1,16 @@
namespace MyOffice.Data.Models.Accounts;
using MyOffice.Data.Models.Users;
public class AccountAccess
{
public int Id { get; set; }
public Guid AccountId { get; set; }
public Account? 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; }
}
@@ -0,0 +1,10 @@
namespace MyOffice.Data.Models.Accounts;
public class AccountAccountCategory
{
public int Id { get; set; }
public Guid AccountId { get; set; }
public Account Account { get; set; } = null!;
public Guid CategoryId { get; set; }
public AccountCategory Category { get; set; } = null!;
}
@@ -0,0 +1,12 @@
namespace MyOffice.Data.Models.Accounts;
using MyOffice.Data.Models.Users;
public class AccountCategory
{
public Guid Id { get; set; }
public Guid UserId { get; set; }
public User? User { get; set; }
public string Name { get; set; } = null!;
public IEnumerable<AccountAccountCategory>? Accounts { get; set; }
}
@@ -0,0 +1,17 @@
namespace MyOffice.Data.Models.Accounts;
using MyOffice.Data.Models.Motions;
public class AccountMotion
{
public long Id { get; set; }
public DateTime CreatedOn { get; set; }
public DateTime DateTime { get; set; }
public int MotionId { get; set; }
public MotionAccount Motion { get; set; } = null!;
public Guid AccountId { get; set; }
public Account Account { get; set; } = null!;
public string? Description { get; set; }
public decimal AmountPlus { get; set; }
public decimal AmountMinus { get; set; }
}
@@ -0,0 +1,16 @@
namespace MyOffice.Data.Models.Currencies;
using MyOffice.Data.Models.Users;
public class Currency
{
public Guid Id { get; set; }
public string CurrencyGlobalId { get; set; } = null!;
public CurrencyGlobal? CurrencyGlobal { get; set; }
public Guid UserId { get; set; }
public User? User { get; set; }
public string Name { get; set; } = null!;
public string ShortName { get; set; } = null!;
public IEnumerable<CurrencyRate>? Rates { get; set; }
}
@@ -0,0 +1,13 @@
namespace MyOffice.Data.Models.Currencies;
using MyOffice.Data.Models.Accounts;
public class CurrencyGlobal
{
public string Id { get; set; } = null!;
public string Name { get; set; } = null!;
public string Symbol { get; set; } = null!;
public int DefaultQuantity { get; set; }
public IEnumerable<Currency>? Currencies { get; set; }
public IEnumerable<Account>? Accounts { get; set; }
}
@@ -0,0 +1,11 @@
namespace MyOffice.Data.Models.Currencies;
public class CurrencyRate
{
public int Id { get; set; }
public Guid CurrencyId { get; set; }
public Currency? Currency { get; set; }
public DateTime DateTime { get; set; }
public int Quantity { get; set; }
public decimal Rate { get; set; }
}
@@ -0,0 +1,13 @@
namespace MyOffice.Data.Models.Motions;
using Accounts;
public class MotionAccount
{
public int Id { get; set; }
public Guid CategoryId { get; set; }
public MotionCategory Category { get; set; } = null!;
public Guid MotionGlobalId { get; set; }
public MotionGlobal MotionGlobal { get; set; } = null!;
public IEnumerable<AccountMotion> Motions { get; set; } = null!;
}
@@ -0,0 +1,12 @@
namespace MyOffice.Data.Models.Motions;
using Users;
public class MotionCategory
{
public Guid Id { get; set; }
public Guid UserId { get; set; }
public User User { get; set; } = null!;
public string Name { get; set; } = null!;
public IEnumerable<MotionAccount> Motions { get; set; } = null!;
}
@@ -0,0 +1,8 @@
namespace MyOffice.Data.Models.Motions;
public class MotionGlobal
{
public Guid Id { get; set; }
public string Name { get; set; } = null!;
public IEnumerable<MotionAccount> Motions { get; set; } = null!;
}
+14 -1
View File
@@ -1,9 +1,16 @@
namespace MyOffice.Data.Models.Users;
using Account;
using Accounts;
using Currencies;
using Motions;
public class User
{
public User()
{
CurrencyId = "USD";
}
public Guid Id { get; set; }
public string UserName { get; set; } = null!;
public string Email { get; set; } = null!;
@@ -15,5 +22,11 @@ public class User
public bool IsEmailConfirmed { get; set; }
public IEnumerable<UserExternal>? UserClaims { get; set; }
public string CurrencyId { get; set; }
public CurrencyGlobal? Currency { get; set; }
public IEnumerable<Currency>? Currencies { get; set; }
public IEnumerable<AccountAccess>? AccountAccess { get; set; }
public IEnumerable<AccountMotion>? AccountMotions { get; set; }
public IEnumerable<AccountCategory>? AccountCategories { get; set; }
public IEnumerable<MotionCategory>? MotionCategories { get; set; }
}