Merge pull request #270 from meysamhadeli/refactor/refactor-access-modifieres-in-feature-slices

refactor: Refactor access modifiers in feature slices
This commit is contained in:
Meysam Hadeli 2023-07-16 16:59:13 +03:30 committed by GitHub
commit b4fd4d512b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 41 additions and 47 deletions

View File

@ -3,7 +3,7 @@ using Mapster;
namespace Booking.Booking.Features;
using CreatingBook.Commands.V1;
using CreatingBook.V1;
public class BookingMappings : IRegister
{

View File

@ -1,4 +1,4 @@
namespace Booking.Booking.Features.CreatingBook.Commands.V1;
namespace Booking.Booking.Features.CreatingBook.V1;
using Ardalis.GuardClauses;
using BuildingBlocks.Core;
@ -8,7 +8,6 @@ using BuildingBlocks.Core.Model;
using BuildingBlocks.EventStoreDB.Repository;
using BuildingBlocks.Web;
using Duende.IdentityServer.EntityFramework.Entities;
using Elasticsearch.Net;
using Exceptions;
using Flight;
using FluentValidation;
@ -22,8 +21,7 @@ using Microsoft.AspNetCore.Routing;
using Passenger;
using ValueObjects;
public record CreateBooking(Guid PassengerId, Guid FlightId, string Description) : ICommand<CreateBookingResult>,
IInternalCommand
public record CreateBooking(Guid PassengerId, Guid FlightId, string Description) : ICommand<CreateBookingResult>
{
public Guid Id { get; init; } = NewId.NextGuid();
}
@ -66,7 +64,7 @@ public class CreateBookingEndpoint : IMinimalEndpoint
}
}
internal class CreateBookingValidator : AbstractValidator<CreateBooking>
public class CreateBookingValidator : AbstractValidator<CreateBooking>
{
public CreateBookingValidator()
{

View File

@ -2,7 +2,7 @@ using BuildingBlocks.EventStoreDB.Events;
namespace Booking.Booking.Models;
using Features.CreatingBook.Commands.V1;
using Features.CreatingBook.V1;
using ValueObjects;
public record Booking : AggregateEventSourcing<Guid>

View File

@ -7,7 +7,7 @@ using MongoDB.Driver.Linq;
namespace Booking;
using Booking.Features.CreatingBook.Commands.V1;
using Booking.Features.CreatingBook.V1;
using Booking.Models;
using MassTransit;

View File

@ -4,7 +4,7 @@ using BuildingBlocks.Core.Event;
namespace Booking;
using Booking.Features.CreatingBook.Commands.V1;
using Booking.Features.CreatingBook.V1;
public sealed class EventMapper : IEventMapper
{

View File

@ -3,7 +3,7 @@
namespace Integration.Test.Fakes;
using System;
using global::Booking.Booking.Features.CreatingBook.Commands.V1;
using global::Booking.Booking.Features.CreatingBook.V1;
using MassTransit;
public sealed class FakeCreateBookingCommand : AutoFaker<CreateBooking>

View File

@ -68,7 +68,7 @@ public class CreateAircraftEndpoint : IMinimalEndpoint
}
}
internal class CreateAircraftValidator : AbstractValidator<CreateAircraft>
public class CreateAircraftValidator : AbstractValidator<CreateAircraft>
{
public CreateAircraftValidator()
{

View File

@ -17,7 +17,7 @@ using ValueObjects;
public record CreateAircraftMongo(Guid Id, string Name, string Model, int ManufacturingYear, bool IsDeleted = false) : InternalCommand;
public class CreateAircraftMongoHandler : ICommandHandler<CreateAircraftMongo>
internal class CreateAircraftMongoHandler : ICommandHandler<CreateAircraftMongo>
{
private readonly FlightReadDbContext _flightReadDbContext;
private readonly IMapper _mapper;

View File

@ -65,7 +65,7 @@ public class CreateAirportEndpoint : IMinimalEndpoint
}
}
internal class CreateAirportValidator : AbstractValidator<CreateAirport>
public class CreateAirportValidator : AbstractValidator<CreateAirport>
{
public CreateAirportValidator()
{

View File

@ -11,7 +11,7 @@ using Flights.Features.CreatingFlight.V1;
using Flights.Features.DeletingFlight.V1;
using Flights.Features.UpdatingFlight.V1;
using Seats.Features.CreatingSeat.V1;
using Seats.Features.ReservingSeat.Commands.V1;
using Seats.Features.ReservingSeat.V1;
// ref: https://www.ledjonbehluli.com/posts/domain_to_integration_event/
public sealed class EventMapper : IEventMapper

View File

@ -53,7 +53,7 @@ public class DeleteFlightEndpoint : IMinimalEndpoint
}
}
internal class DeleteFlightValidator : AbstractValidator<DeleteFlight>
public class DeleteFlightValidator : AbstractValidator<DeleteFlight>
{
public DeleteFlightValidator()
{

View File

@ -61,7 +61,7 @@ public class GetFlightByIdValidator : AbstractValidator<GetFlightById>
}
}
public class GetFlightByIdHandler : IQueryHandler<GetFlightById, GetFlightByIdResult>
internal class GetFlightByIdHandler : IQueryHandler<GetFlightById, GetFlightByIdResult>
{
private readonly IMapper _mapper;
private readonly FlightReadDbContext _flightReadDbContext;

View File

@ -70,7 +70,7 @@ public class UpdateFlightEndpoint : IMinimalEndpoint
}
}
internal class UpdateFlightValidator : AbstractValidator<CreateFlight>
public class UpdateFlightValidator : AbstractValidator<CreateFlight>
{
public UpdateFlightValidator()
{

View File

@ -8,7 +8,7 @@ namespace Flight.GrpcServer.Services;
using System;
using Flights.Features.GettingFlightById.V1;
using Seats.Features.GettingAvailableSeats.V1;
using Seats.Features.ReservingSeat.Commands.V1;
using Seats.Features.ReservingSeat.V1;
using GetAvailableSeatsResult = GetAvailableSeatsResult;
using GetFlightByIdResult = GetFlightByIdResult;
using ReserveSeatResult = ReserveSeatResult;

View File

@ -1,7 +1,6 @@
namespace Flight.Seats.Features.CreatingSeat.V1;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Ardalis.GuardClauses;
@ -9,9 +8,9 @@ using BuildingBlocks.Core.CQRS;
using BuildingBlocks.Core.Event;
using BuildingBlocks.Web;
using Duende.IdentityServer.EntityFramework.Entities;
using Flight.Data;
using Flight.Seats.Exceptions;
using Flight.Seats.Models;
using Data;
using Exceptions;
using Models;
using Flights.ValueObjects;
using FluentValidation;
using Mapster;
@ -71,7 +70,7 @@ public class CreateSeatEndpoint : IMinimalEndpoint
}
}
internal class CreateSeatValidator : AbstractValidator<CreateSeat>
public class CreateSeatValidator : AbstractValidator<CreateSeat>
{
public CreateSeatValidator()
{

View File

@ -6,9 +6,9 @@ using System.Threading.Tasks;
using Ardalis.GuardClauses;
using BuildingBlocks.Core.CQRS;
using BuildingBlocks.Core.Event;
using Flight.Data;
using Flight.Seats.Exceptions;
using Flight.Seats.Models;
using Data;
using Exceptions;
using Models;
using MapsterMapper;
using MediatR;
using MongoDB.Driver;
@ -17,7 +17,7 @@ using MongoDB.Driver.Linq;
public record CreateSeatMongo(Guid Id, string SeatNumber, Enums.SeatType Type,
Enums.SeatClass Class, Guid FlightId, bool IsDeleted = false) : InternalCommand;
public class CreateSeatMongoHandler : ICommandHandler<CreateSeatMongo>
internal class CreateSeatMongoHandler : ICommandHandler<CreateSeatMongo>
{
private readonly FlightReadDbContext _flightReadDbContext;
private readonly IMapper _mapper;

View File

@ -55,7 +55,7 @@ public class GetAvailableSeatsEndpoint : IMinimalEndpoint
}
}
internal class GetAvailableSeatsValidator : AbstractValidator<GetAvailableSeats>
public class GetAvailableSeatsValidator : AbstractValidator<GetAvailableSeats>
{
public GetAvailableSeatsValidator()
{

View File

@ -1,4 +1,4 @@
namespace Flight.Seats.Features.ReservingSeat.Commands.V1;
namespace Flight.Seats.Features.ReservingSeat.V1;
using System;
using System.Threading;
@ -7,10 +7,9 @@ using Ardalis.GuardClauses;
using BuildingBlocks.Core.CQRS;
using BuildingBlocks.Core.Event;
using BuildingBlocks.Web;
using Data;
using Duende.IdentityServer.EntityFramework.Entities;
using Exceptions;
using Flights.ValueObjects;
using Flight.Data;
using Flight.Seats.Exceptions;
using FluentValidation;
using Mapster;
using MapsterMapper;
@ -19,7 +18,6 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.EntityFrameworkCore;
using ValueObjects;
public record ReserveSeat(Guid FlightId, string SeatNumber) : ICommand<ReserveSeatResult>, IInternalCommand;
@ -63,7 +61,7 @@ public class ReserveSeatEndpoint : IMinimalEndpoint
}
}
internal class ReserveSeatValidator : AbstractValidator<ReserveSeat>
public class ReserveSeatValidator : AbstractValidator<ReserveSeat>
{
public ReserveSeatValidator()
{

View File

@ -1,4 +1,4 @@
namespace Flight.Seats.Features.ReservingSeat.Commands.V1;
namespace Flight.Seats.Features.ReservingSeat.V1;
using System;
using System.Threading;

View File

@ -6,7 +6,7 @@ namespace Flight.Seats.Features;
using CreatingSeat.V1;
using MassTransit;
using ReservingSeat.Commands.V1;
using ReservingSeat.V1;
public class SeatMappings : IRegister
{

View File

@ -4,7 +4,7 @@ using BuildingBlocks.Core.Model;
namespace Flight.Seats.Models;
using Features.CreatingSeat.V1;
using Features.ReservingSeat.Commands.V1;
using Features.ReservingSeat.V1;
using Flight.Flights.ValueObjects;
using ValueObjects;

View File

@ -62,7 +62,7 @@ public class RegisterNewUserEndpoint : IMinimalEndpoint
}
}
internal class RegisterNewUserValidator : AbstractValidator<RegisterNewUser>
public class RegisterNewUserValidator : AbstractValidator<RegisterNewUser>
{
public RegisterNewUserValidator()
{

View File

@ -4,7 +4,7 @@ using MediatR;
namespace Passenger.GrpcServer.Services;
using Mapster;
using Passengers.Features.GettingPassengerById.Queries.V1;
using Passengers.Features.GettingPassengerById.V1;
using GetPassengerByIdResult = Passenger.GetPassengerByIdResult;
public class PassengerGrpcServices : PassengerGrpcService.PassengerGrpcServiceBase

View File

@ -65,7 +65,7 @@ public class CompleteRegisterPassengerEndpoint : IMinimalEndpoint
}
}
internal class CompleteRegisterPassengerValidator : AbstractValidator<CompleteRegisterPassenger>
public class CompleteRegisterPassengerValidator : AbstractValidator<CompleteRegisterPassenger>
{
public CompleteRegisterPassengerValidator()
{

View File

@ -1,12 +1,9 @@
namespace Passenger.Passengers.Features.GettingPassengerById.Queries.V1;
namespace Passenger.Passengers.Features.GettingPassengerById.V1;
using Ardalis.GuardClauses;
using BuildingBlocks.Core.CQRS;
using BuildingBlocks.Web;
using Data;
using Dtos;
using Duende.IdentityServer.EntityFramework.Entities;
using Exceptions;
using FluentValidation;
using Mapster;
using MapsterMapper;
@ -16,7 +13,9 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using ValueObjects;
using Passenger.Data;
using Passenger.Passengers.Dtos;
using Passenger.Passengers.Exceptions;
public record GetPassengerById(Guid Id) : IQuery<GetPassengerByIdResult>;
@ -51,7 +50,7 @@ public class GetPassengerByIdEndpoint : IMinimalEndpoint
}
}
internal class GetPassengerByIdValidator : AbstractValidator<GetPassengerById>
public class GetPassengerByIdValidator : AbstractValidator<GetPassengerById>
{
public GetPassengerByIdValidator()
{

View File

@ -9,7 +9,7 @@ using Xunit;
namespace Integration.Test.Passenger.Features;
using global::Passenger.Passengers.Features.GettingPassengerById.Queries.V1;
using global::Passenger.Passengers.Features.GettingPassengerById.V1;
using Humanizer;
using Thrift.Protocol;