< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Shared.Messages.GoogleUserMessageMap
Assembly: ArturRios.Heimdall.Shared
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Application/ArturRios.Heimdall.Shared/Messages/GoogleUserMessageMap.cs
Line coverage
100%
Covered lines: 30
Uncovered lines: 0
Coverable lines: 30
Total lines: 41
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 1
Fully covered methods: 1
Total methods: 1
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%

File(s)

/home/runner/work/heimdall-api/heimdall-api/src/Application/ArturRios.Heimdall.Shared/Messages/GoogleUserMessageMap.cs

#LineLine coverage
 1using ArturRios.Util.Http;
 2
 3namespace ArturRios.Heimdall.Shared.Messages;
 4
 5/// <summary>
 6///     Maps each <see cref="GoogleUserMessages" /> value to its HTTP status code, following the UC-27
 7///     – UC-29 flows. Passed to the response resolver.
 8/// </summary>
 9public static class GoogleUserMessageMap
 10{
 411    public static readonly IReadOnlyDictionary<string, int> StatusCodes =
 412        DataAccessMessageMap.CombinedWith(new Dictionary<string, int>
 413        {
 414            // UC-27 main flow — Google User(s) retrieved.
 415            [GoogleUserMessages.GoogleUserRetrievedSuccessfully] = HttpStatusCodes.Ok,
 416            [GoogleUserMessages.GoogleUsersRetrievedSuccessfully] = HttpStatusCodes.Ok,
 417            // AF-27a — no such Google User in the addressed scope, or it is logically deleted and was
 418            // not explicitly requested (FR-GO-17).
 419            [GoogleUserMessages.GoogleUserNotFound] = HttpStatusCodes.NotFound,
 420            // AF-27a on the listing — the scope itself is missing or logically deleted.
 421            [GoogleUserMessages.ScopeNotFound] = HttpStatusCodes.NotFound,
 422            // AF-27b — the caller may not view this Google User.
 423            [GoogleUserMessages.NotAuthorizedToViewGoogleUser] = HttpStatusCodes.Forbidden,
 424            // AF-27b on the listing — the acting Scope Admin does not own the addressed scope.
 425            [GoogleUserMessages.NotScopeOwner] = HttpStatusCodes.Forbidden,
 426            // UC-28 main flow — Google User logically deleted. AF-28b answers with the same 200, so the
 427            // response's AlreadyDeleted flag is what tells the two paths apart. AF-28a reuses
 428            // GoogleUserNotFound above.
 429            [GoogleUserMessages.GoogleUserDeletedSuccessfully] = HttpStatusCodes.Ok,
 430            // AF-28c — the caller may not delete this Google User.
 431            [GoogleUserMessages.NotAuthorizedToDeleteGoogleUser] = HttpStatusCodes.Forbidden,
 432            // UC-29 main flow — Google User hard deleted. AF-29a reuses GoogleUserNotFound above, and
 433            // UC-29's only other refusals are the framework's: 403 from [RoleRequirement], 401
 434            // unauthenticated.
 435            [GoogleUserMessages.GoogleUserHardDeletedSuccessfully] = HttpStatusCodes.Ok,
 436            // UC-27 listing (NFR-10) — invalid pagination or an over-length name/email filter.
 437            [PaginationMessages.InvalidPageNumber] = HttpStatusCodes.BadRequest,
 438            [PaginationMessages.InvalidPageSize] = HttpStatusCodes.BadRequest,
 439            [PaginationMessages.FilterTooLong] = HttpStatusCodes.BadRequest
 440        });
 41}

Methods/Properties

.cctor()