Skip to content

Commit

Permalink
fix: validators bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-shirbandi committed Sep 4, 2024
1 parent b93e0c7 commit 4dc5508
Show file tree
Hide file tree
Showing 26 changed files with 26 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ public static void AddBuildingBlocksInfrastructure(
Type validatorAssemblyMarkerType
)
{
services.AddInMemoryBus(handlerAssemblyMarkerType);
services.AddApplicationExceptionHandlers();
services.AddApplicationBehaviors(validatorAssemblyMarkerType);
services.AddDomainNotificationHandler();

services.AddInMemoryBus(handlerAssemblyMarkerType);
services.AddMessageBus(configuration, consumerAssemblyMarkerType);
services.AddRedisEventStoreService();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

namespace TaskoMask.Services.Boards.Write.Api.UseCases.Boards.AddBoard;

public abstract class AddBoardValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : AddBoardRequest
public sealed class AddBoardValidation : AbstractValidator<AddBoardRequest>
{
public AddBoardValidation()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Boards.Write.Api.UseCases.Boards.DeleteBoard;

public abstract class DeleteBoardValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : DeleteBoardRequest
public sealed class DeleteBoardValidation : AbstractValidator<DeleteBoardRequest>
{
public DeleteBoardValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

namespace TaskoMask.Services.Boards.Write.Api.UseCases.Boards.UpdateBoard;

public abstract class UpdateBoardValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : UpdateBoardRequest
public sealed class UpdateBoardValidation : AbstractValidator<UpdateBoardRequest>
{
public UpdateBoardValidation()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Boards.Write.Api.UseCases.Cards.AddCard;

public abstract class AddCardValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : AddCardRequest
public sealed class AddCardValidation : AbstractValidator<AddCardRequest>
{
public AddCardValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Boards.Write.Api.UseCases.Cards.DeleteCard;

public abstract class DeleteCardValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : DeleteCardRequest
public sealed class DeleteCardValidation : AbstractValidator<DeleteCardRequest>
{
public DeleteCardValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Boards.Write.Api.UseCases.Cards.UpdateCard;

public abstract class UpdateCardValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : UpdateCardRequest
public sealed class UpdateCardValidation : AbstractValidator<UpdateCardRequest>
{
public UpdateCardValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Identity.Api.UseCases.RegisterUser;

public abstract class RegisterUserValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : RegisterUserRequest
public sealed class RegisterUserValidation : AbstractValidator<RegisterUserRequest>
{
public RegisterUserValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Identity.Api.UseCases.UpdateUser;

public abstract class UpdateUserValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : UpdateUserRequest
public sealed class UpdateUserValidation : AbstractValidator<UpdateUserRequest>
{
public UpdateUserValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Identity.Api.UseCases.UserLogin;

public abstract class UserLoginValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : UserLoginRequest
public sealed class UserLoginValidation : AbstractValidator<UserLoginRequest>
{
public UserLoginValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

namespace TaskoMask.Services.Owners.Write.Api.UseCases.Organizations.AddOrganization;

public abstract class AddOrganizationValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : AddOrganizationRequest
public sealed class AddOrganizationValidation : AbstractValidator<AddOrganizationRequest>
{
public AddOrganizationValidation()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Owners.Write.Api.UseCases.Organizations.DeleteOrganization;

public abstract class DeleteOrganizationValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : DeleteOrganizationRequest
public sealed class DeleteOrganizationValidation : AbstractValidator<DeleteOrganizationRequest>
{
public DeleteOrganizationValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

namespace TaskoMask.Services.Owners.Write.Api.UseCases.Organizations.UpdateOrganization;

public abstract class UpdateOrganizationValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : UpdateOrganizationRequest
public sealed class UpdateOrganizationValidation : AbstractValidator<UpdateOrganizationRequest>
{
public UpdateOrganizationValidation()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Owners.Write.Api.UseCases.Owners.RegisterOwner;

public abstract class RegiserOwnerValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : RegiserOwnerRequest
public sealed class RegiserOwnerValidation : AbstractValidator<RegiserOwnerRequest>
{
public RegiserOwnerValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Owners.Write.Api.UseCases.Owners.UpdateOwnerProfile;

public abstract class UpdateOwnerProfileValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : UpdateOwnerProfileRequest
public sealed class UpdateOwnerProfileValidation : AbstractValidator<UpdateOwnerProfileRequest>
{
public UpdateOwnerProfileValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

namespace TaskoMask.Services.Owners.Write.Api.UseCases.Projects.AddProject;

public abstract class AddProjectValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : AddProjectRequest
public sealed class AddProjectValidation : AbstractValidator<AddProjectRequest>
{
public AddProjectValidation()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Owners.Write.Api.UseCases.Projects.DeleteProject;

public abstract class DeleteProjectValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : DeleteProjectRequest
public sealed class DeleteProjectValidation : AbstractValidator<DeleteProjectRequest>
{
public DeleteProjectValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

namespace TaskoMask.Services.Owners.Write.Api.UseCases.Projects.UpdateProject;

public abstract class UpdateProjectValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : UpdateProjectRequest
public sealed class UpdateProjectValidation : AbstractValidator<UpdateProjectRequest>
{
public UpdateProjectValidation()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Tasks.Write.Api.UseCases.Comments.AddComment;

public abstract class AddCommentValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : AddCommentRequest
public sealed class AddCommentValidation : AbstractValidator<AddCommentRequest>
{
public AddCommentValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Tasks.Write.Api.UseCases.Comments.DeleteComment;

public abstract class DeleteCommentValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : DeleteCommentRequest
public sealed class DeleteCommentValidation : AbstractValidator<DeleteCommentRequest>
{
public DeleteCommentValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Tasks.Write.Api.UseCases.Comments.UpdateComment;

public abstract class UpdateCommentValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : UpdateCommentRequest
public sealed class UpdateCommentValidation : AbstractValidator<UpdateCommentRequest>
{
public UpdateCommentValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

namespace TaskoMask.Services.Tasks.Write.Api.UseCases.Tasks.AddTask;

public abstract class AddTaskValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : AddTaskRequest
public sealed class AddTaskValidation : AbstractValidator<AddTaskRequest>
{
public AddTaskValidation()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Tasks.Write.Api.UseCases.Tasks.DeleteTask;

public abstract class DeleteTaskValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : DeleteTaskRequest
public sealed class DeleteTaskValidation : AbstractValidator<DeleteTaskRequest>
{
public DeleteTaskValidation() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TaskoMask.Services.Tasks.Write.Api.UseCases.Tasks.MoveTaskToAnotherCard;

public abstract class MoveTaskToAnotherCardValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : MoveTaskToAnotherCardRequest
public sealed class MoveTaskToAnotherCardValidation : AbstractValidator<MoveTaskToAnotherCardRequest>
{
public MoveTaskToAnotherCardValidation() { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

namespace TaskoMask.Services.Tasks.Write.Api.UseCases.Tasks.UpdateTask;

public abstract class UpdateTaskValidation<TRequest> : AbstractValidator<TRequest>
where TRequest : UpdateTaskRequest
public sealed class UpdateTaskValidation : AbstractValidator<UpdateTaskRequest>
{
public UpdateTaskValidation()
{
Expand Down
2 changes: 1 addition & 1 deletion src/6-Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ internal class Build : NukeBuild
/// Then it will run dotnet format command to apply all the rules based on .editorconfig
/// If there are any violations, it will try to fix them automatically. But some of them like namming rules should be done manualy
/// In that case it will show you the file path and the reason of failure.
/// Run directyly : cmd> nuke Lint
/// Run directly : cmd> nuke Lint
/// </summary>
private Target Lint =>
_ =>
Expand Down

0 comments on commit 4dc5508

Please sign in to comment.