mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 23:52:50 -05:00
move domains to Models.Table
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
using Bit.Core.Domains;
|
||||
using Bit.Core.Models.Table;
|
||||
using System;
|
||||
|
||||
namespace Bit.Core.Models.Business
|
||||
|
22
src/Core/Models/Table/Cipher.cs
Normal file
22
src/Core/Models/Table/Cipher.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Models.Table
|
||||
{
|
||||
public class Cipher : IDataObject<Guid>
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public Guid? FolderId { get; set; }
|
||||
public Enums.CipherType Type { get; set; }
|
||||
public bool Favorite { get; set; }
|
||||
public string Data { get; set; }
|
||||
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
|
||||
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
Id = CoreHelpers.GenerateComb();
|
||||
}
|
||||
}
|
||||
}
|
22
src/Core/Models/Table/Device.cs
Normal file
22
src/Core/Models/Table/Device.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Models.Table
|
||||
{
|
||||
public class Device : IDataObject<Guid>
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public Enums.DeviceType Type { get; set; }
|
||||
public string Identifier { get; set; }
|
||||
public string PushToken { get; set; }
|
||||
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
|
||||
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
Id = CoreHelpers.GenerateComb();
|
||||
}
|
||||
}
|
||||
}
|
15
src/Core/Models/Table/Grant.cs
Normal file
15
src/Core/Models/Table/Grant.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace Bit.Core.Models.Table
|
||||
{
|
||||
public class Grant
|
||||
{
|
||||
public string Key { get; set; }
|
||||
public string Type { get; set; }
|
||||
public string SubjectId { get; set; }
|
||||
public string ClientId { get; set; }
|
||||
public DateTime CreationDate { get; set; }
|
||||
public DateTime? ExpirationDate { get; set; }
|
||||
public string Data { get; set; }
|
||||
}
|
||||
}
|
27
src/Core/Models/Table/Organization.cs
Normal file
27
src/Core/Models/Table/Organization.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using Bit.Core.Utilities;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Table
|
||||
{
|
||||
public class Organization : IDataObject<Guid>
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Plan { get; set; }
|
||||
public PlanType PlanType { get; set; }
|
||||
public decimal PlanPrice { get; set; }
|
||||
public decimal PlanRenewalPrice { get; set; }
|
||||
public DateTime? PlanRenewalDate { get; set; }
|
||||
public bool PlanTrial { get; set; }
|
||||
public short MaxUsers { get; set; }
|
||||
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
|
||||
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
Id = CoreHelpers.GenerateComb();
|
||||
}
|
||||
}
|
||||
}
|
24
src/Core/Models/Table/OrganizationUser.cs
Normal file
24
src/Core/Models/Table/OrganizationUser.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using Bit.Core.Utilities;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Table
|
||||
{
|
||||
public class OrganizationUser : IDataObject<Guid>
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid OrganizationId { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Key { get; set; }
|
||||
public OrganizationUserStatusType Status { get; set; }
|
||||
public OrganizationUserType Type { get; set; }
|
||||
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
|
||||
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
Id = CoreHelpers.GenerateComb();
|
||||
}
|
||||
}
|
||||
}
|
10
src/Core/Models/Table/Role.cs
Normal file
10
src/Core/Models/Table/Role.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace Bit.Core.Models.Table
|
||||
{
|
||||
/// <summary>
|
||||
/// This class is not used. It is implemented to make the Identity provider happy.
|
||||
/// </summary>
|
||||
public class Role
|
||||
{
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
19
src/Core/Models/Table/Subvault.cs
Normal file
19
src/Core/Models/Table/Subvault.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Models.Table
|
||||
{
|
||||
public class Subvault : IDataObject<Guid>
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid OrganizationId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
|
||||
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
Id = CoreHelpers.GenerateComb();
|
||||
}
|
||||
}
|
||||
}
|
21
src/Core/Models/Table/SubvaultUser.cs
Normal file
21
src/Core/Models/Table/SubvaultUser.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Models.Table
|
||||
{
|
||||
public class SubvaultUser : IDataObject<Guid>
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid SubvaultId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public bool Admin { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
|
||||
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
Id = CoreHelpers.GenerateComb();
|
||||
}
|
||||
}
|
||||
}
|
34
src/Core/Models/Table/User.cs
Normal file
34
src/Core/Models/Table/User.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Models.Table
|
||||
{
|
||||
public class User : IDataObject<Guid>
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Email { get; set; }
|
||||
public bool EmailVerified { get; set; }
|
||||
public string MasterPassword { get; set; }
|
||||
public string MasterPasswordHint { get; set; }
|
||||
public string Culture { get; set; } = "en-US";
|
||||
public string SecurityStamp { get; set; }
|
||||
public bool TwoFactorEnabled { get; set; }
|
||||
public TwoFactorProviderType? TwoFactorProvider { get; set; }
|
||||
public string AuthenticatorKey { get; set; }
|
||||
public string TwoFactorRecoveryCode { get; set; }
|
||||
public string EquivalentDomains { get; set; }
|
||||
public string ExcludedGlobalEquivalentDomains { get; set; }
|
||||
public DateTime AccountRevisionDate { get; internal set; } = DateTime.UtcNow;
|
||||
public string PublicKey { get; set; }
|
||||
public string PrivateKey { get; set; }
|
||||
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
|
||||
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
Id = CoreHelpers.GenerateComb();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user