2025-01-10 15:59:51 -05:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using OpenHarbor.CQRS.Abstractions;
|
|
|
|
using OpenHarbor.CQRS.FluentValidation;
|
2025-01-09 16:14:34 -05:00
|
|
|
namespace CH.CQRS.Command.Energy;
|
|
|
|
|
2025-01-10 15:59:51 -05:00
|
|
|
public static class ServiceCollectionExtension
|
2025-01-09 16:14:34 -05:00
|
|
|
{
|
2025-01-10 15:59:51 -05:00
|
|
|
public static IServiceCollection AddEnergyCommand(this IServiceCollection services)
|
|
|
|
{
|
|
|
|
services
|
|
|
|
.AddCommand<CreateEnergyProviderCommand, CreateEnergyProviderCommandHandler,
|
|
|
|
CreateEnergyProviderCommandValidator>();
|
|
|
|
services
|
|
|
|
.AddCommand<CreateEnergyRateExceptionCommand, CreateEnergyRateExceptionCommandHandler,
|
|
|
|
CreateEnergyRateExceptionCommandValidator>();
|
|
|
|
services
|
|
|
|
.AddCommand<CreateEnergyRateCommand, CreateEnergyRateCommandHandler,
|
|
|
|
CreateEnergyRateCommandValidator>();
|
|
|
|
services
|
|
|
|
.AddCommand<DisableEnergyProviderCommand, DisableEnergyProviderCommandHandler,
|
|
|
|
DisableEnergyProviderCommandValidator>();
|
|
|
|
services
|
|
|
|
.AddCommand<DisableEnergyRateCommand, DisableEnergyRateCommandHandler,
|
|
|
|
DisableEnergyRateCommandValidator>();
|
|
|
|
services
|
|
|
|
.AddCommand<UpdateEnergyProviderCommand, UpdateEnergyProviderCommandHandler,
|
|
|
|
UpdateEnergyProviderCommandValidator>();
|
|
|
|
services
|
|
|
|
.AddCommand<UpdateEnergyRateCommand, UpdateEnergyRateCommandHandler,
|
|
|
|
UpdateEnergyRateCommandValidator>();
|
|
|
|
services
|
|
|
|
.AddCommand<UpdateEnergyRateExceptionCommand, UpdateEnergyRateExceptionCommandHandler,
|
|
|
|
UpdateEnergyRateExceptionCommandValidator>();
|
2025-01-09 16:14:34 -05:00
|
|
|
|
2025-01-10 15:59:51 -05:00
|
|
|
return services;
|
|
|
|
}
|
2025-01-09 16:14:34 -05:00
|
|
|
}
|