< Summary - Syki

Information
Class: Syki.Back.Features.Academic.CreateStudent.StudentCreatedDomainEvent
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Academic/CreateStudent/StudentCreatedDomainEvent.cs
Tag: 4_16869239191
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 24
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

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

File(s)

/home/runner/work/syki/syki/Back/Features/Academic/CreateStudent/StudentCreatedDomainEvent.cs

#LineLine coverage
 1using Syki.Back.Features.Cross.LinkOldNotifications;
 2
 3namespace Syki.Back.Features.Academic.CreateStudent;
 4
 5[DomainEvent(nameof(SykiStudent), "Aluno criado")]
 18026public record StudentCreatedDomainEvent(Guid UserId, Guid InstitutionId) : IDomainEvent;
 7
 8public class StudentCreatedDomainEventHandler(SykiDbContext ctx) : IDomainEventHandler<StudentCreatedDomainEvent>
 9{
 10    public async Task Handle(Guid institutionId, DomainEventId eventId, StudentCreatedDomainEvent evt)
 11    {
 12        ctx.AddCommand(institutionId, new LinkOldNotificationsCommand(evt.InstitutionId, evt.UserId), eventId: eventId);
 13        ctx.AddCommand(institutionId, new SendStudentWelcomeEmailCommand(evt.InstitutionId, evt.UserId), eventId: eventI
 14
 15        var webhooks = await ctx.Webhooks
 16            .Where(x => x.InstitutionId == institutionId && x.Events.Contains(WebhookEventType.StudentCreated))
 17            .Select(x => new { x.Id })
 18            .ToListAsync();
 19        foreach (var webhook in webhooks)
 20        {
 21            ctx.AddCommand(institutionId, new CreateStudentCreatedWebhookCallCommand(eventId, webhook.Id, evt.UserId), e
 22        }
 23    }
 24}

Methods/Properties

get_UserId()