Skip to content

Commit 9d56f6d

Browse files
author
Filipe Frigini
committed
fix: resolve compilation errors in ServiceCatalogs Phase 1b
- Add missing DisplayOrder parameter to ModuleServiceDto constructors - Fix ModuleServiceListDto constructor parameter order - Remove 'required' modifier from ValidateServicesResponse properties (conflicts with constructor) - Update ValidateServicesEndpoint to use concrete ServiceCatalogsModuleApi type
1 parent dc29e7c commit 9d56f6d

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/Modules/ServiceCatalogs/API/Endpoints/Service/ValidateServicesEndpoint.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using MeAjudaAi.Modules.ServiceCatalogs.Application.DTOs.Requests.Service;
2+
using MeAjudaAi.Modules.ServiceCatalogs.Application.ModuleApi;
23
using MeAjudaAi.Shared.Authorization;
34
using MeAjudaAi.Shared.Contracts;
4-
using MeAjudaAi.Shared.Contracts.Modules.ServiceCatalogs;
5+
// TODO Phase 2: Uncomment when shared contracts are added
6+
// using MeAjudaAi.Shared.Contracts.Modules.ServiceCatalogs;
57
using MeAjudaAi.Shared.Endpoints;
68
using MeAjudaAi.Shared.Functional;
79
using Microsoft.AspNetCore.Builder;
@@ -22,7 +24,7 @@ public static void Map(IEndpointRouteBuilder app)
2224

2325
private static async Task<IResult> ValidateAsync(
2426
[FromBody] ValidateServicesRequest request,
25-
[FromServices] IServiceCatalogsModuleApi moduleApi,
27+
[FromServices] ServiceCatalogsModuleApi moduleApi,
2628
CancellationToken cancellationToken)
2729
{
2830
var result = await moduleApi.ValidateServicesAsync(request.ServiceIds, cancellationToken);

src/Modules/ServiceCatalogs/Application/DTOs/Requests/Service/ValidateServicesResponse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ namespace MeAjudaAi.Modules.ServiceCatalogs.Application.DTOs.Requests.Service;
33
public sealed record ValidateServicesResponse
44
{
55
public bool AllValid { get; init; }
6-
public required IReadOnlyCollection<Guid> InvalidServiceIds { get; init; }
7-
public required IReadOnlyCollection<Guid> InactiveServiceIds { get; init; }
6+
public IReadOnlyCollection<Guid> InvalidServiceIds { get; init; }
7+
public IReadOnlyCollection<Guid> InactiveServiceIds { get; init; }
88

99
public ValidateServicesResponse(bool allValid, IReadOnlyCollection<Guid>? invalidServiceIds, IReadOnlyCollection<Guid>? inactiveServiceIds)
1010
{

src/Modules/ServiceCatalogs/Application/ModuleApi/ServiceCatalogsModuleApi.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ public async Task<Result<IReadOnlyList<ModuleServiceCategoryDto>>> GetAllService
138138
categoryName,
139139
service.Name,
140140
service.Description,
141-
service.IsActive
141+
service.IsActive,
142+
service.DisplayOrder
142143
);
143144

144145
return Result<ModuleServiceDto?>.Success(dto);
@@ -160,8 +161,8 @@ public async Task<Result<IReadOnlyList<ModuleServiceListDto>>> GetAllServicesAsy
160161

161162
var dtos = services.Select(s => new ModuleServiceListDto(
162163
s.Id.Value,
163-
s.CategoryId.Value,
164164
s.Name,
165+
s.Description,
165166
s.IsActive
166167
)).ToList();
167168

@@ -193,7 +194,8 @@ public async Task<Result<IReadOnlyList<ModuleServiceDto>>> GetServicesByCategory
193194
s.Category?.Name ?? ValidationMessages.Catalogs.UnknownCategoryName,
194195
s.Name,
195196
s.Description,
196-
s.IsActive
197+
s.IsActive,
198+
s.DisplayOrder
197199
)).ToList();
198200

199201
return Result<IReadOnlyList<ModuleServiceDto>>.Success(dtos);

0 commit comments

Comments
 (0)