From 8d04624b1dcabe99b963dd456a036ed44cc46dc8 Mon Sep 17 00:00:00 2001 From: giancarlo Date: Thu, 25 Apr 2024 11:34:47 +0700 Subject: [PATCH] Add queryUsage method to billing services A new method, queryUsage, has been added to the billing strategy classes and the gateway service to offer usage querying capabilities for Stripe and Lemon Squeezy. QueryBillingUsageSchema has also been introduced in the schema-related changes. Changes also include updates to the functions' comment descriptions. A minor tweak was made to the Button and Link components in the `faq/page.tsx' file. --- apps/web/app/(marketing)/faq/page.tsx | 4 +- packages/billing/core/src/schema/index.ts | 1 + .../src/schema/query-billing-usage.schema.ts | 32 +++++ .../src/schema/report-billing-usage.schema.ts | 12 +- .../billing-strategy-provider.service.ts | 7 ++ .../billing-gateway.service.ts | 16 +++ .../lemon-squeezy-billing-strategy.service.ts | 105 +++++++++++++++- .../stripe-billing-strategy.service.ts | 115 ++++++++++++++++-- 8 files changed, 278 insertions(+), 14 deletions(-) create mode 100644 packages/billing/core/src/schema/query-billing-usage.schema.ts diff --git a/apps/web/app/(marketing)/faq/page.tsx b/apps/web/app/(marketing)/faq/page.tsx index da6f02534..fbf0cc5b5 100644 --- a/apps/web/app/(marketing)/faq/page.tsx +++ b/apps/web/app/(marketing)/faq/page.tsx @@ -86,8 +86,8 @@ async function FAQPage() {
-