🗃️ Realm database modeling
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
using DysonNetwork.Sphere.Storage;
|
||||
using NodaTime;
|
||||
|
||||
namespace DysonNetwork.Sphere.Realm;
|
||||
|
||||
@ -12,7 +13,27 @@ public class Realm : ModelBase
|
||||
|
||||
public CloudFile? Picture { get; set; }
|
||||
public CloudFile? Background { get; set; }
|
||||
|
||||
[JsonIgnore] public ICollection<RealmMember> Members { get; set; } = new List<RealmMember>();
|
||||
|
||||
public long? AccountId { get; set; }
|
||||
[JsonIgnore] public Account.Account? Account { get; set; }
|
||||
public long AccountId { get; set; }
|
||||
[JsonIgnore] public Account.Account Account { get; set; }
|
||||
}
|
||||
|
||||
public enum RealmMemberRole
|
||||
{
|
||||
Owner = 100,
|
||||
Moderator = 50,
|
||||
Normal = 0
|
||||
}
|
||||
|
||||
public class RealmMember : ModelBase
|
||||
{
|
||||
public long RealmId { get; set; }
|
||||
[JsonIgnore] public Realm Realm { get; set; } = null!;
|
||||
public long AccountId { get; set; }
|
||||
[JsonIgnore] public Account.Account Account { get; set; } = null!;
|
||||
|
||||
public RealmMemberRole Role { get; set; }
|
||||
public Instant? JoinedAt { get; set; }
|
||||
}
|
Reference in New Issue
Block a user