Fase 1: Inicialización del Backend .NET 10, Configuración de Dapper, Autenticación JWT y Entidades Base

This commit is contained in:
2025-12-17 13:08:21 -03:00
parent 15305c681c
commit eda016f93f
33 changed files with 819 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
namespace SIGCM.Domain;
public class Class1
{
}

View File

@@ -0,0 +1,10 @@
namespace SIGCM.Domain.Entities;
public class Category
{
public int Id { get; set; }
public int? ParentId { get; set; }
public required string Name { get; set; }
public required string Slug { get; set; }
public bool Active { get; set; } = true;
}

View File

@@ -0,0 +1,7 @@
namespace SIGCM.Domain.Entities;
public class Operation
{
public int Id { get; set; }
public required string Name { get; set; }
}

View File

@@ -0,0 +1,11 @@
namespace SIGCM.Domain.Entities;
public class User
{
public int Id { get; set; }
public required string Username { get; set; }
public required string PasswordHash { get; set; }
public required string Role { get; set; }
public string? Email { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}

View File

@@ -0,0 +1,12 @@
namespace SIGCM.Domain.Interfaces;
using SIGCM.Domain.Entities;
public interface ICategoryRepository
{
Task<IEnumerable<Category>> GetAllAsync();
Task<Category?> GetByIdAsync(int id);
Task<int> AddAsync(Category category);
Task UpdateAsync(Category category);
Task DeleteAsync(int id);
Task<IEnumerable<Category>> GetSubCategoriesAsync(int parentId);
}

View File

@@ -0,0 +1,10 @@
namespace SIGCM.Domain.Interfaces;
using SIGCM.Domain.Entities;
public interface IOperationRepository
{
Task<IEnumerable<Operation>> GetAllAsync();
Task<Operation?> GetByIdAsync(int id);
Task<int> AddAsync(Operation operation);
Task DeleteAsync(int id);
}

View File

@@ -0,0 +1,8 @@
namespace SIGCM.Domain.Interfaces;
using SIGCM.Domain.Entities;
public interface IUserRepository
{
Task<User?> GetByUsernameAsync(string username);
Task<int> CreateAsync(User user);
}

View File

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>