1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

[AC-2804] Add client ID to provider client invoice report (#4458)

* Add client ID to provider client invoice report

* Run dotnet format
This commit is contained in:
Alex Morask
2024-07-05 10:12:03 -04:00
committed by GitHub
parent 8b5f65fc00
commit 9c8a9f41fb
17 changed files with 8252 additions and 5 deletions

View File

@ -76,6 +76,7 @@ public class ProviderEventService(
ProviderId = parsedProviderId,
InvoiceId = invoice.Id,
InvoiceNumber = invoice.Number,
ClientId = client.Id,
ClientName = client.OrganizationName,
PlanName = client.Plan,
AssignedSeats = client.Seats ?? 0,

View File

@ -14,6 +14,7 @@ public class ProviderInvoiceItem : ITableObject<Guid>
public string InvoiceId { get; set; } = null!;
[MaxLength(50)]
public string? InvoiceNumber { get; set; }
public Guid? ClientId { get; set; }
[MaxLength(50)]
public string ClientName { get; set; } = null!;
[MaxLength(50)]

View File

@ -8,7 +8,8 @@ CREATE PROCEDURE [dbo].[ProviderInvoiceItem_Create]
@AssignedSeats INT,
@UsedSeats INT,
@Total MONEY,
@Created DATETIME2 (7) = NULL
@Created DATETIME2 (7) = NULL,
@ClientId UNIQUEIDENTIFIER = NULL
AS
BEGIN
SET NOCOUNT ON
@ -26,7 +27,8 @@ BEGIN
[AssignedSeats],
[UsedSeats],
[Total],
[Created]
[Created],
[ClientId]
)
VALUES
(
@ -39,6 +41,7 @@ BEGIN
@AssignedSeats,
@UsedSeats,
@Total,
@Created
@Created,
@ClientId
)
END

View File

@ -8,7 +8,8 @@ CREATE PROCEDURE [dbo].[ProviderInvoiceItem_Update]
@AssignedSeats INT,
@UsedSeats INT,
@Total MONEY,
@Created DATETIME2 (7) = NULL
@Created DATETIME2 (7) = NULL,
@ClientId UNIQUEIDENTIFIER = NULL
AS
BEGIN
SET NOCOUNT ON
@ -26,7 +27,8 @@ BEGIN
[AssignedSeats] = @AssignedSeats,
[UsedSeats] = @UsedSeats,
[Total] = @Total,
[Created] = @Created
[Created] = @Created,
[ClientId] = @ClientId
WHERE
[Id] = @Id
END

View File

@ -9,6 +9,7 @@ CREATE TABLE [dbo].[ProviderInvoiceItem] (
[UsedSeats] INT NOT NULL,
[Total] MONEY NOT NULL,
[Created] DATETIME2 (7) NOT NULL,
[ClientId] UNIQUEIDENTIFIER NULL,
CONSTRAINT [PK_ProviderInvoiceItem] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_ProviderInvoiceItem_Provider] FOREIGN KEY ([ProviderId]) REFERENCES [dbo].[Provider] ([Id]) ON DELETE CASCADE
);