mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
[AC-1943] Add ProviderInvoiceItem table (#4163)
* Add ProviderInvoiceItem table * Run dotnet format
This commit is contained in:
parent
fef34d845f
commit
725fc2eed3
26
src/Core/Billing/Entities/ProviderInvoiceItem.cs
Normal file
26
src/Core/Billing/Entities/ProviderInvoiceItem.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
using Bit.Core.Entities;
|
||||||
|
using Bit.Core.Utilities;
|
||||||
|
|
||||||
|
namespace Bit.Core.Billing.Entities;
|
||||||
|
|
||||||
|
public class ProviderInvoiceItem : ITableObject<Guid>
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public Guid ProviderId { get; set; }
|
||||||
|
public string InvoiceId { get; set; }
|
||||||
|
public string InvoiceNumber { get; set; }
|
||||||
|
public string ClientName { get; set; }
|
||||||
|
public string PlanName { get; set; }
|
||||||
|
public int AssignedSeats { get; set; }
|
||||||
|
public int UsedSeats { get; set; }
|
||||||
|
public decimal Total { get; set; }
|
||||||
|
public DateTime Created { 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 IProviderInvoiceItemRepository : IRepository<ProviderInvoiceItem, Guid>
|
||||||
|
{
|
||||||
|
Task<ProviderInvoiceItem> GetByInvoiceId(string invoiceId);
|
||||||
|
Task<ICollection<ProviderInvoiceItem>> GetByProviderId(Guid providerId);
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
using System.Data;
|
||||||
|
using Bit.Core.Billing.Entities;
|
||||||
|
using Bit.Core.Billing.Repositories;
|
||||||
|
using Bit.Core.Settings;
|
||||||
|
using Bit.Infrastructure.Dapper.Repositories;
|
||||||
|
using Dapper;
|
||||||
|
using Microsoft.Data.SqlClient;
|
||||||
|
|
||||||
|
namespace Bit.Infrastructure.Dapper.Billing.Repositories;
|
||||||
|
|
||||||
|
public class ProviderInvoiceItemRepository(
|
||||||
|
GlobalSettings globalSettings)
|
||||||
|
: Repository<ProviderInvoiceItem, Guid>(
|
||||||
|
globalSettings.SqlServer.ConnectionString,
|
||||||
|
globalSettings.SqlServer.ReadOnlyConnectionString), IProviderInvoiceItemRepository
|
||||||
|
{
|
||||||
|
public async Task<ProviderInvoiceItem> GetByInvoiceId(string invoiceId)
|
||||||
|
{
|
||||||
|
var sqlConnection = new SqlConnection(ConnectionString);
|
||||||
|
|
||||||
|
var results = await sqlConnection.QueryAsync<ProviderInvoiceItem>(
|
||||||
|
"[dbo].[ProviderInvoiceItem_ReadByInvoiceId]",
|
||||||
|
new { InvoiceId = invoiceId },
|
||||||
|
commandType: CommandType.StoredProcedure);
|
||||||
|
|
||||||
|
return results.FirstOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<ICollection<ProviderInvoiceItem>> GetByProviderId(Guid providerId)
|
||||||
|
{
|
||||||
|
var sqlConnection = new SqlConnection(ConnectionString);
|
||||||
|
|
||||||
|
var results = await sqlConnection.QueryAsync<ProviderInvoiceItem>(
|
||||||
|
"[dbo].[ProviderInvoiceItem_ReadByProviderId]",
|
||||||
|
new { ProviderId = providerId },
|
||||||
|
commandType: CommandType.StoredProcedure);
|
||||||
|
|
||||||
|
return results.ToArray();
|
||||||
|
}
|
||||||
|
}
|
@ -51,6 +51,7 @@ public static class DapperServiceCollectionExtensions
|
|||||||
services.AddSingleton<IOrganizationDomainRepository, OrganizationDomainRepository>();
|
services.AddSingleton<IOrganizationDomainRepository, OrganizationDomainRepository>();
|
||||||
services.AddSingleton<IWebAuthnCredentialRepository, WebAuthnCredentialRepository>();
|
services.AddSingleton<IWebAuthnCredentialRepository, WebAuthnCredentialRepository>();
|
||||||
services.AddSingleton<IProviderPlanRepository, ProviderPlanRepository>();
|
services.AddSingleton<IProviderPlanRepository, ProviderPlanRepository>();
|
||||||
|
services.AddSingleton<IProviderInvoiceItemRepository, ProviderInvoiceItemRepository>();
|
||||||
|
|
||||||
if (selfHosted)
|
if (selfHosted)
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
using Bit.Infrastructure.EntityFramework.Billing.Models;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
|
|
||||||
|
namespace Bit.Infrastructure.EntityFramework.Billing.Configurations;
|
||||||
|
|
||||||
|
public class ProviderInvoiceItemEntityTypeConfiguration : IEntityTypeConfiguration<ProviderInvoiceItem>
|
||||||
|
{
|
||||||
|
public void Configure(EntityTypeBuilder<ProviderInvoiceItem> builder)
|
||||||
|
{
|
||||||
|
builder
|
||||||
|
.Property(t => t.Id)
|
||||||
|
.ValueGeneratedNever();
|
||||||
|
|
||||||
|
builder
|
||||||
|
.HasIndex(providerInvoiceItem => new { providerInvoiceItem.Id, providerInvoiceItem.InvoiceId })
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
builder.ToTable(nameof(ProviderInvoiceItem));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider;
|
||||||
|
|
||||||
|
namespace Bit.Infrastructure.EntityFramework.Billing.Models;
|
||||||
|
|
||||||
|
// ReSharper disable once ClassWithVirtualMembersNeverInherited.Global
|
||||||
|
public class ProviderInvoiceItem : Core.Billing.Entities.ProviderInvoiceItem
|
||||||
|
{
|
||||||
|
public virtual Provider Provider { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ProviderInvoiceItemMapperProfile : Profile
|
||||||
|
{
|
||||||
|
public ProviderInvoiceItemMapperProfile()
|
||||||
|
{
|
||||||
|
CreateMap<Core.Billing.Entities.ProviderInvoiceItem, ProviderInvoiceItem>().ReverseMap();
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@ using Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider;
|
|||||||
|
|
||||||
namespace Bit.Infrastructure.EntityFramework.Billing.Models;
|
namespace Bit.Infrastructure.EntityFramework.Billing.Models;
|
||||||
|
|
||||||
|
// ReSharper disable once ClassWithVirtualMembersNeverInherited.Global
|
||||||
public class ProviderPlan : Core.Billing.Entities.ProviderPlan
|
public class ProviderPlan : Core.Billing.Entities.ProviderPlan
|
||||||
{
|
{
|
||||||
public virtual Provider Provider { get; set; }
|
public virtual Provider Provider { get; set; }
|
||||||
|
@ -0,0 +1,46 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using Bit.Core.Billing.Entities;
|
||||||
|
using Bit.Core.Billing.Repositories;
|
||||||
|
using Bit.Infrastructure.EntityFramework.Repositories;
|
||||||
|
using LinqToDB;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using EFProviderInvoiceItem = Bit.Infrastructure.EntityFramework.Billing.Models.ProviderInvoiceItem;
|
||||||
|
|
||||||
|
namespace Bit.Infrastructure.EntityFramework.Billing.Repositories;
|
||||||
|
|
||||||
|
public class ProviderInvoiceItemRepository(
|
||||||
|
IMapper mapper,
|
||||||
|
IServiceScopeFactory serviceScopeFactory)
|
||||||
|
: Repository<ProviderInvoiceItem, EFProviderInvoiceItem, Guid>(
|
||||||
|
serviceScopeFactory,
|
||||||
|
mapper,
|
||||||
|
context => context.ProviderInvoiceItems), IProviderInvoiceItemRepository
|
||||||
|
{
|
||||||
|
public async Task<ProviderInvoiceItem> GetByInvoiceId(string invoiceId)
|
||||||
|
{
|
||||||
|
using var serviceScope = ServiceScopeFactory.CreateScope();
|
||||||
|
|
||||||
|
var databaseContext = GetDatabaseContext(serviceScope);
|
||||||
|
|
||||||
|
var query =
|
||||||
|
from providerInvoiceItem in databaseContext.ProviderInvoiceItems
|
||||||
|
where providerInvoiceItem.InvoiceId == invoiceId
|
||||||
|
select providerInvoiceItem;
|
||||||
|
|
||||||
|
return await query.FirstOrDefaultAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<ICollection<ProviderInvoiceItem>> GetByProviderId(Guid providerId)
|
||||||
|
{
|
||||||
|
using var serviceScope = ServiceScopeFactory.CreateScope();
|
||||||
|
|
||||||
|
var databaseContext = GetDatabaseContext(serviceScope);
|
||||||
|
|
||||||
|
var query =
|
||||||
|
from providerInvoiceItem in databaseContext.ProviderInvoiceItems
|
||||||
|
where providerInvoiceItem.ProviderId == providerId
|
||||||
|
select providerInvoiceItem;
|
||||||
|
|
||||||
|
return await query.ToArrayAsync();
|
||||||
|
}
|
||||||
|
}
|
@ -88,6 +88,7 @@ public static class EntityFrameworkServiceCollectionExtensions
|
|||||||
services.AddSingleton<IOrganizationDomainRepository, OrganizationDomainRepository>();
|
services.AddSingleton<IOrganizationDomainRepository, OrganizationDomainRepository>();
|
||||||
services.AddSingleton<IWebAuthnCredentialRepository, WebAuthnCredentialRepository>();
|
services.AddSingleton<IWebAuthnCredentialRepository, WebAuthnCredentialRepository>();
|
||||||
services.AddSingleton<IProviderPlanRepository, ProviderPlanRepository>();
|
services.AddSingleton<IProviderPlanRepository, ProviderPlanRepository>();
|
||||||
|
services.AddSingleton<IProviderInvoiceItemRepository, ProviderInvoiceItemRepository>();
|
||||||
|
|
||||||
if (selfHosted)
|
if (selfHosted)
|
||||||
{
|
{
|
||||||
|
@ -67,6 +67,7 @@ public class DatabaseContext : DbContext
|
|||||||
public DbSet<OrganizationDomain> OrganizationDomains { get; set; }
|
public DbSet<OrganizationDomain> OrganizationDomains { get; set; }
|
||||||
public DbSet<WebAuthnCredential> WebAuthnCredentials { get; set; }
|
public DbSet<WebAuthnCredential> WebAuthnCredentials { get; set; }
|
||||||
public DbSet<ProviderPlan> ProviderPlans { get; set; }
|
public DbSet<ProviderPlan> ProviderPlans { get; set; }
|
||||||
|
public DbSet<ProviderInvoiceItem> ProviderInvoiceItems { get; set; }
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder builder)
|
protected override void OnModelCreating(ModelBuilder builder)
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
CREATE PROCEDURE [dbo].[ProviderInvoiceItem_Create]
|
||||||
|
@Id UNIQUEIDENTIFIER OUTPUT,
|
||||||
|
@ProviderId UNIQUEIDENTIFIER,
|
||||||
|
@InvoiceId VARCHAR (50),
|
||||||
|
@InvoiceNumber VARCHAR (50),
|
||||||
|
@ClientName NVARCHAR (50),
|
||||||
|
@PlanName NVARCHAR (50),
|
||||||
|
@AssignedSeats INT,
|
||||||
|
@UsedSeats INT,
|
||||||
|
@Total MONEY
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
INSERT INTO [dbo].[ProviderInvoiceItem]
|
||||||
|
(
|
||||||
|
[Id],
|
||||||
|
[ProviderId],
|
||||||
|
[InvoiceId],
|
||||||
|
[InvoiceNumber],
|
||||||
|
[ClientName],
|
||||||
|
[PlanName],
|
||||||
|
[AssignedSeats],
|
||||||
|
[UsedSeats],
|
||||||
|
[Total],
|
||||||
|
[Created]
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
@Id,
|
||||||
|
@ProviderId,
|
||||||
|
@InvoiceId,
|
||||||
|
@InvoiceNumber,
|
||||||
|
@ClientName,
|
||||||
|
@PlanName,
|
||||||
|
@AssignedSeats,
|
||||||
|
@UsedSeats,
|
||||||
|
@Total,
|
||||||
|
GETUTCDATE()
|
||||||
|
)
|
||||||
|
END
|
@ -0,0 +1,12 @@
|
|||||||
|
CREATE PROCEDURE [dbo].[ProviderInvoiceItem_DeleteById]
|
||||||
|
@Id UNIQUEIDENTIFIER
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
DELETE
|
||||||
|
FROM
|
||||||
|
[dbo].[ProviderInvoiceItem]
|
||||||
|
WHERE
|
||||||
|
[Id] = @Id
|
||||||
|
END
|
@ -0,0 +1,13 @@
|
|||||||
|
CREATE PROCEDURE [dbo].[ProviderInvoiceItem_ReadById]
|
||||||
|
@Id UNIQUEIDENTIFIER
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
[dbo].[ProviderInvoiceItemView]
|
||||||
|
WHERE
|
||||||
|
[Id] = @Id
|
||||||
|
END
|
@ -0,0 +1,13 @@
|
|||||||
|
CREATE PROCEDURE [dbo].[ProviderInvoiceItem_ReadByInvoiceId]
|
||||||
|
@InvoiceId VARCHAR (50)
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
[dbo].[ProviderInvoiceItemView]
|
||||||
|
WHERE
|
||||||
|
[InvoiceId] = @InvoiceId
|
||||||
|
END
|
@ -0,0 +1,13 @@
|
|||||||
|
CREATE PROCEDURE [dbo].[ProviderInvoiceItem_ReadByProviderId]
|
||||||
|
@ProviderId UNIQUEIDENTIFIER
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
[dbo].[ProviderInvoiceItemView]
|
||||||
|
WHERE
|
||||||
|
[ProviderId] = @ProviderId
|
||||||
|
END
|
@ -0,0 +1,28 @@
|
|||||||
|
CREATE PROCEDURE [dbo].[ProviderInvoiceItem_Update]
|
||||||
|
@Id UNIQUEIDENTIFIER,
|
||||||
|
@ProviderId UNIQUEIDENTIFIER,
|
||||||
|
@InvoiceId VARCHAR (50),
|
||||||
|
@InvoiceNumber VARCHAR (50),
|
||||||
|
@ClientName NVARCHAR (50),
|
||||||
|
@PlanName NVARCHAR (50),
|
||||||
|
@AssignedSeats INT,
|
||||||
|
@UsedSeats INT,
|
||||||
|
@Total MONEY
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
UPDATE
|
||||||
|
[dbo].[ProviderInvoiceItem]
|
||||||
|
SET
|
||||||
|
[ProviderId] = @ProviderId,
|
||||||
|
[InvoiceId] = @InvoiceId,
|
||||||
|
[InvoiceNumber] = @InvoiceNumber,
|
||||||
|
[ClientName] = @ClientName,
|
||||||
|
[PlanName] = @PlanName,
|
||||||
|
[AssignedSeats] = @AssignedSeats,
|
||||||
|
[UsedSeats] = @UsedSeats,
|
||||||
|
[Total] = @Total
|
||||||
|
WHERE
|
||||||
|
[Id] = @Id
|
||||||
|
END
|
15
src/Sql/Billing/Tables/ProviderInvoiceItem.sql
Normal file
15
src/Sql/Billing/Tables/ProviderInvoiceItem.sql
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
CREATE TABLE [dbo].[ProviderInvoiceItem] (
|
||||||
|
[Id] UNIQUEIDENTIFIER NOT NULL,
|
||||||
|
[ProviderId] UNIQUEIDENTIFIER NOT NULL,
|
||||||
|
[InvoiceId] VARCHAR (50) NOT NULL,
|
||||||
|
[InvoiceNumber] VARCHAR (50) NOT NULL,
|
||||||
|
[ClientName] NVARCHAR (50) NOT NULL,
|
||||||
|
[PlanName] NVARCHAR (50) NOT NULL,
|
||||||
|
[AssignedSeats] INT NOT NULL,
|
||||||
|
[UsedSeats] INT NOT NULL,
|
||||||
|
[Total] MONEY NOT NULL,
|
||||||
|
[Created] DATETIME2 (7) NOT NULL,
|
||||||
|
CONSTRAINT [PK_ProviderInvoiceItem] PRIMARY KEY CLUSTERED ([Id] ASC),
|
||||||
|
CONSTRAINT [FK_ProviderInvoiceItem_Provider] FOREIGN KEY ([ProviderId]) REFERENCES [dbo].[Provider] ([Id]),
|
||||||
|
CONSTRAINT [PK_ProviderIdInvoiceId] UNIQUE ([ProviderId], [InvoiceId])
|
||||||
|
);
|
6
src/Sql/Billing/Views/ProviderInvoiceItemView.sql
Normal file
6
src/Sql/Billing/Views/ProviderInvoiceItemView.sql
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
CREATE VIEW [dbo].[ProviderInvoiceItemView]
|
||||||
|
AS
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
[dbo].[ProviderInvoiceItem]
|
211
util/Migrator/DbScripts/2024-06-06_00_ProviderInvoiceItem.sql
Normal file
211
util/Migrator/DbScripts/2024-06-06_00_ProviderInvoiceItem.sql
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
-- ProviderInvoiceItem
|
||||||
|
|
||||||
|
-- Table
|
||||||
|
IF OBJECT_ID('[dbo].[ProviderInvoiceItem]') IS NULL
|
||||||
|
BEGIN
|
||||||
|
CREATE TABLE [dbo].[ProviderInvoiceItem] (
|
||||||
|
[Id] UNIQUEIDENTIFIER NOT NULL,
|
||||||
|
[ProviderId] UNIQUEIDENTIFIER NOT NULL,
|
||||||
|
[InvoiceId] VARCHAR (50) NOT NULL,
|
||||||
|
[InvoiceNumber] VARCHAR (50) NOT NULL,
|
||||||
|
[ClientName] NVARCHAR (50) NOT NULL,
|
||||||
|
[PlanName] NVARCHAR (50) NOT NULL,
|
||||||
|
[AssignedSeats] INT NOT NULL,
|
||||||
|
[UsedSeats] INT NOT NULL,
|
||||||
|
[Total] MONEY NOT NULL,
|
||||||
|
[Created] DATETIME2 (7) NOT NULL,
|
||||||
|
CONSTRAINT [PK_ProviderInvoiceItem] PRIMARY KEY CLUSTERED ([Id] ASC),
|
||||||
|
CONSTRAINT [FK_ProviderInvoiceItem_Provider] FOREIGN KEY ([ProviderId]) REFERENCES [dbo].[Provider] ([Id]),
|
||||||
|
CONSTRAINT [PK_ProviderIdInvoiceId] UNIQUE ([ProviderId], [InvoiceId])
|
||||||
|
);
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
-- View
|
||||||
|
IF EXISTS(SELECT * FROM sys.views WHERE [Name] = 'ProviderInvoiceItemView')
|
||||||
|
BEGIN
|
||||||
|
DROP VIEW [dbo].[ProviderInvoiceItemView]
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE VIEW [dbo].[ProviderInvoiceItemView]
|
||||||
|
AS
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
[dbo].[ProviderInvoiceItem]
|
||||||
|
GO
|
||||||
|
|
||||||
|
-- Stored Procedure: Create
|
||||||
|
IF OBJECT_ID('[dbo].[ProviderInvoiceItem_Create]') IS NOT NULL
|
||||||
|
BEGIN
|
||||||
|
DROP PROCEDURE [dbo].[ProviderInvoiceItem_Create]
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE PROCEDURE [dbo].[ProviderInvoiceItem_Create]
|
||||||
|
@Id UNIQUEIDENTIFIER OUTPUT,
|
||||||
|
@ProviderId UNIQUEIDENTIFIER,
|
||||||
|
@InvoiceId VARCHAR (50),
|
||||||
|
@InvoiceNumber VARCHAR (50),
|
||||||
|
@ClientName NVARCHAR (50),
|
||||||
|
@PlanName NVARCHAR (50),
|
||||||
|
@AssignedSeats INT,
|
||||||
|
@UsedSeats INT,
|
||||||
|
@Total MONEY
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
INSERT INTO [dbo].[ProviderInvoiceItem]
|
||||||
|
(
|
||||||
|
[Id],
|
||||||
|
[ProviderId],
|
||||||
|
[InvoiceId],
|
||||||
|
[InvoiceNumber],
|
||||||
|
[ClientName],
|
||||||
|
[PlanName],
|
||||||
|
[AssignedSeats],
|
||||||
|
[UsedSeats],
|
||||||
|
[Total],
|
||||||
|
[Created]
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
@Id,
|
||||||
|
@ProviderId,
|
||||||
|
@InvoiceId,
|
||||||
|
@InvoiceNumber,
|
||||||
|
@ClientName,
|
||||||
|
@PlanName,
|
||||||
|
@AssignedSeats,
|
||||||
|
@UsedSeats,
|
||||||
|
@Total,
|
||||||
|
GETUTCDATE()
|
||||||
|
)
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
-- Stored Procedure: DeleteById
|
||||||
|
IF OBJECT_ID('[dbo].[ProviderInvoiceItem_DeleteById]') IS NOT NULL
|
||||||
|
BEGIN
|
||||||
|
DROP PROCEDURE [dbo].[ProviderInvoiceItem_DeleteById]
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE PROCEDURE [dbo].[ProviderInvoiceItem_DeleteById]
|
||||||
|
@Id UNIQUEIDENTIFIER
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
DELETE
|
||||||
|
FROM
|
||||||
|
[dbo].[ProviderInvoiceItem]
|
||||||
|
WHERE
|
||||||
|
[Id] = @Id
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
-- Stored Procedure: ReadById
|
||||||
|
IF OBJECT_ID('[dbo].[ProviderInvoiceItem_ReadById]') IS NOT NULL
|
||||||
|
BEGIN
|
||||||
|
DROP PROCEDURE [dbo].[ProviderInvoiceItem_ReadById]
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE PROCEDURE [dbo].[ProviderInvoiceItem_ReadById]
|
||||||
|
@Id UNIQUEIDENTIFIER
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
[dbo].[ProviderInvoiceItemView]
|
||||||
|
WHERE
|
||||||
|
[Id] = @Id
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
-- Stored Procedure: ReadByInvoiceId
|
||||||
|
IF OBJECT_ID('[dbo].[ProviderInvoiceItem_ReadByInvoiceId]') IS NOT NULL
|
||||||
|
BEGIN
|
||||||
|
DROP PROCEDURE [dbo].[ProviderInvoiceItem_ReadByInvoiceId]
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE PROCEDURE [dbo].[ProviderInvoiceItem_ReadByInvoiceId]
|
||||||
|
@InvoiceId VARCHAR (50)
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
[dbo].[ProviderInvoiceItemView]
|
||||||
|
WHERE
|
||||||
|
[InvoiceId] = @InvoiceId
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
-- Stored Procedure: ReadByProviderId
|
||||||
|
IF OBJECT_ID('[dbo].[ProviderInvoiceItem_ReadByProviderId]') IS NOT NULL
|
||||||
|
BEGIN
|
||||||
|
DROP PROCEDURE [dbo].[ProviderInvoiceItem_ReadByProviderId]
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE PROCEDURE [dbo].[ProviderInvoiceItem_ReadByProviderId]
|
||||||
|
@ProviderId UNIQUEIDENTIFIER
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
[dbo].[ProviderInvoiceItemView]
|
||||||
|
WHERE
|
||||||
|
[ProviderId] = @ProviderId
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
-- Stored Procedure: Update
|
||||||
|
IF OBJECT_ID('[dbo].[ProviderInvoiceItem_Update]') IS NOT NULL
|
||||||
|
BEGIN
|
||||||
|
DROP PROCEDURE [dbo].[ProviderInvoiceItem_Update]
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE PROCEDURE [dbo].[ProviderInvoiceItem_Update]
|
||||||
|
@Id UNIQUEIDENTIFIER,
|
||||||
|
@ProviderId UNIQUEIDENTIFIER,
|
||||||
|
@InvoiceId VARCHAR (50),
|
||||||
|
@InvoiceNumber VARCHAR (50),
|
||||||
|
@ClientName NVARCHAR (50),
|
||||||
|
@PlanName NVARCHAR (50),
|
||||||
|
@AssignedSeats INT,
|
||||||
|
@UsedSeats INT,
|
||||||
|
@Total MONEY
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
UPDATE
|
||||||
|
[dbo].[ProviderInvoiceItem]
|
||||||
|
SET
|
||||||
|
[ProviderId] = @ProviderId,
|
||||||
|
[InvoiceId] = @InvoiceId,
|
||||||
|
[InvoiceNumber] = @InvoiceNumber,
|
||||||
|
[ClientName] = @ClientName,
|
||||||
|
[PlanName] = @PlanName,
|
||||||
|
[AssignedSeats] = @AssignedSeats,
|
||||||
|
[UsedSeats] = @UsedSeats,
|
||||||
|
[Total] = @Total
|
||||||
|
WHERE
|
||||||
|
[Id] = @Id
|
||||||
|
END
|
||||||
|
GO
|
2633
util/MySqlMigrations/Migrations/20240606152409_ProviderInvoiceItem.Designer.cs
generated
Normal file
2633
util/MySqlMigrations/Migrations/20240606152409_ProviderInvoiceItem.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,62 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Bit.MySqlMigrations.Migrations;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class ProviderInvoiceItem : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "ProviderInvoiceItem",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||||
|
ProviderId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||||
|
InvoiceId = table.Column<string>(type: "varchar(255)", nullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
InvoiceNumber = table.Column<string>(type: "longtext", nullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
ClientName = table.Column<string>(type: "longtext", nullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
PlanName = table.Column<string>(type: "longtext", nullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
AssignedSeats = table.Column<int>(type: "int", nullable: false),
|
||||||
|
UsedSeats = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Total = table.Column<decimal>(type: "decimal(65,30)", nullable: false),
|
||||||
|
Created = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_ProviderInvoiceItem", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ProviderInvoiceItem_Provider_ProviderId",
|
||||||
|
column: x => x.ProviderId,
|
||||||
|
principalTable: "Provider",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ProviderInvoiceItem_Id_InvoiceId",
|
||||||
|
table: "ProviderInvoiceItem",
|
||||||
|
columns: new[] { "Id", "InvoiceId" },
|
||||||
|
unique: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ProviderInvoiceItem_ProviderId",
|
||||||
|
table: "ProviderInvoiceItem",
|
||||||
|
column: "ProviderId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "ProviderInvoiceItem");
|
||||||
|
}
|
||||||
|
}
|
@ -673,6 +673,48 @@ namespace Bit.MySqlMigrations.Migrations
|
|||||||
b.ToTable("WebAuthnCredential", (string)null);
|
b.ToTable("WebAuthnCredential", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderInvoiceItem", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
|
b.Property<int>("AssignedSeats")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ClientName")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime>("Created")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("InvoiceId")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("InvoiceNumber")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("PlanName")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<Guid>("ProviderId")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
|
b.Property<decimal>("Total")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<int>("UsedSeats")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ProviderId");
|
||||||
|
|
||||||
|
b.HasIndex("Id", "InvoiceId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("ProviderInvoiceItem", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
@ -2050,6 +2092,17 @@ namespace Bit.MySqlMigrations.Migrations
|
|||||||
b.Navigation("User");
|
b.Navigation("User");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderInvoiceItem", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider.Provider", "Provider")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ProviderId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Provider");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider.Provider", "Provider")
|
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider.Provider", "Provider")
|
||||||
|
2649
util/PostgresMigrations/Migrations/20240606152405_ProviderInvoiceItem.Designer.cs
generated
Normal file
2649
util/PostgresMigrations/Migrations/20240606152405_ProviderInvoiceItem.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,57 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Bit.PostgresMigrations.Migrations;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class ProviderInvoiceItem : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "ProviderInvoiceItem",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
ProviderId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
InvoiceId = table.Column<string>(type: "text", nullable: true),
|
||||||
|
InvoiceNumber = table.Column<string>(type: "text", nullable: true),
|
||||||
|
ClientName = table.Column<string>(type: "text", nullable: true),
|
||||||
|
PlanName = table.Column<string>(type: "text", nullable: true),
|
||||||
|
AssignedSeats = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
UsedSeats = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
Total = table.Column<decimal>(type: "numeric", nullable: false),
|
||||||
|
Created = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_ProviderInvoiceItem", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ProviderInvoiceItem_Provider_ProviderId",
|
||||||
|
column: x => x.ProviderId,
|
||||||
|
principalTable: "Provider",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ProviderInvoiceItem_Id_InvoiceId",
|
||||||
|
table: "ProviderInvoiceItem",
|
||||||
|
columns: new[] { "Id", "InvoiceId" },
|
||||||
|
unique: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ProviderInvoiceItem_ProviderId",
|
||||||
|
table: "ProviderInvoiceItem",
|
||||||
|
column: "ProviderId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "ProviderInvoiceItem");
|
||||||
|
}
|
||||||
|
}
|
@ -687,6 +687,48 @@ namespace Bit.PostgresMigrations.Migrations
|
|||||||
b.ToTable("WebAuthnCredential", (string)null);
|
b.ToTable("WebAuthnCredential", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderInvoiceItem", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<int>("AssignedSeats")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("ClientName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime>("Created")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("InvoiceId")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("InvoiceNumber")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PlanName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("ProviderId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<decimal>("Total")
|
||||||
|
.HasColumnType("numeric");
|
||||||
|
|
||||||
|
b.Property<int>("UsedSeats")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ProviderId");
|
||||||
|
|
||||||
|
b.HasIndex("Id", "InvoiceId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("ProviderInvoiceItem", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
@ -2066,6 +2108,17 @@ namespace Bit.PostgresMigrations.Migrations
|
|||||||
b.Navigation("User");
|
b.Navigation("User");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderInvoiceItem", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider.Provider", "Provider")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ProviderId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Provider");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider.Provider", "Provider")
|
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider.Provider", "Provider")
|
||||||
|
2631
util/SqliteMigrations/Migrations/20240606152401_ProviderInvoiceItem.Designer.cs
generated
Normal file
2631
util/SqliteMigrations/Migrations/20240606152401_ProviderInvoiceItem.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,57 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Bit.SqliteMigrations.Migrations;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class ProviderInvoiceItem : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "ProviderInvoiceItem",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||||
|
ProviderId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||||
|
InvoiceId = table.Column<string>(type: "TEXT", nullable: true),
|
||||||
|
InvoiceNumber = table.Column<string>(type: "TEXT", nullable: true),
|
||||||
|
ClientName = table.Column<string>(type: "TEXT", nullable: true),
|
||||||
|
PlanName = table.Column<string>(type: "TEXT", nullable: true),
|
||||||
|
AssignedSeats = table.Column<int>(type: "INTEGER", nullable: false),
|
||||||
|
UsedSeats = table.Column<int>(type: "INTEGER", nullable: false),
|
||||||
|
Total = table.Column<decimal>(type: "TEXT", nullable: false),
|
||||||
|
Created = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_ProviderInvoiceItem", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ProviderInvoiceItem_Provider_ProviderId",
|
||||||
|
column: x => x.ProviderId,
|
||||||
|
principalTable: "Provider",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ProviderInvoiceItem_Id_InvoiceId",
|
||||||
|
table: "ProviderInvoiceItem",
|
||||||
|
columns: new[] { "Id", "InvoiceId" },
|
||||||
|
unique: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ProviderInvoiceItem_ProviderId",
|
||||||
|
table: "ProviderInvoiceItem",
|
||||||
|
column: "ProviderId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "ProviderInvoiceItem");
|
||||||
|
}
|
||||||
|
}
|
@ -671,6 +671,48 @@ namespace Bit.SqliteMigrations.Migrations
|
|||||||
b.ToTable("WebAuthnCredential", (string)null);
|
b.ToTable("WebAuthnCredential", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderInvoiceItem", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<int>("AssignedSeats")
|
||||||
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
|
b.Property<string>("ClientName")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<DateTime>("Created")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<string>("InvoiceId")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<string>("InvoiceNumber")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<string>("PlanName")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<Guid>("ProviderId")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<decimal>("Total")
|
||||||
|
.HasColumnType("TEXT");
|
||||||
|
|
||||||
|
b.Property<int>("UsedSeats")
|
||||||
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ProviderId");
|
||||||
|
|
||||||
|
b.HasIndex("Id", "InvoiceId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("ProviderInvoiceItem", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
@ -2048,6 +2090,17 @@ namespace Bit.SqliteMigrations.Migrations
|
|||||||
b.Navigation("User");
|
b.Navigation("User");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderInvoiceItem", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider.Provider", "Provider")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ProviderId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Provider");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Billing.Models.ProviderPlan", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider.Provider", "Provider")
|
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider.Provider", "Provider")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user