mirror of
https://github.com/bitwarden/server
synced 2025-12-24 12:13:17 +00:00
WIP: Organization sponsorship flow
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Core.Models.Api
|
||||
{
|
||||
public class OrganizationSponsorshipRedeemRequestModel
|
||||
{
|
||||
[Required]
|
||||
public Guid SponsoredOrganizationId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Models.Api.Request
|
||||
{
|
||||
public class OrganizationSponsorshipRequestModel
|
||||
{
|
||||
[Required]
|
||||
public Guid OrganizationUserId { get; set; }
|
||||
[Required]
|
||||
[StringLength(256)]
|
||||
[StrictEmailAddress]
|
||||
public string sponsoredEmail { get; set; }
|
||||
}
|
||||
}
|
||||
24
src/Core/Models/Table/OrganizationSponsorship.cs
Normal file
24
src/Core/Models/Table/OrganizationSponsorship.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Models.Table
|
||||
{
|
||||
public class OrganizationSponsorship : ITableObject<Guid>
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid InstallationId { get; set; }
|
||||
public Guid SponsoringOrganizationId { get; set; }
|
||||
public Guid SponsoringOrganizationUserId { get; set; }
|
||||
public Guid SponsoringUserId { get; set; }
|
||||
public Guid? SponsoredOrganizationId { get; set; }
|
||||
public bool CloudSponsor { get; set; }
|
||||
public DateTime? LastSyncDate { get; set; }
|
||||
public byte TimesRenewedWithoutValidation { get; set; }
|
||||
public DateTime? SponsorshipLapsedDate { get; set; }
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
Id = CoreHelpers.GenerateComb();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user