Replace tuple return types with named records

CLAUDE.md prohibits tuples as return types. Add PagedResult<T>,
ProfileUpdateResult, and ApiKeyCreationResult records and update all
callers (AuditLogQueryService, AdminIdentityService, UserService,
ApiKeyService and their controllers/endpoints).
This commit is contained in:
2026-07-04 21:21:29 -07:00
parent b4a666ebf0
commit 643188ca9e
13 changed files with 113 additions and 118 deletions

View File

@@ -1,3 +1,4 @@
using MicCheck.Api.Common;
using MicCheck.Api.Data;
using MicCheck.Api.Features;
using Microsoft.EntityFrameworkCore;
@@ -6,7 +7,7 @@ namespace MicCheck.Api.Identities;
public class AdminIdentityService(IMicCheckDbContext db)
{
public async Task<(int Total, IReadOnlyList<Identity> Items)> ListAsync(
public async Task<PagedResult<Identity>> ListAsync(
int environmentId, int page, int pageSize, CancellationToken ct = default)
{
var query = db.Identities
@@ -20,7 +21,7 @@ public class AdminIdentityService(IMicCheckDbContext db)
.Take(pageSize)
.ToListAsync(ct);
return (total, items);
return new PagedResult<Identity>(total, items);
}
public async Task<Identity?> CreateAsync(int environmentId, string identifier, CancellationToken ct = default)