Added ticket models. Did some ui

This commit is contained in:
Marcel Baumgartner
2023-10-17 09:00:59 +02:00
parent 8c82631569
commit 4159170244
8 changed files with 208 additions and 136 deletions

View File

@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Moonlight.App.Database.Entities;
using Moonlight.App.Database.Entities.Tickets;
using Moonlight.App.Services;
namespace Moonlight.App.Database;
@@ -9,6 +10,8 @@ public class DataContext : DbContext
private readonly ConfigService ConfigService;
public DbSet<User> Users { get; set; }
//public DbSet<Ticket> Tickets { get; set; }
//public DbSet<TicketMessage> TicketMessages { get; set; }
public DataContext(ConfigService configService)
{

View File

@@ -0,0 +1,18 @@
using Moonlight.App.Database.Enums;
namespace Moonlight.App.Database.Entities.Tickets;
public class Ticket
{
public int Id { get; set; }
public User Creator { get; set; }
public string Name { get; set; } = "";
public string Description { get; set; } = "";
public string Tries { get; set; } = "";
public TicketPriority Priority { get; set; } = TicketPriority.Low;
public bool Open { get; set; } = true;
public List<TicketMessage> Messages = new();
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}

View File

@@ -0,0 +1,11 @@
namespace Moonlight.App.Database.Entities.Tickets;
public class TicketMessage
{
public int Id { get; set; }
public User? Sender { get; set; }
public bool IsSupport { get; set; }
public string Content { get; set; } = "";
public string? Attachment { get; set; }
public DateTime CreatedAt { get; set; }
}

View File

@@ -0,0 +1,9 @@
namespace Moonlight.App.Database.Enums;
public enum TicketPriority
{
Low,
Medium,
High,
Critical
}