Create general structures in Mongo and SQL

This commit is contained in:
Sergio Matias Urquin
2025-05-18 15:49:46 -06:00
parent 144a6c14c0
commit c7953250fc
51 changed files with 370 additions and 365 deletions

View File

@@ -1,19 +1,21 @@
using Core.Blueprint.Application.UsesCases.BlobStorage.Adapter;
using Core.Blueprint.Application.UsesCases.BlobStorage.Input;
using Core.Blueprint.Application.UsesCases.BlobStorage.Ports;
using Core.Blueprint.Application.UsesCases.KeyVault.Adapter;
using Core.Blueprint.Application.UsesCases.KeyVault.Input;
using Core.Blueprint.Application.UsesCases.KeyVault.Ports;
using Core.Blueprint.Application.UsesCases.Mongo;
using Core.Blueprint.Application.UsesCases.Mongo.Adapter;
using Core.Blueprint.Application.UsesCases.Mongo.Input;
using Core.Blueprint.Application.UsesCases.Mongo.Ports;
using Core.Blueprint.Application.UsesCases.MongoStorage.Adapter;
using Core.Blueprint.Application.UsesCases.SQL;
using Core.Blueprint.Application.UsesCases.SQL.Adapter;
using Core.Blueprint.Application.UsesCases.SQL.Input;
using Core.Blueprint.Application.UsesCases.SQL.Ports;
using Core.Cerberos.Application.UseCases.Blueprints;
using Core.Cerberos.Application.UseCases.Blueprints.Validator;
using Core.Cerberos.Application.UseCases.KeyVault;
using Core.Cerberos.Application.UseCases.KeyVault.Validator;
using Core.Cerberos.Application.UseCases.Mongo.Validator;
using Core.Cerberos.Application.UseCases.SQL.Validator;
using Core.Cerberos.Application.UseCases.UserProjects;
using FluentValidation;
using Lib.Architecture.BuildingBlocks;
@@ -26,45 +28,45 @@ namespace Core.Blueprint.Service.API.Extensions
#region Mongo Services
services.AddScoped<IMongoPort, MongoPort>();
services.AddValidatorsFromAssemblyContaining<CreateBlueprintValidator>();
services.AddScoped<IValidator<CreateBlueprintRequest>, CreateBlueprintValidator>();
services.AddScoped<IComponentHandler<CreateBlueprintRequest>, MongoHandler>();
services.AddValidatorsFromAssemblyContaining<CreateSqlSampleValidator>();
services.AddScoped<IValidator<CreateMongoSampleRequest>, CreateMongoSampleValidator>();
services.AddScoped<IComponentHandler<CreateMongoSampleRequest>, MongoHandler>();
services.AddScoped<IComponentHandler<GetAllBlueprintsRequest>, MongoHandler>();
services.AddScoped<IComponentHandler<GetAllMongoSamplesRequest>, MongoHandler>();
services.AddValidatorsFromAssemblyContaining<GetBlueprintValidator>();
services.AddScoped<IValidator<GetBlueprintRequest>, GetBlueprintValidator>();
services.AddScoped<IComponentHandler<GetBlueprintRequest>, MongoHandler>();
services.AddValidatorsFromAssemblyContaining<GetSqlSampleValidator>();
services.AddScoped<IValidator<GetMongoSampleRequest>, GetMongoSampleValidator>();
services.AddScoped<IComponentHandler<GetMongoSampleRequest>, MongoHandler>();
services.AddValidatorsFromAssemblyContaining<UpdateBlueprintValidator>();
services.AddScoped<IValidator<UpdateBlueprintRequest>, UpdateBlueprintValidator>();
services.AddScoped<IComponentHandler<UpdateBlueprintRequest>, MongoHandler>();
services.AddValidatorsFromAssemblyContaining<UpdateSqlSampleValidator>();
services.AddScoped<IValidator<UpdateMongoSampleRequest>, UpdateMongoSampleValidator>();
services.AddScoped<IComponentHandler<UpdateMongoSampleRequest>, MongoHandler>();
services.AddValidatorsFromAssemblyContaining<DeleteBlueprintValidator>();
services.AddScoped<IValidator<DeleteBlueprintRequest>, DeleteBlueprintValidator>();
services.AddScoped<IComponentHandler<DeleteBlueprintRequest>, MongoHandler>();
services.AddValidatorsFromAssemblyContaining<DeleteSqlSampleValidator>();
services.AddScoped<IValidator<DeleteMongoSampleRequest>, DeleteMongoSampleValidator>();
services.AddScoped<IComponentHandler<DeleteMongoSampleRequest>, MongoHandler>();
#endregion
#region SQL Services
services.AddScoped<ISQLPort, SQLPort>();
services.AddValidatorsFromAssemblyContaining<CreateUserProjectValidator>();
services.AddScoped<IValidator<CreateUserProjectRequest>, CreateUserProjectValidator>();
services.AddScoped<IComponentHandler<CreateUserProjectRequest>, SQLHandler>();
services.AddValidatorsFromAssemblyContaining<CreateSqlSampleValidator>();
services.AddScoped<IValidator<CreateSqlSampleRequest>, CreateSqlSampleValidator>();
services.AddScoped<IComponentHandler<CreateSqlSampleRequest>, SQLHandler>();
services.AddScoped<IComponentHandler<GetAllUserProjectsRequest>, SQLHandler>();
services.AddScoped<IComponentHandler<GetAllSqlSamplesRequest>, SQLHandler>();
services.AddValidatorsFromAssemblyContaining<GetUserProjectValidator>();
services.AddScoped<IValidator<GetUserProjectRequest>, GetUserProjectValidator>();
services.AddScoped<IComponentHandler<GetUserProjectRequest>, SQLHandler>();
services.AddValidatorsFromAssemblyContaining<GetSqlSampleValidator>();
services.AddScoped<IValidator<GetSqlSampleRequest>, GetSqlSampleValidator>();
services.AddScoped<IComponentHandler<GetSqlSampleRequest>, SQLHandler>();
services.AddValidatorsFromAssemblyContaining<UpdateUserProjectValidator>();
services.AddScoped<IValidator<UpdateUserProjectRequest>, UpdateUserProjectValidator>();
services.AddScoped<IComponentHandler<UpdateUserProjectRequest>, SQLHandler>();
services.AddValidatorsFromAssemblyContaining<UpdateSqlSampleValidator>();
services.AddScoped<IValidator<UpdateSqlSampleRequest>, UpdateSqlSampleValidator>();
services.AddScoped<IComponentHandler<UpdateSqlSampleRequest>, SQLHandler>();
services.AddValidatorsFromAssemblyContaining<DeleteUserProjectValidator>();
services.AddScoped<IValidator<DeleteUserProjectRequest>, DeleteUserProjectValidator>();
services.AddScoped<IComponentHandler<DeleteUserProjectRequest>, SQLHandler>();
services.AddValidatorsFromAssemblyContaining<DeleteSqlSampleValidator>();
services.AddScoped<IValidator<DeleteSqlSampleRequest>, DeleteSqlSampleValidator>();
services.AddScoped<IComponentHandler<DeleteSqlSampleRequest>, SQLHandler>();
#endregion
#region KeyVault Services