Initial commit: HelpDesk ICHN - .NET 10 backend + Next.js 16 frontend

This commit is contained in:
Nurfog committed 2026-09-10 10:20:51 -03:00
commit 359f0caf85
90 files changed
+13395

No files matched your search

@@ -0,0 +1,30 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace HelpDesk.Models.Entities;
[Table("activity_logs")]
public class ActivityLog
{
[Key]
public Guid Id { get; set; }
public Guid? UserId { get; set; }
[Required]
[MaxLength(100)]
public string EntityType { get; set; } = string.Empty;
public int? EntityId { get; set; }
[Required]
[MaxLength(100)]
public string Action { get; set; } = string.Empty;
public string? Details { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
// Navigation
public User? User { get; set; }
}
+25
View File
@@ -0,0 +1,25 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace HelpDesk.Models.Entities;
[Table("groups")]
public class Group
{
[Key]
public Guid Id { get; set; }
[Required]
[MaxLength(100)]
public string Name { get; set; } = string.Empty;
[MaxLength(500)]
public string? Description { get; set; }
public bool IsActive { get; set; } = true;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
// Navigation
public ICollection<Ticket> Tickets { get; set; } = new List<Ticket>();
}
@@ -0,0 +1,31 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace HelpDesk.Models.Entities;
[Table("knowledge_base_articles")]
public class KnowledgeBaseArticle
{
[Key]
public Guid Id { get; set; }
[Required]
[MaxLength(200)]
public string Title { get; set; } = string.Empty;
[Required]
public string Content { get; set; } = string.Empty;
public Guid CategoryId { get; set; }
public Guid AuthorId { get; set; }
public bool IsPublished { get; set; }
public int ViewCount { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
// Navigation
public KnowledgeBaseCategory Category { get; set; } = null!;
public User Author { get; set; } = null!;
}
@@ -0,0 +1,25 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace HelpDesk.Models.Entities;
[Table("knowledge_base_categories")]
public class KnowledgeBaseCategory
{
[Key]
public Guid Id { get; set; }
[Required]
[MaxLength(100)]
public string Name { get; set; } = string.Empty;
[MaxLength(500)]
public string? Description { get; set; }
public int SortOrder { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
// Navigation
public ICollection<KnowledgeBaseArticle> Articles { get; set; } = new List<KnowledgeBaseArticle>();
}
@@ -0,0 +1,28 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace HelpDesk.Models.Entities;
[Table("sla_policies")]
public class SLAPolicy
{
[Key]
public Guid Id { get; set; }
[Required]
[MaxLength(100)]
public string Name { get; set; } = string.Empty;
[MaxLength(500)]
public string? Description { get; set; }
public int ResponseTimeHours { get; set; }
public int ResolutionTimeHours { get; set; }
public bool IsActive { get; set; } = true;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
// Navigation
public ICollection<Ticket> Tickets { get; set; } = new List<Ticket>();
}
@@ -0,0 +1,49 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using HelpDesk.Models.Enums;
namespace HelpDesk.Models.Entities;
[Table("tickets")]
public class Ticket
{
[Key]
public Guid Id { get; set; }
[Required]
[MaxLength(200)]
public string Title { get; set; } = string.Empty;
[Required]
public string Description { get; set; } = string.Empty;
[Required]
[MaxLength(50)]
public TicketStatus Status { get; set; } = TicketStatus.Open;
[Required]
[MaxLength(50)]
public TicketPriority Priority { get; set; } = TicketPriority.Medium;
[Required]
[MaxLength(50)]
public string TicketNumber { get; set; } = string.Empty;
public Guid RequesterId { get; set; }
public Guid? AssigneeId { get; set; }
public Guid? GroupId { get; set; }
public Guid? SlaPolicyId { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
public DateTime? FirstResponseAt { get; set; }
public DateTime? ResolvedAt { get; set; }
public DateTime? ClosedAt { get; set; }
// Navigation
public User Requester { get; set; } = null!;
public User? Assignee { get; set; }
public Group? Group { get; set; }
public SLAPolicy? SlaPolicy { get; set; }
public ICollection<TicketComment> Comments { get; set; } = new List<TicketComment>();
}
@@ -0,0 +1,25 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace HelpDesk.Models.Entities;
[Table("ticket_comments")]
public class TicketComment
{
[Key]
public Guid Id { get; set; }
public Guid TicketId { get; set; }
public Guid UserId { get; set; }
[Required]
public string Content { get; set; } = string.Empty;
public bool IsInternal { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
// Navigation
public Ticket Ticket { get; set; } = null!;
public User User { get; set; } = null!;
}
+50
View File
@@ -0,0 +1,50 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using HelpDesk.Models.Enums;
namespace HelpDesk.Models.Entities;
[Table("users")]
public class User
{
[Key]
public Guid Id { get; set; }
[Required]
[MaxLength(100)]
public string FirstName { get; set; } = string.Empty;
[Required]
[MaxLength(100)]
public string LastName { get; set; } = string.Empty;
[Required]
[MaxLength(256)]
public string Email { get; set; } = string.Empty;
[Required]
[MaxLength(500)]
public string PasswordHash { get; set; } = string.Empty;
[Required]
[MaxLength(50)]
public UserRole Role { get; set; } = UserRole.Customer;
public bool IsActive { get; set; } = true;
[MaxLength(50)]
public string? PhoneNumber { get; set; }
[MaxLength(500)]
public string? AvatarUrl { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
// Navigation
public ICollection<Ticket> RequestedTickets { get; set; } = new List<Ticket>();
public ICollection<Ticket> AssignedTickets { get; set; } = new List<Ticket>();
public ICollection<TicketComment> Comments { get; set; } = new List<TicketComment>();
public ICollection<KnowledgeBaseArticle> Articles { get; set; } = new List<KnowledgeBaseArticle>();
public ICollection<ActivityLog> ActivityLogs { get; set; } = new List<ActivityLog>();
}