1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-19 00:21:35 -05:00

billings jobs setup

This commit is contained in:
Kyle Spearrin
2017-08-12 23:06:29 -04:00
parent f998b988ca
commit c8af0e8644
3 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,38 @@
using Bit.Core.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using System.Threading.Tasks;
namespace Bit.Billing.Controllers
{
[Route("jobs")]
public class JobsController : Controller
{
private readonly BillingSettings _billingSettings;
private readonly IOrganizationService _organizationService;
private readonly IUserService _userService;
public JobsController(
IOptions<BillingSettings> billingSettings,
IOrganizationService organizationService,
IUserService userService)
{
_billingSettings = billingSettings?.Value;
_organizationService = organizationService;
_userService = userService;
}
[HttpPost("expirations")]
public async Task<IActionResult> PostExpirations([FromQuery] string key)
{
if(key != _billingSettings.JobsKey)
{
return new BadRequestResult();
}
// TODO check for all users/orgs that are expired and disable them
return new OkResult();
}
}
}