1
0
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:
Addison Beck
2020-08-11 14:19:56 -04:00
committed by GitHub
parent 61b11e398b
commit c8220fdfa6
10 changed files with 541 additions and 153 deletions

View File

@ -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)

View 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);
}
}
}