private async Task AddAuditData(Guid id, NotificationAuditType type, NotificationAuditScreenType screen) { await this.auditService.AddAuditEntry(this.mediator, id, User.GetUserId(), type, screen); }
public async Task AddAuditEntry(IMediator mediator, Guid notificationId, string userId, NotificationAuditType auditType, NotificationAuditScreenType screenType) { var audit = CreateAudit(notificationId, userId, screenType, auditType); await mediator.SendAsync(audit); }
private static CreateNotificationAudit CreateAudit(Guid notificationId, string userId, NotificationAuditScreenType screen, NotificationAuditType type) { return(new CreateNotificationAudit() { DateAdded = SystemTime.Now, NotificationId = notificationId, UserId = userId, Screen = screen, Type = type }); }
protected async Task AddAuditEntries(WasteCodeDataAndNotificationData existingData, BaseWasteCodeViewModel viewModel, Guid id, NotificationAuditScreenType screenType) { if (!existingData.NotificationWasteCodeData[codeType].Any()) { await AuditService.AddAuditEntry(Mediator, id, User.GetUserId(), NotificationAuditType.Added, screenType); } else { if (CodeBeenRemoved(viewModel, existingData)) { await AuditService.AddAuditEntry(Mediator, id, User.GetUserId(), NotificationAuditType.Deleted, screenType); } if (CodeBeenAdded(viewModel, existingData)) { await AuditService.AddAuditEntry(Mediator, id, User.GetUserId(), NotificationAuditType.Updated, screenType); } } }