Fase 1: Inicialización del Backend .NET 10, Configuración de Dapper, Autenticación JWT y Entidades Base
This commit is contained in:
6
src/SIGCM.Domain/Class1.cs
Normal file
6
src/SIGCM.Domain/Class1.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace SIGCM.Domain;
|
||||
|
||||
public class Class1
|
||||
{
|
||||
|
||||
}
|
||||
10
src/SIGCM.Domain/Entities/Category.cs
Normal file
10
src/SIGCM.Domain/Entities/Category.cs
Normal 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;
|
||||
}
|
||||
7
src/SIGCM.Domain/Entities/Operation.cs
Normal file
7
src/SIGCM.Domain/Entities/Operation.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace SIGCM.Domain.Entities;
|
||||
|
||||
public class Operation
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public required string Name { get; set; }
|
||||
}
|
||||
11
src/SIGCM.Domain/Entities/User.cs
Normal file
11
src/SIGCM.Domain/Entities/User.cs
Normal 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;
|
||||
}
|
||||
12
src/SIGCM.Domain/Interfaces/ICategoryRepository.cs
Normal file
12
src/SIGCM.Domain/Interfaces/ICategoryRepository.cs
Normal 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);
|
||||
}
|
||||
10
src/SIGCM.Domain/Interfaces/IOperationRepository.cs
Normal file
10
src/SIGCM.Domain/Interfaces/IOperationRepository.cs
Normal 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);
|
||||
}
|
||||
8
src/SIGCM.Domain/Interfaces/IUserRepository.cs
Normal file
8
src/SIGCM.Domain/Interfaces/IUserRepository.cs
Normal 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);
|
||||
}
|
||||
9
src/SIGCM.Domain/SIGCM.Domain.csproj
Normal file
9
src/SIGCM.Domain/SIGCM.Domain.csproj
Normal file
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user