1
0
mirror of https://github.com/bitwarden/server synced 2026-01-01 08:03:23 +00:00

premium renewal reminders job for braintree

This commit is contained in:
Kyle Spearrin
2018-07-12 23:23:41 -04:00
parent 476ee53931
commit 938b7f1230
12 changed files with 221 additions and 0 deletions

View File

@@ -63,6 +63,18 @@ namespace Bit.Core.Repositories.SqlServer
}
}
public async Task<ICollection<User>> GetManyByPremiumRenewalAsync()
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<User>(
"[dbo].[User_ReadByPremiumRenewal]",
commandType: CommandType.StoredProcedure);
return results.ToList();
}
}
public async Task<string> GetPublicKeyAsync(Guid id)
{
using(var connection = new SqlConnection(ConnectionString))
@@ -117,5 +129,16 @@ namespace Bit.Core.Repositories.SqlServer
commandTimeout: 180);
}
}
public async Task UpdateRenewalReminderDateAsync(Guid id, DateTime renewalReminderDate)
{
using(var connection = new SqlConnection(ConnectionString))
{
await connection.ExecuteAsync(
$"[{Schema}].[User_UpdateRenewalReminderDate]",
new { Id = id, RenewalReminderDate = renewalReminderDate },
commandType: CommandType.StoredProcedure);
}
}
}
}