1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-19 08:30:59 -05:00

Initial db work (#1687)

* Add organization sponsorship databases to all providers

* Generalize create and update for database, specialize in code
This commit is contained in:
Matt Gibson
2021-11-04 10:46:49 -05:00
committed by GitHub
parent ee46a6d63b
commit 079adc60b6
26 changed files with 4276 additions and 3 deletions

View File

@ -0,0 +1,20 @@
using System.Collections.Generic;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class OrganizationSponsorship : Table.OrganizationSponsorship
{
public virtual Installation Installation { get; set; }
public virtual Organization SponsoringOrganization { get; set; }
public virtual Organization SponsoredOrganization { get; set; }
}
public class OrganizationSponsorshipMapperProfile : Profile
{
public OrganizationSponsorshipMapperProfile()
{
CreateMap<Table.OrganizationSponsorship, OrganizationSponsorship>().ReverseMap();
}
}
}

View File

@ -7,15 +7,14 @@ namespace Bit.Core.Models.Table
public class OrganizationSponsorship : ITableObject<Guid>
{
public Guid Id { get; set; }
public Guid InstallationId { get; set; }
public Guid? InstallationId { get; set; }
[Required]
public Guid SponsoringOrganizationId { get; set; }
[Required]
public Guid SponsoringOrganizationUserId { get; set; }
public Guid SponsoringUserId { get; set; }
public Guid? SponsoredOrganizationId { get; set; }
[MaxLength(256)]
public string OfferedToEmail { get; set; }
public Guid? SponsoredOrganizationId { get; set; }
[Required]
public bool CloudSponsor { get; set; }
public DateTime? LastSyncDate { get; set; }