< Summary - Syki

Information
Class: Syki.Back.Features.Academic.GetWebhook.GetWebhookService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Academic/GetWebhook/GetWebhookService.cs
Tag: 4_16869239191
Line coverage
0%
Covered lines: 0
Uncovered lines: 10
Coverable lines: 10
Total lines: 18
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
Get()0%620%

File(s)

/home/runner/work/syki/syki/Back/Features/Academic/GetWebhook/GetWebhookService.cs

#LineLine coverage
 1namespace Syki.Back.Features.Academic.GetWebhook;
 2
 03public class GetWebhookService(SykiDbContext ctx) : IAcademicService
 4{
 5    public async Task<OneOf<GetWebhookOut, SykiError>> Get(Guid institutionId, Guid id)
 6    {
 07        var webhook = await ctx.Webhooks.AsNoTracking()
 08            .Include(w => w.Calls)
 09            .Include(w => w.Authentication)
 010            .Where(w => w.InstitutionId == institutionId && w.Id == id)
 011            .OrderByDescending(c => c.CreatedAt)
 012            .FirstOrDefaultAsync();
 13
 014        if (webhook == null) return new WebhookNotFound();
 15
 016        return webhook.ToGetWebhookOut();
 017    }
 18}