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

[AC-2568] Added invoices and transaction history endpoints. Added cursor paging for each (#4692)

* Added invoices and transaction history endpoints. Added cursor paging for each

* Removed try/catch since it's handled by middleware. Updated condition to use pattern matching

* Added unit tests for PaymentHistoryService

* Removed organizationId from account billing controller endpoints
This commit is contained in:
Conner Turnbull
2024-09-09 09:38:58 -04:00
committed by GitHub
parent ebf8bc0b85
commit 46ac2a9b3b
16 changed files with 385 additions and 34 deletions

View File

@ -1,16 +1,16 @@
CREATE PROCEDURE [dbo].[Transaction_ReadByOrganizationId]
@OrganizationId UNIQUEIDENTIFIER,
@Limit INT
@Limit INT,
@StartAfter DATETIME2 = NULL
AS
BEGIN
SET NOCOUNT ON
SELECT
TOP (@Limit) *
FROM
[dbo].[TransactionView]
SELECT TOP (@Limit) *
FROM [dbo].[TransactionView]
WHERE
[OrganizationId] = @OrganizationId
AND (@StartAfter IS NULL OR [CreationDate] < @StartAfter)
ORDER BY
[CreationDate] DESC
END

View File

@ -1,6 +1,7 @@
CREATE PROCEDURE [dbo].[Transaction_ReadByProviderId]
@ProviderId UNIQUEIDENTIFIER,
@Limit INT
@Limit INT,
@StartAfter DATETIME2 = NULL
AS
BEGIN
SET NOCOUNT ON
@ -11,6 +12,7 @@ BEGIN
[dbo].[TransactionView]
WHERE
[ProviderId] = @ProviderId
AND (@StartAfter IS NULL OR [CreationDate] < @StartAfter)
ORDER BY
[CreationDate] DESC
END

View File

@ -1,6 +1,7 @@
CREATE PROCEDURE [dbo].[Transaction_ReadByUserId]
@UserId UNIQUEIDENTIFIER,
@Limit INT
@Limit INT,
@StartAfter DATETIME2 = NULL
AS
BEGIN
SET NOCOUNT ON
@ -11,6 +12,7 @@ BEGIN
[dbo].[TransactionView]
WHERE
[UserId] = @UserId
AND (@StartAfter IS NULL OR [CreationDate] < @StartAfter)
ORDER BY
[CreationDate] DESC
END