diff --git a/src/Core/Auth/Models/Data/EmergencyAccessNotify.cs b/src/Core/Auth/Models/Data/EmergencyAccessNotify.cs index 1c0d4bfe8b..492d565717 100644 --- a/src/Core/Auth/Models/Data/EmergencyAccessNotify.cs +++ b/src/Core/Auth/Models/Data/EmergencyAccessNotify.cs @@ -1,14 +1,10 @@ -// FIXME: Update this file to be null safe and then delete the line below -#nullable disable - - -using Bit.Core.Auth.Entities; +using Bit.Core.Auth.Entities; namespace Bit.Core.Auth.Models.Data; public class EmergencyAccessNotify : EmergencyAccess { - public string GrantorEmail { get; set; } - public string GranteeName { get; set; } - public string GranteeEmail { get; set; } + public string? GrantorEmail { get; set; } + public string? GranteeName { get; set; } + public string? GranteeEmail { get; set; } } diff --git a/src/Core/Auth/Repositories/IEmergencyAccessRepository.cs b/src/Core/Auth/Repositories/IEmergencyAccessRepository.cs index 63ec04106e..5f11281b36 100644 --- a/src/Core/Auth/Repositories/IEmergencyAccessRepository.cs +++ b/src/Core/Auth/Repositories/IEmergencyAccessRepository.cs @@ -2,8 +2,6 @@ using Bit.Core.Auth.Models.Data; using Bit.Core.KeyManagement.UserKey; -#nullable enable - namespace Bit.Core.Repositories; public interface IEmergencyAccessRepository : IRepository @@ -11,7 +9,17 @@ public interface IEmergencyAccessRepository : IRepository Task GetCountByGrantorIdEmailAsync(Guid grantorId, string email, bool onlyRegisteredUsers); Task> GetManyDetailsByGrantorIdAsync(Guid grantorId); Task> GetManyDetailsByGranteeIdAsync(Guid granteeId); + /// + /// Fetches emergency access details by EmergencyAccess id and grantor id + /// + /// Emergency Access Id + /// Grantor Id + /// EmergencyAccessDetails or null Task GetDetailsByIdGrantorIdAsync(Guid id, Guid grantorId); + /// + /// Database call to fetch emergency accesses that need notification emails sent through a Job + /// + /// collection of EmergencyAccessNotify objects that require notification Task> GetManyToNotifyAsync(); Task> GetExpiredRecoveriesAsync(); diff --git a/src/Infrastructure.EntityFramework/Auth/Repositories/EmergencyAccessRepository.cs b/src/Infrastructure.EntityFramework/Auth/Repositories/EmergencyAccessRepository.cs index e1ea9bc03f..972a79f0d3 100644 --- a/src/Infrastructure.EntityFramework/Auth/Repositories/EmergencyAccessRepository.cs +++ b/src/Infrastructure.EntityFramework/Auth/Repositories/EmergencyAccessRepository.cs @@ -10,8 +10,6 @@ using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; -#nullable enable - namespace Bit.Infrastructure.EntityFramework.Auth.Repositories; public class EmergencyAccessRepository : Repository, IEmergencyAccessRepository