mirror of
https://github.com/bitwarden/server
synced 2026-01-03 09:03:44 +00:00
WIP: scaffolding for families for enterprise sponsorship flow
This commit is contained in:
@@ -10,5 +10,6 @@ namespace Bit.Core.Repositories
|
||||
{
|
||||
Task<OrganizationSponsorship> GetBySponsoringOrganizationUserIdAsync(Guid sponsoringOrganizationUserId);
|
||||
Task<OrganizationSponsorship> GetBySponsoredOrganizationIdAsync(Guid sponsoredOrganizationId);
|
||||
Task<OrganizationSponsorship> GetByOfferedToEmailAsync(string email);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
@@ -26,7 +25,10 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
{
|
||||
var results = await connection.QueryAsync<OrganizationSponsorship>(
|
||||
"[dbo].[OrganizationSponsorship_ReadBySponsoringOrganizationUserId]",
|
||||
new { SponsoringOrganizationUserId = sponsoringOrganizationUserId },
|
||||
new
|
||||
{
|
||||
SponsoringOrganizationUserId = sponsoringOrganizationUserId
|
||||
},
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return results.SingleOrDefault();
|
||||
@@ -45,5 +47,21 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
return results.SingleOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<OrganizationSponsorship> GetByOfferedToEmailAsync(string offeredToEmail)
|
||||
{
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
var results = await connection.QueryAsync<OrganizationSponsorship>(
|
||||
"[dbo].[OrganizationSponsorship_ReadByOfferedToEmail]",
|
||||
new
|
||||
{
|
||||
OfferedToEmail = offeredToEmail
|
||||
},
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return results.SingleOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user