mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
[PM-11127] Write OrganizationInstallation
record when license is retrieved (#5090)
* Add SQL files * Add SQL Server migration * Add Core entity * Add Dapper repository * Add EF repository * Add EF migrations * Save OrganizationInstallation during GetLicense invocation * Run dotnet format
This commit is contained in:
24
src/Core/Billing/Entities/OrganizationInstallation.cs
Normal file
24
src/Core/Billing/Entities/OrganizationInstallation.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Billing.Entities;
|
||||
|
||||
#nullable enable
|
||||
|
||||
public class OrganizationInstallation : ITableObject<Guid>
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid OrganizationId { get; set; }
|
||||
public Guid InstallationId { get; set; }
|
||||
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
|
||||
public DateTime? RevisionDate { get; set; }
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
if (Id == default)
|
||||
{
|
||||
Id = CoreHelpers.GenerateComb();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
using Bit.Core.Billing.Entities;
|
||||
using Bit.Core.Repositories;
|
||||
|
||||
namespace Bit.Core.Billing.Repositories;
|
||||
|
||||
public interface IOrganizationInstallationRepository : IRepository<OrganizationInstallation, Guid>
|
||||
{
|
||||
Task<OrganizationInstallation> GetByInstallationIdAsync(Guid installationId);
|
||||
Task<ICollection<OrganizationInstallation>> GetByOrganizationIdAsync(Guid organizationId);
|
||||
}
|
Reference in New Issue
Block a user