Merge branch 'feature/waiter-floor-bff-boundary' into development

This commit is contained in:
José René White Enciso 2026-02-25 18:18:19 -06:00
commit fb0f08bd31
16 changed files with 159 additions and 0 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
.tasks/ .tasks/
.agile/ .agile/
**/bin/
**/obj/

10
Directory.Build.props Normal file
View File

@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<Authors>AgileWebs</Authors>
<Company>AgileWebs</Company>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>http://192.168.68.156:3000/AgileWebs/waiter-floor-bff</RepositoryUrl>
<PackageProjectUrl>http://192.168.68.156:3000/AgileWebs/waiter-floor-bff</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
</PropertyGroup>
</Project>

7
Waiter.Floor.Bff.slnx Normal file
View File

@ -0,0 +1,7 @@
<Solution>
<Folder Name="/src/">
<Project Path="src/Waiter.Floor.Bff.Application/Waiter.Floor.Bff.Application.csproj" />
<Project Path="src/Waiter.Floor.Bff.Contracts/Waiter.Floor.Bff.Contracts.csproj" />
<Project Path="src/Waiter.Floor.Bff.Rest/Waiter.Floor.Bff.Rest.csproj" />
</Folder>
</Solution>

View File

@ -0,0 +1,12 @@
using Waiter.Floor.Bff.Contracts.Requests;
using Waiter.Floor.Bff.Contracts.Responses;
namespace Waiter.Floor.Bff.Application.Adapters;
public sealed class DefaultWaiterServiceClient : IWaiterServiceClient
{
public Task<GetWaiterAssignmentsResponse> FetchAsync(GetWaiterAssignmentsRequest request, CancellationToken cancellationToken)
{
return Task.FromResult(new GetWaiterAssignmentsResponse(request.ContextId, "Default service-backed response."));
}
}

View File

@ -0,0 +1,9 @@
using Waiter.Floor.Bff.Contracts.Requests;
using Waiter.Floor.Bff.Contracts.Responses;
namespace Waiter.Floor.Bff.Application.Adapters;
public interface IWaiterServiceClient
{
Task<GetWaiterAssignmentsResponse> FetchAsync(GetWaiterAssignmentsRequest request, CancellationToken cancellationToken);
}

View File

@ -0,0 +1,13 @@
using Waiter.Floor.Bff.Application.Adapters;
using Waiter.Floor.Bff.Contracts.Requests;
using Waiter.Floor.Bff.Contracts.Responses;
namespace Waiter.Floor.Bff.Application.Handlers;
public sealed class GetWaiterAssignmentsHandler(IWaiterServiceClient serviceClient) : IGetWaiterAssignmentsHandler
{
public Task<GetWaiterAssignmentsResponse> HandleAsync(GetWaiterAssignmentsRequest request, CancellationToken cancellationToken)
{
return serviceClient.FetchAsync(request, cancellationToken);
}
}

View File

@ -0,0 +1,9 @@
using Waiter.Floor.Bff.Contracts.Requests;
using Waiter.Floor.Bff.Contracts.Responses;
namespace Waiter.Floor.Bff.Application.Handlers;
public interface IGetWaiterAssignmentsHandler
{
Task<GetWaiterAssignmentsResponse> HandleAsync(GetWaiterAssignmentsRequest request, CancellationToken cancellationToken);
}

View File

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Waiter.Floor.Bff.Contracts\Waiter.Floor.Bff.Contracts.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,3 @@
namespace Waiter.Floor.Bff.Contracts.Requests;
public sealed record GetWaiterAssignmentsRequest(string ContextId);

View File

@ -0,0 +1,3 @@
namespace Waiter.Floor.Bff.Contracts.Responses;
public sealed record GetWaiterAssignmentsResponse(string ContextId, string Summary);

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,17 @@
using Waiter.Floor.Bff.Application.Adapters;
using Waiter.Floor.Bff.Application.Handlers;
using Waiter.Floor.Bff.Contracts.Requests;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton<IWaiterServiceClient, DefaultWaiterServiceClient>();
builder.Services.AddSingleton<IGetWaiterAssignmentsHandler, GetWaiterAssignmentsHandler>();
var app = builder.Build();
app.MapGet("/api/waiter/floor/assignments", async (string contextId, IGetWaiterAssignmentsHandler handler, CancellationToken ct) =>
{
var request = new GetWaiterAssignmentsRequest(contextId);
return Results.Ok(await handler.HandleAsync(request, ct));
});
app.Run();

View File

@ -0,0 +1,23 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:0",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:0;http://localhost:0",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Waiter.Floor.Bff.Application\Waiter.Floor.Bff.Application.csproj" />
<ProjectReference Include="..\Waiter.Floor.Bff.Contracts\Waiter.Floor.Bff.Contracts.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}