Publish from private repository
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
namespace MyOffice.Data.Models.Accounts;
|
||||
|
||||
using Currencies;
|
||||
using MyOffice.Core;
|
||||
using MyOffice.Data.Models.Users;
|
||||
|
||||
public class Account: IDataModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string CurrencyGlobalId { get; set; } = null!;
|
||||
public CurrencyGlobal? CurrencyGlobal { get; set; }
|
||||
public Guid? OwnerId { get; set; }
|
||||
public User? Owner { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public IEnumerable<AccountAccess>? AccessRights { get; set; }
|
||||
public IEnumerable<Motion>? Motions { get; set; }
|
||||
public IEnumerable<AccountAccountCategory>? Categories { get; set; }
|
||||
public IEnumerable<AccountAccessInvite>? Invites { get; set; }
|
||||
}
|
||||
|
||||
public class AccountDetailed: IDataModel
|
||||
{
|
||||
public Account Account { get; set; } = null!;
|
||||
public decimal TotalPlus { get; set; }
|
||||
public decimal TotalMinus { get; set; }
|
||||
public decimal Rest => TotalPlus - TotalMinus;
|
||||
}
|
||||
|
||||
public class AccountSimple
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public AccountAccessTypeEnum Type { get; set; }
|
||||
public string? CurrencyName { get; set; }
|
||||
public string? CurrencyShortName { get; set; }
|
||||
public decimal? CurrencyRate { get; set; }
|
||||
public int? CurrencyQuantity { get; set; }
|
||||
public decimal? TotalPlus { get; set; }
|
||||
public decimal? TotalMinus { get; set; }
|
||||
public decimal? Balance { get; set; }
|
||||
}
|
||||
|
||||
public class MotionTotalSimple
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
public string CurrencyId { get; set; } = null!;
|
||||
public string CurrencyName { get; set; } = null!;
|
||||
public decimal CurrencyRate { get; set; }
|
||||
public decimal Amount { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
namespace MyOffice.Data.Models.Accounts;
|
||||
|
||||
using MyOffice.Data.Models.Users;
|
||||
|
||||
public enum AccountAccessTypeEnum
|
||||
{
|
||||
balance,
|
||||
credit,
|
||||
external,
|
||||
other,
|
||||
}
|
||||
|
||||
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 Guid OwnerId { get; set; }
|
||||
public User? Owner { get; set; }
|
||||
|
||||
public bool IsAllowRead { get; set; }
|
||||
public bool IsAllowWrite { get; set; }
|
||||
public bool IsAllowManage { get; set; }
|
||||
public AccountAccessTypeEnum Type { get; set; }
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace MyOffice.Data.Models.Accounts;
|
||||
|
||||
using Users;
|
||||
|
||||
public class AccountAccessInvite
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public User? User { get; set; }
|
||||
public Guid AccountId { get; set; }
|
||||
public Account? Account { get; set; }
|
||||
public DateTime CreatedOn { get; set; }
|
||||
public DateTime? AcceptedOn { get; set; }
|
||||
public DateTime? RejectedOn { get; set; }
|
||||
public string Email { get; set; } = null!;
|
||||
public bool IsAllowWrite { 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,10 @@
|
||||
namespace MyOffice.Data.Models.Accounts.Domain;
|
||||
|
||||
using Currencies;
|
||||
|
||||
public class AccountWithRate
|
||||
{
|
||||
public Account Account { get; set; } = null!;
|
||||
public Currency? Currency { get; set; }
|
||||
public CurrencyRate? Rate { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace MyOffice.Data.Models.Accounts;
|
||||
|
||||
using Items;
|
||||
|
||||
/// <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 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; }
|
||||
public DateTime? DeletedOn { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
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; }
|
||||
|
||||
public int? CurrentRateId { get; set; }
|
||||
public CurrencyRate? CurrentRate { get; set; }
|
||||
|
||||
public bool IsPrimary { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace MyOffice.Data.Models.Currencies;
|
||||
|
||||
using MyOffice.Data.Models.Accounts;
|
||||
|
||||
public enum CurrencyGlobalIdEnum
|
||||
{
|
||||
UAH,
|
||||
USD,
|
||||
EUR,
|
||||
GBP,
|
||||
RUB,
|
||||
BTC,
|
||||
ETH,
|
||||
TON,
|
||||
OTHER,
|
||||
}
|
||||
|
||||
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,12 @@
|
||||
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; }
|
||||
public IEnumerable<Currency>? Currencies { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
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; }
|
||||
/// <summary>
|
||||
/// UnCategorized category is CategoryId = UserId
|
||||
/// </summary>
|
||||
public Guid CategoryId { get; set; }
|
||||
public ItemCategory? Category { get; set; }
|
||||
public Guid ItemGlobalId { get; set; }
|
||||
public ItemGlobal ItemGlobal { get; set; } = null!;
|
||||
public List<Motion>? Motions { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
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 List<Item> Items { get; set; } = null!;
|
||||
public bool IsInternal { get; set; }
|
||||
}
|
||||
@@ -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!;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MyOffice.Core\MyOffice.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace MyOffice.Data.Models.Notifications;
|
||||
|
||||
public enum EmailTemplateEnum
|
||||
{
|
||||
PasswordRestore,
|
||||
}
|
||||
|
||||
public class EmailTemplate
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public DateTime CreatedOn { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Subject { get; set; }
|
||||
public string Sender { get; set; }
|
||||
public string SenderName { get; set; }
|
||||
public string Template { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace MyOffice.Data.Models.Users;
|
||||
|
||||
using Accounts;
|
||||
using Currencies;
|
||||
using Items;
|
||||
|
||||
public class User
|
||||
{
|
||||
public User()
|
||||
{
|
||||
CurrencyId = "USD";
|
||||
}
|
||||
|
||||
public Guid Id { get; set; }
|
||||
public string UserName { get; set; } = null!;
|
||||
public string Email { get; set; } = null!;
|
||||
public string PasswordHash { get; set; } = null!;
|
||||
public string? FirstName { get; set; }
|
||||
public string? LastName { get; set; }
|
||||
public string? FullName { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
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<Motion>? AccountMotions { get; set; }
|
||||
public IEnumerable<AccountCategory>? AccountCategories { get; set; }
|
||||
public IEnumerable<ItemCategory>? ItemCategories { get; set; }
|
||||
public IEnumerable<Account>? Accounts { get; set; }
|
||||
public IEnumerable<AccountAccess>? AccountAccessOwners { get; set; }
|
||||
public IEnumerable<AccountAccessInvite>? AccountAccessInvites { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace MyOffice.Data.Models.Users;
|
||||
|
||||
public class UserExternal
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime CreatedOn { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public User User { get; set; } = null!;
|
||||
public string ExternalId { get; set; } = null!;
|
||||
public string Email { get; set; } = null!;
|
||||
public string Provider { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace MyOffice.Data.Models.Verifications;
|
||||
|
||||
using MyOffice.Data.Models.Users;
|
||||
|
||||
public class VerificationCode
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public User? User { get; set; }
|
||||
public string Code { get; set; } = null!;
|
||||
public string DestinationType { get; set; } = null!;
|
||||
public string Destination { get; set; } = null!;
|
||||
public DateTime CreatedOn { get; set; }
|
||||
public DateTime ExpiresOn { get; set; }
|
||||
public DateTime? VerifiedOn { get; set; }
|
||||
public string Template { get; set; } = null!;
|
||||
public string? Metadata { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace MyOffice.Data.Models.Verifications;
|
||||
|
||||
public enum VerificationCodeTemplateEnum
|
||||
{
|
||||
password_restore,
|
||||
email_confirm,
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace MyOffice.Data.Models.Verifications;
|
||||
|
||||
public enum VerificationCodeTypeEnum
|
||||
{
|
||||
email,
|
||||
phone,
|
||||
}
|
||||
Reference in New Issue
Block a user