mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 11:44:56 +00:00
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:
@@ -0,0 +1,13 @@
|
||||
namespace Govor.Contracts.DTOs;
|
||||
|
||||
public class InvitationDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public bool IsAdmin { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public string Code {get; set;}
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime EndAt { get; set; }
|
||||
public int MaxParticipants { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Govor.Core\Govor.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
Reference in New Issue
Block a user