Skip to content

Commit

Permalink
113: Moved Settings & Results to common (SOFTURE) packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jarmatys committed Aug 7, 2024
1 parent 7fd2148 commit cdb8095
Show file tree
Hide file tree
Showing 86 changed files with 99 additions and 248 deletions.
2 changes: 1 addition & 1 deletion API/ASSISTENTE.API/Common/Extensions/CommonExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using ASSISTENTE.Common.Authentication;
using ASSISTENTE.Common.Authentication.Settings;
using ASSISTENTE.Common.Correlation;
using ASSISTENTE.Common.Extensions;
using ASSISTENTE.Common.Logging;
using ASSISTENTE.Common.Logging.Settings;
using ASSISTENTE.Common.Observability;
using ASSISTENTE.Common.Observability.Settings;
using ASSISTENTE.MessageBroker.Rabbit;
using ASSISTENTE.MessageBroker.Rabbit.Settings;
using SOFTURE.Settings.Extensions;

namespace ASSISTENTE.API.Common.Extensions;

Expand Down
2 changes: 1 addition & 1 deletion API/ASSISTENTE.API/Endpoints/EndpointBase.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using ASSISTENTE.API.Common.Extensions;
using ASSISTENTE.Common.Results;
using CSharpFunctionalExtensions;
using FastEndpoints;
using FluentValidation.Results;
using MediatR;
using Microsoft.AspNetCore.Cors;
using SOFTURE.Contract.Common.RequestBases;
using SOFTURE.Results;

namespace ASSISTENTE.API.Endpoints;

Expand Down
2 changes: 1 addition & 1 deletion API/ASSISTENTE.API/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using ASSISTENTE.API;
using ASSISTENTE.API.Common.Extensions;
using ASSISTENTE.Common.Extensions;
using ASSISTENTE.Common.HealthCheck;
using ASSISTENTE.Common.Observability;
using SOFTURE.Settings.Extensions;

var configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ASSISTENTE.Common\ASSISTENTE.Common.csproj"/>
<ProjectReference Include="..\ASSISTENTE.Domain\ASSISTENTE.Domain.csproj"/>
<ProjectReference Include="..\ASSISTENTE.Contract.Requests.Internal\ASSISTENTE.Contract.Requests.Internal.csproj"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="SOFTURE.Results" Version="0.0.7" />
<PackageReference Include="SOFTURE.Settings" Version="0.0.7" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ASSISTENTE.Common.Results;
using ASSISTENTE.Domain.Common.Interfaces;
using SOFTURE.Results;

namespace ASSISTENTE.Application.Abstractions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ASSISTENTE.Common\ASSISTENTE.Common.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentValidation" Version="11.9.0" />
<PackageReference Include="MediatR" Version="12.2.0" />
<PackageReference Include="SOFTURE.Results" Version="0.0.7" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ASSISTENTE.Common.Results;
using CSharpFunctionalExtensions;
using CSharpFunctionalExtensions;
using FluentValidation;
using MediatR;
using SOFTURE.Results;

namespace ASSISTENTE.Application.Middlewares.Behaviours
{
Expand Down
1 change: 1 addition & 0 deletions API/ASSISTENTE.Application/ASSISTENTE.Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<ItemGroup>
<ProjectReference Include="..\ASSISTENTE.Application.Abstractions\ASSISTENTE.Application.Abstractions.csproj" />
<ProjectReference Include="..\ASSISTENTE.Application.Middlewares\ASSISTENTE.Application.Middlewares.csproj" />
<ProjectReference Include="..\ASSISTENTE.Common.Logging\ASSISTENTE.Common.Logging.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static LearnCommand Create()
public class LearnCommandHandler(
IFileParser fileParser,
IKnowledgeService knowledgeService,
ILogger<LearnCommandHandler> logger)
ILogger logger)
: IRequestHandler<LearnCommand, Result>
{
public async Task<Result> Handle(LearnCommand request, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class CreateEmbeddingsCommandHandler(
IQuestionOrchestrator questionOrchestrator,
IQuestionRepository questionRepository,
IAssistenteClientInternal clientInternal,
ILogger<CreateEmbeddingsCommand> logger) : QuestionCommandBase<CreateEmbeddingsCommand>(logger, clientInternal)
ILogger logger) : QuestionCommandBase<CreateEmbeddingsCommand>(logger, clientInternal)
{
protected override async Task<Result> HandleAsync(Question question)
=> await questionOrchestrator.CreateEmbedding(question);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static CreateQuestionCommand Create(CreateQuestionRequest payload)

public class CreateQuestionCommandHandler(
IQuestionOrchestrator questionOrchestrator,
ILogger<CreateQuestionCommandHandler> logger)
ILogger logger)
: IRequestHandler<CreateQuestionCommand, Result>
{
public async Task<Result> Handle(CreateQuestionCommand request, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class FindFilesCommandHandler(
IQuestionOrchestrator questionOrchestrator,
IQuestionRepository questionRepository,
IAssistenteClientInternal clientInternal,
ILogger<FindFilesCommandHandler> logger) : QuestionCommandBase<FindFilesCommand>(logger, clientInternal)
ILogger logger) : QuestionCommandBase<FindFilesCommand>(logger, clientInternal)
{
protected override async Task<Result> HandleAsync(Question question)
=> await questionOrchestrator.FindFiles(question);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class FindResourcesCommandHandler(
IQuestionOrchestrator questionOrchestrator,
IQuestionRepository questionRepository,
IAssistenteClientInternal clientInternal,
ILogger<FindResourcesCommandHandler> logger) : QuestionCommandBase<FindResourcesCommand>(logger, clientInternal)
ILogger logger) : QuestionCommandBase<FindResourcesCommand>(logger, clientInternal)
{
protected override async Task<Result> HandleAsync(Question question)
=> await questionOrchestrator.FindResources(question);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class GenerateAnswerCommandHandler(
IQuestionOrchestrator questionOrchestrator,
IQuestionRepository questionRepository,
IAssistenteClientInternal clientInternal,
ILogger<GenerateAnswerCommandHandler> logger) : QuestionCommandBase<GenerateAnswerCommand>(logger, clientInternal)
ILogger logger) : QuestionCommandBase<GenerateAnswerCommand>(logger, clientInternal)
{
protected override async Task<Result> HandleAsync(Question question)
=> await questionOrchestrator.GenerateAnswer(question);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static NotifyQuestionReadinessCommand Create(QuestionId questionId)
public class NotifyQuestionReadinessCommandHandler(
IQuestionRepository questionRepository,
IAssistenteClientInternal clientInternal,
ILogger<NotifyQuestionReadinessCommandHandler> logger)
ILogger logger)
: IRequestHandler<NotifyQuestionReadinessCommand, Result>
{
public async Task<Result> Handle(NotifyQuestionReadinessCommand request, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ResolveQuestionCommandHandler(
IQuestionOrchestrator questionOrchestrator,
IQuestionRepository questionRepository,
IAssistenteClientInternal clientInternal,
ILogger<ResolveQuestionCommandHandler> logger) : QuestionCommandBase<ResolveContextCommand>(logger, clientInternal)
ILogger logger) : QuestionCommandBase<ResolveContextCommand>(logger, clientInternal)
{
protected override async Task<Result> HandleAsync(Question question)
=> await questionOrchestrator.ResolveContext(question);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
<ProjectReference Include="..\ASSISTENTE.Common.HealthCheck\ASSISTENTE.Common.HealthCheck.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="SOFTURE.Results" Version="0.0.7" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ASSISTENTE.Common\ASSISTENTE.Common.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.6" />
<PackageReference Include="SOFTURE.Settings" Version="0.0.7" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Text;
using ASSISTENTE.Common.Authentication.Settings;
using ASSISTENTE.Common.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Tokens;
using SOFTURE.Settings.Extensions;

namespace ASSISTENTE.Common.Authentication
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ASSISTENTE.Common\ASSISTENTE.Common.csproj" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="SOFTURE.Results" Version="0.0.7" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ASSISTENTE.Common\ASSISTENTE.Common.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.1" />
<PackageReference Include="SOFTURE.Results" Version="0.0.7" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1"/>
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1"/>
<PackageReference Include="Serilog.Sinks.Seq" Version="5.1.0"/>
<PackageReference Include="SOFTURE.Results" Version="0.0.7" />
<PackageReference Include="SOFTURE.Settings" Version="0.0.7" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ASSISTENTE.Common.HealthCheck\ASSISTENTE.Common.HealthCheck.csproj" />
<ProjectReference Include="..\ASSISTENTE.Common\ASSISTENTE.Common.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion API/ASSISTENTE.Common.Logging/DependencyInjection.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.Reflection;
using ASSISTENTE.Common.Extensions;
using ASSISTENTE.Common.HealthCheck;
using ASSISTENTE.Common.Logging.HealthChecks;
using ASSISTENTE.Common.Logging.Settings;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Serilog;
using Serilog.Events;
using SOFTURE.Settings.Extensions;

namespace ASSISTENTE.Common.Logging;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using ASSISTENTE.Common.Results;
using CSharpFunctionalExtensions;
using Microsoft.Extensions.Logging;
using SOFTURE.Results;

namespace ASSISTENTE.Common.Extensions;
namespace ASSISTENTE.Common.Logging.Extensions;

public static class LogExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta.11" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ASSISTENTE.Common\ASSISTENTE.Common.csproj" />
<PackageReference Include="SOFTURE.Settings" Version="0.0.7" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion API/ASSISTENTE.Common.Observability/DependencyInjection.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.Reflection;
using ASSISTENTE.Common.Extensions;
using ASSISTENTE.Common.Observability.Settings;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Npgsql;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using SOFTURE.Settings.Extensions;

namespace ASSISTENTE.Common.Observability;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ASSISTENTE.Common\ASSISTENTE.Common.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.6.0" />
<PackageReference Include="Microsoft.Extensions.Resilience" Version="8.6.0" />
Expand Down
18 changes: 0 additions & 18 deletions API/ASSISTENTE.Common/ASSISTENTE.Common.csproj

This file was deleted.

9 changes: 0 additions & 9 deletions API/ASSISTENTE.Common/Errors/CommonErrors.cs

This file was deleted.

3 changes: 0 additions & 3 deletions API/ASSISTENTE.Common/Exceptions/SettingsException.cs

This file was deleted.

16 changes: 0 additions & 16 deletions API/ASSISTENTE.Common/Extensions/ServiceCollectionExtensions.cs

This file was deleted.

Loading

0 comments on commit cdb8095

Please sign in to comment.