feat(backend): add support conversations
This commit is contained in:
parent
a4ca0902a3
commit
ed3159c05d
12 changed files with 620 additions and 0 deletions
19
Foxnouns.Backend/Database/Models/SupportConversation.cs
Normal file
19
Foxnouns.Backend/Database/Models/SupportConversation.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
namespace Foxnouns.Backend.Database.Models;
|
||||
|
||||
public class SupportConversation : BaseModel
|
||||
{
|
||||
public Snowflake UserId { get; init; }
|
||||
public User User { get; init; } = null!;
|
||||
public required string Title { get; set; }
|
||||
public Snowflake? AssignedToId { get; set; }
|
||||
public User? AssignedTo { get; set; }
|
||||
|
||||
public SupportConversationStatus Status { get; set; } = SupportConversationStatus.Open;
|
||||
}
|
||||
|
||||
public enum SupportConversationStatus
|
||||
{
|
||||
Open,
|
||||
Resolved,
|
||||
Closed,
|
||||
}
|
30
Foxnouns.Backend/Database/Models/SupportMessage.cs
Normal file
30
Foxnouns.Backend/Database/Models/SupportMessage.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using NodaTime;
|
||||
|
||||
namespace Foxnouns.Backend.Database.Models;
|
||||
|
||||
public class SupportMessage : BaseModel
|
||||
{
|
||||
public Snowflake ConversationId { get; init; }
|
||||
public SupportConversation Conversation { get; init; } = null!;
|
||||
public Snowflake UserId { get; init; }
|
||||
public User User { get; init; } = null!;
|
||||
public bool IsAnonymous { get; init; }
|
||||
|
||||
public string? Content { get; set; }
|
||||
|
||||
public List<Attachment> Attachments { get; set; } = [];
|
||||
public List<HistoryEntry> History { get; set; } = [];
|
||||
|
||||
public class Attachment
|
||||
{
|
||||
public required Snowflake Id { get; init; }
|
||||
public required string Hash { get; init; }
|
||||
public required string ContentType { get; init; }
|
||||
}
|
||||
|
||||
public class HistoryEntry
|
||||
{
|
||||
public required Instant Timestamp { get; init; }
|
||||
public required string? Content { get; init; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue