1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-30 13:33:24 +01:00
bitwarden-server/util/Migrator/DbScripts/2024-08-21_01_ProviderTransactionsReadCursor.sql
Conner Turnbull 46ac2a9b3b
[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
2024-09-09 09:38:58 -04:00

19 lines
406 B
Transact-SQL

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