mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
[AC-2567] Billing Performance Improvements (#4143)
* Moved AccountsBilling controller to be owned by Billing * Added org billing history endpoint * Updated GetBillingInvoicesAsync to only retrieve paid, open, and uncollectible invoices, and added option to limit results * Removed invoices and transactions from GetBillingAsync * Limiting the number of invoices and transactions returned * Moved Billing models to Billing namespace * Split billing info and billing history objects * Removed billing method GetBillingBalanceAndSourceAsync * Removed unused using * Cleaned up BillingInfo a bit * Update migration scripts to use `CREATE OR ALTER` instead of checking for the `OBJECT_ID` * Applying limit to aggregated invoices after they return from Stripe
This commit is contained in:
@ -0,0 +1,16 @@
|
||||
CREATE OR ALTER PROCEDURE [dbo].[Transaction_ReadByOrganizationId]
|
||||
@OrganizationId UNIQUEIDENTIFIER,
|
||||
@Limit INT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
TOP (@Limit) *
|
||||
FROM
|
||||
[dbo].[TransactionView]
|
||||
WHERE
|
||||
[OrganizationId] = @OrganizationId
|
||||
ORDER BY
|
||||
[CreationDate] DESC
|
||||
END
|
@ -0,0 +1,16 @@
|
||||
CREATE OR ALTER PROCEDURE [dbo].[Transaction_ReadByUserId]
|
||||
@UserId UNIQUEIDENTIFIER,
|
||||
@Limit INT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
TOP (@Limit) *
|
||||
FROM
|
||||
[dbo].[TransactionView]
|
||||
WHERE
|
||||
[UserId] = @UserId
|
||||
ORDER BY
|
||||
[CreationDate] DESC
|
||||
END
|
@ -0,0 +1,16 @@
|
||||
CREATE OR ALTER PROCEDURE [dbo].[Transaction_ReadByProviderId]
|
||||
@ProviderId UNIQUEIDENTIFIER,
|
||||
@Limit INT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
TOP (@Limit) *
|
||||
FROM
|
||||
[dbo].[TransactionView]
|
||||
WHERE
|
||||
[ProviderId] = @ProviderId
|
||||
ORDER BY
|
||||
[CreationDate] DESC
|
||||
END
|
Reference in New Issue
Block a user