mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
Plan And Price Updates (#859)
* Expanded the Plan model to make plan & product data a bit more dynamic * Created a Product enum to track versioned instances of the same plan * Created and API call and Response model for getting plan & product data from the server
This commit is contained in:
@ -471,7 +471,7 @@ namespace Bit.Api.Controllers
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("{id}/tax")]
|
||||
[SelfHosted(NotSelfHostedOnly = true)]
|
||||
public async Task<TaxInfoResponseModel> GetTaxInfo(string id)
|
||||
@ -491,7 +491,7 @@ namespace Bit.Api.Controllers
|
||||
var taxInfo = await _paymentService.GetTaxInfoAsync(organization);
|
||||
return new TaxInfoResponseModel(taxInfo);
|
||||
}
|
||||
|
||||
|
||||
[HttpPut("{id}/tax")]
|
||||
[SelfHosted(NotSelfHostedOnly = true)]
|
||||
public async Task PutTaxInfo(string id, [FromBody]OrganizationTaxInfoUpdateRequestModel model)
|
||||
|
21
src/Api/Controllers/PlansController.cs
Normal file
21
src/Api/Controllers/PlansController.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Bit.Core.Utilities;
|
||||
using Bit.Core.Models.Api;
|
||||
using System.Linq;
|
||||
|
||||
namespace Bit.Api.Controllers
|
||||
{
|
||||
[Route("plans")]
|
||||
[Authorize("Web")]
|
||||
public class PlansController : Controller
|
||||
{
|
||||
[HttpGet("")]
|
||||
public ListResponseModel<PlanResponseModel> Get()
|
||||
{
|
||||
var data = StaticStore.Plans;
|
||||
var responses = data.Select(plan => new PlanResponseModel(plan));
|
||||
return new ListResponseModel<PlanResponseModel>(responses);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user