1
0
mirror of https://github.com/bitwarden/server synced 2025-12-23 19:53:40 +00:00

[AC-1923] Add endpoint to create client organization (#3977)

* Add new endpoint for creating client organizations in consolidated billing

* Create empty org and then assign seats for code re-use

* Fixes made from debugging client side

* few more small fixes

* Vincent's feedback
This commit is contained in:
Alex Morask
2024-04-16 13:55:00 -04:00
committed by GitHub
parent 73e049f878
commit c4ba0dc2a5
36 changed files with 1462 additions and 441 deletions

View File

@@ -0,0 +1,29 @@
using System.ComponentModel.DataAnnotations;
using Bit.Api.Utilities;
using Bit.Core.Enums;
namespace Bit.Api.Billing.Models.Requests;
public class CreateClientOrganizationRequestBody
{
[Required(ErrorMessage = "'name' must be provided")]
public string Name { get; set; }
[Required(ErrorMessage = "'ownerEmail' must be provided")]
public string OwnerEmail { get; set; }
[EnumMatches<PlanType>(PlanType.TeamsMonthly, PlanType.EnterpriseMonthly, ErrorMessage = "'planType' must be Teams (Monthly) or Enterprise (Monthly)")]
public PlanType PlanType { get; set; }
[Range(1, int.MaxValue, ErrorMessage = "'seats' must be greater than 0")]
public int Seats { get; set; }
[Required(ErrorMessage = "'key' must be provided")]
public string Key { get; set; }
[Required(ErrorMessage = "'keyPair' must be provided")]
public KeyPairRequestBody KeyPair { get; set; }
[Required(ErrorMessage = "'collectionName' must be provided")]
public string CollectionName { get; set; }
}