1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 09:32:48 -05:00

[AC-2488] Add billing endpoint to determine SM standalone for organization (#4014)

* Add billing endpoint to determine SM standalone for org.

* Add missing attribute
This commit is contained in:
Alex Morask
2024-04-24 16:29:04 -04:00
committed by GitHub
parent d3c964887f
commit b12e881ece
9 changed files with 268 additions and 0 deletions

View File

@ -0,0 +1,27 @@
using Bit.Api.Billing.Models.Responses;
using Bit.Core.Billing.Queries;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Bit.Api.Billing.Controllers;
[Route("organizations/{organizationId:guid}/billing")]
[Authorize("Application")]
public class OrganizationBillingController(
IOrganizationBillingQueries organizationBillingQueries) : Controller
{
[HttpGet("metadata")]
public async Task<IResult> GetMetadataAsync([FromRoute] Guid organizationId)
{
var metadata = await organizationBillingQueries.GetMetadata(organizationId);
if (metadata == null)
{
return TypedResults.NotFound();
}
var response = OrganizationMetadataResponse.From(metadata);
return TypedResults.Ok(response);
}
}