1
0
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:
Matt Gibson
2021-10-29 18:43:45 -04:00
committed by Justin Baur
parent 192df467ce
commit fcbf0f094e
11 changed files with 333 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace Bit.Core.Models.Api
{
public class OrganizationSponsorshipRedeemRequestModel
{
[Required]
public Guid SponsoredOrganizationId { get; set; }
}
}

View File

@@ -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; }
}
}

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