This commit is contained in:
sam 2024-05-11 15:26:47 +02:00
commit f6629fbb33
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
32 changed files with 1608 additions and 0 deletions

View file

@ -0,0 +1,21 @@
namespace Foxchat.Identity.Database.Models;
public class Account
{
public Ulid Id { get; init; } = Ulid.NewUlid();
public string Username { get; set; } = null!;
public string Email { get; set; } = null!;
public string Password { get; set; } = null!;
public AccountRole Role { get; set; }
public string? Avatar { get; set; }
public List<Token> Tokens { get; } = [];
public List<ChatInstance> ChatInstances { get; } = [];
public enum AccountRole
{
User,
Admin,
}
}

View file

@ -0,0 +1,19 @@
namespace Foxchat.Identity.Database.Models;
public class ChatInstance
{
public Ulid Id { get; init; } = Ulid.NewUlid();
public string Domain { get; init; } = null!;
public string BaseUrl { get; set; } = null!;
public string PublicKey { get; set; } = null!;
public InstanceStatus Status { get; set; }
public string? Reason { get; set; }
public List<Account> Accounts { get; } = [];
public enum InstanceStatus
{
Active,
Suspended,
}
}

View file

@ -0,0 +1,10 @@
namespace Foxchat.Identity.Database.Models;
public class GuildAccount
{
public Ulid ChatInstanceId { get; init; }
public ChatInstance ChatInstance { get; init; } = null!;
public string GuildId { get; init; } = null!;
public Ulid AccountId { get; init; }
public Account Account { get; init; } = null!;
}

View file

@ -0,0 +1,8 @@
namespace Foxchat.Identity.Database.Models;
public class Token
{
public Ulid Id { get; init; } = Ulid.NewUlid();
public Ulid AccountId { get; set; }
public Account Account { get; set; } = null!;
}