< Summary

Information
Class: Syki.Daemon.Tasks.CreateNewExamGradeNoteNotificationHandler
Assembly: Daemon
File(s): /home/runner/work/syki/syki/Daemon/Tasks/CreateNewExamGradeNoteNotificationHandler.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 26
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
.ctor(...)100%11100%
Handle()100%11100%

File(s)

/home/runner/work/syki/syki/Daemon/Tasks/CreateNewExamGradeNoteNotificationHandler.cs

#LineLine coverage
 1using Syki.Back.Features.Teacher.AddExamGradeNote;
 2using Syki.Back.Features.Academic.CreateNotification;
 3
 4namespace Syki.Daemon.Tasks;
 5
 406public class CreateNewExamGradeNoteNotificationHandler(SykiDbContext ctx) : ISykiTaskHandler<CreateNewExamGradeNoteNotif
 7{
 8    public async Task Handle(CreateNewExamGradeNoteNotification task)
 9    {
 4010        var @class = await ctx.Classes.AsNoTracking()
 4011            .Include(x => x.Discipline)
 4012            .FirstAsync(x => x.Id == task.ClassId);
 13
 4014        var notification = new Notification(
 4015            @class.InstitutionId,
 4016            "Nota adicionada",
 4017            $"Confira sua nota na disciplina: {@class.Discipline.Name}",
 4018            UsersGroup.Students,
 4019            false
 4020        );
 21
 4022        ctx.AddRange(notification, new UserNotification(task.UserId, notification.Id));
 23
 4024        await ctx.SaveChangesAsync();
 4025    }
 26}