Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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
  • Loading branch information
Filipe Frigini committed Nov 19, 2025
commit 9d56f6d6a124f05319a8bbd5f3e0861a2a73b91e
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using MeAjudaAi.Modules.ServiceCatalogs.Application.DTOs.Requests.Service;
using MeAjudaAi.Modules.ServiceCatalogs.Application.ModuleApi;
using MeAjudaAi.Shared.Authorization;
using MeAjudaAi.Shared.Contracts;
using MeAjudaAi.Shared.Contracts.Modules.ServiceCatalogs;
// TODO Phase 2: Uncomment when shared contracts are added
// using MeAjudaAi.Shared.Contracts.Modules.ServiceCatalogs;
using MeAjudaAi.Shared.Endpoints;
using MeAjudaAi.Shared.Functional;
using Microsoft.AspNetCore.Builder;
Expand All @@ -22,7 +24,7 @@ public static void Map(IEndpointRouteBuilder app)

private static async Task<IResult> ValidateAsync(
[FromBody] ValidateServicesRequest request,
[FromServices] IServiceCatalogsModuleApi moduleApi,
[FromServices] ServiceCatalogsModuleApi moduleApi,
CancellationToken cancellationToken)
{
var result = await moduleApi.ValidateServicesAsync(request.ServiceIds, cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ namespace MeAjudaAi.Modules.ServiceCatalogs.Application.DTOs.Requests.Service;
public sealed record ValidateServicesResponse
{
public bool AllValid { get; init; }
public required IReadOnlyCollection<Guid> InvalidServiceIds { get; init; }
public required IReadOnlyCollection<Guid> InactiveServiceIds { get; init; }
public IReadOnlyCollection<Guid> InvalidServiceIds { get; init; }
public IReadOnlyCollection<Guid> InactiveServiceIds { get; init; }

public ValidateServicesResponse(bool allValid, IReadOnlyCollection<Guid>? invalidServiceIds, IReadOnlyCollection<Guid>? inactiveServiceIds)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ public async Task<Result<IReadOnlyList<ModuleServiceCategoryDto>>> GetAllService
categoryName,
service.Name,
service.Description,
service.IsActive
service.IsActive,
service.DisplayOrder
);

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

var dtos = services.Select(s => new ModuleServiceListDto(
s.Id.Value,
s.CategoryId.Value,
s.Name,
s.Description,
s.IsActive
)).ToList();

Expand Down Expand Up @@ -193,7 +194,8 @@ public async Task<Result<IReadOnlyList<ModuleServiceDto>>> GetServicesByCategory
s.Category?.Name ?? ValidationMessages.Catalogs.UnknownCategoryName,
s.Name,
s.Description,
s.IsActive
s.IsActive,
s.DisplayOrder
)).ToList();

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