Refactor Supabase type imports for improved clarity
Replaced specific object paths with generic type helpers across several files to enhance readability and maintainability. This change standardizes the import patterns and type definitions for database tables and enums.
This commit is contained in:
@@ -3,7 +3,7 @@ import 'server-only';
|
||||
import { SupabaseClient } from '@supabase/supabase-js';
|
||||
|
||||
import { BillingConfig } from '@kit/billing';
|
||||
import { Database } from '@kit/supabase/database';
|
||||
import { Database, Enums } from '@kit/supabase/database';
|
||||
|
||||
import { BillingEventHandlerFactoryService } from './billing-event-handler-factory.service';
|
||||
import { createBillingEventHandlerService } from './billing-event-handler.service';
|
||||
@@ -12,7 +12,7 @@ import { createBillingEventHandlerService } from './billing-event-handler.servic
|
||||
type ClientProvider = () => SupabaseClient<Database>;
|
||||
|
||||
// the billing provider from the database
|
||||
type BillingProvider = Database['public']['Enums']['billing_provider'];
|
||||
type BillingProvider = Enums<'billing_provider'>;
|
||||
|
||||
/**
|
||||
* @name getBillingEventHandlerService
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'server-only';
|
||||
|
||||
import { Database } from '@kit/supabase/database';
|
||||
import { Tables } from '@kit/supabase/database';
|
||||
|
||||
import { createBillingGatewayService } from '../billing-gateway/billing-gateway.service';
|
||||
|
||||
type Subscription = Database['public']['Tables']['subscriptions']['Row'];
|
||||
type Subscription = Tables<'subscriptions'>
|
||||
|
||||
export function createBillingWebhooksService() {
|
||||
return new BillingWebhooksService();
|
||||
|
||||
Reference in New Issue
Block a user