Added ticket models. Did some ui
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
18
Moonlight/App/Database/Entities/Tickets/Ticket.cs
Normal file
18
Moonlight/App/Database/Entities/Tickets/Ticket.cs
Normal 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;
|
||||
}
|
||||
11
Moonlight/App/Database/Entities/Tickets/TicketMessage.cs
Normal file
11
Moonlight/App/Database/Entities/Tickets/TicketMessage.cs
Normal 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; }
|
||||
}
|
||||
9
Moonlight/App/Database/Enums/TicketPriority.cs
Normal file
9
Moonlight/App/Database/Enums/TicketPriority.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Moonlight.App.Database.Enums;
|
||||
|
||||
public enum TicketPriority
|
||||
{
|
||||
Low,
|
||||
Medium,
|
||||
High,
|
||||
Critical
|
||||
}
|
||||
Reference in New Issue
Block a user