refactoring
This commit is contained in:
@@ -9,7 +9,7 @@ public class Account
|
||||
public CurrencyGlobal? CurrencyGlobal { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public IEnumerable<AccountAccess>? AccessRights { get; set; }
|
||||
public IEnumerable<AccountMotion>? Motions { get; set; }
|
||||
public IEnumerable<Motion>? Motions { get; set; }
|
||||
public IEnumerable<AccountAccountCategory>? Categories { get; set; }
|
||||
}
|
||||
|
||||
|
||||
+8
-4
@@ -1,16 +1,20 @@
|
||||
namespace MyOffice.Data.Models.Accounts;
|
||||
|
||||
using MyOffice.Data.Models.Motions;
|
||||
using Items;
|
||||
|
||||
public class AccountMotion
|
||||
/// <summary>
|
||||
/// Account motion
|
||||
/// DateTime: 2023-01-01, Account: 'Debit card', Item.ItemGlobal: 'Primary salary', AmountPlus: 5000
|
||||
/// </summary>
|
||||
public class Motion
|
||||
{
|
||||
public Guid 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 int ItemId { get; set; }
|
||||
public Item Item { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
public decimal AmountPlus { get; set; }
|
||||
public decimal AmountMinus { get; set; }
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace MyOffice.Data.Models.Items;
|
||||
|
||||
using MyOffice.Data.Models.Accounts;
|
||||
|
||||
/// <summary>
|
||||
/// User 'Item' linked to global item
|
||||
/// ItemGlobal: 'Primary salary', ItemCategory: 'Incomes'
|
||||
/// </summary>
|
||||
public class Item
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public Guid CategoryId { get; set; }
|
||||
public ItemCategory Category { get; set; } = null!;
|
||||
public Guid ItemGlobalId { get; set; }
|
||||
public ItemGlobal ItemGlobal { get; set; } = null!;
|
||||
public IEnumerable<Motion> Motions { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace MyOffice.Data.Models.Items;
|
||||
|
||||
using MyOffice.Data.Models.Users;
|
||||
|
||||
public class ItemCategory
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public User User { get; set; } = null!;
|
||||
public string Name { get; set; } = null!;
|
||||
public IEnumerable<Item> Items { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace MyOffice.Data.Models.Items;
|
||||
|
||||
public class ItemGlobal
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public IEnumerable<Item> Items { get; set; } = null!;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
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!;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
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!;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
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!;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
using Accounts;
|
||||
using Currencies;
|
||||
using Motions;
|
||||
using Items;
|
||||
|
||||
public class User
|
||||
{
|
||||
@@ -26,7 +26,7 @@ public class User
|
||||
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<Motion>? AccountMotions { get; set; }
|
||||
public IEnumerable<AccountCategory>? AccountCategories { get; set; }
|
||||
public IEnumerable<MotionCategory>? MotionCategories { get; set; }
|
||||
public IEnumerable<ItemCategory>? ItemCategories { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user