Refactor to introduce Govor.Application and Govor.Contracts layers

Moved service implementations and interfaces from Govor.API and Govor.Core to new Govor.Application and Govor.Contracts projects. Updated namespaces and references throughout the solution. Added custom exception classes for authentication and invite services. Adjusted dependency injection and project references to use the new structure. This refactor improves separation of concerns and prepares the codebase for better maintainability and scalability.
This commit is contained in:
Artemy
2025-06-25 15:16:14 +07:00
parent 5693190b1c
commit 4f3f4ec066
41 changed files with 126 additions and 75 deletions
@@ -0,0 +1,9 @@
namespace Govor.Contracts.Requests;
public class CreateInvitationRequest
{
public DateTime EndDate { get; set; }
public int MaxParticipants { get; set; }
public bool IsAdmin { get; set; }
public string Description { get; set; }
}
+16
View File
@@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations;
using Govor.Core.Infrastructure.Validators;
namespace Govor.Contracts.Requests;
public class LoginRequest
{
[Required]
[StringLength(UserValidator.MAX_LENGHT_OF_NAME,
MinimumLength = UserValidator.MIN_LENGHT_OF_NAME,
ErrorMessage = "Username must be between 4 and 50 characters.")]
public string Name { get; init; }
[Required]
[MinLength(8)]
public string Password { get; init; }
}
@@ -0,0 +1,18 @@
using System.ComponentModel.DataAnnotations;
using Govor.Core.Infrastructure.Validators;
namespace Govor.Contracts.Requests;
public record RegistrationRequest
{
[Required]
[StringLength(UserValidator.MAX_LENGHT_OF_NAME,
MinimumLength = UserValidator.MIN_LENGHT_OF_NAME,
ErrorMessage = "Username must be between 4 and 50 characters.")]
public string Name { get; init; }
[Required]
[MinLength(8)]
public string Password { get; init; }
[MinLength(InvitationValidator.MIN_INVITATION_LENGTH)]
public string InviteLink { get; init; }
}