feat(backend): add support conversations

This commit is contained in:
sam 2024-10-03 19:27:26 +02:00
parent a4ca0902a3
commit ed3159c05d
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
12 changed files with 620 additions and 0 deletions

View 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,
}

View 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; }
}
}