1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-09 11:54:41 -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

@ -1,8 +1,9 @@
using System;
using System.Linq;
using Bit.Core.Models.Table;
using System.Collections.Generic;
using Bit.Core.Models.Business;
using Bit.Core.Models.StaticStore;
using System.Linq;
using Bit.Core.Enums;
namespace Bit.Core.Models.Api
{
@ -25,7 +26,7 @@ namespace Bit.Core.Models.Api
BusinessCountry = organization.BusinessCountry;
BusinessTaxNumber = organization.BusinessTaxNumber;
BillingEmail = organization.BillingEmail;
Plan = organization.Plan;
Plan = new PlanResponseModel(Utilities.StaticStore.Plans.FirstOrDefault(plan => plan.Type == organization.PlanType));
PlanType = organization.PlanType;
Seats = organization.Seats;
MaxCollections = organization.MaxCollections;
@ -51,8 +52,8 @@ namespace Bit.Core.Models.Api
public string BusinessCountry { get; set; }
public string BusinessTaxNumber { get; set; }
public string BillingEmail { get; set; }
public string Plan { get; set; }
public Enums.PlanType PlanType { get; set; }
public PlanResponseModel Plan { get; set; }
public PlanType PlanType { get; set; }
public short? Seats { get; set; }
public short? MaxCollections { get; set; }
public short? MaxStorageGb { get; set; }