Fix linting
This commit is contained in:
@@ -33,13 +33,13 @@ export default createBillingSchema({
|
|||||||
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe',
|
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe',
|
||||||
name: 'Addon 2',
|
name: 'Addon 2',
|
||||||
cost: 9.99,
|
cost: 9.99,
|
||||||
type: 'flat',
|
type: 'flat' as const,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'price_1P8N0zI1i3VnbZTqtUPc1Zvr',
|
id: 'price_1P8N0zI1i3VnbZTqtUPc1Zvr',
|
||||||
name: 'Addon 3',
|
name: 'Addon 3',
|
||||||
cost: 0,
|
cost: 0,
|
||||||
type: 'per_seat',
|
type: 'per_seat' as const,
|
||||||
tiers: [
|
tiers: [
|
||||||
{
|
{
|
||||||
upTo: 1,
|
upTo: 1,
|
||||||
@@ -67,7 +67,7 @@ export default createBillingSchema({
|
|||||||
id: 'starter-yearly',
|
id: 'starter-yearly',
|
||||||
name: 'Base',
|
name: 'Base',
|
||||||
cost: 99.99,
|
cost: 99.99,
|
||||||
type: 'flat',
|
type: 'flat' as const,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -24,5 +24,3 @@
|
|||||||
"privacyPolicy": "Privacy Policy",
|
"privacyPolicy": "Privacy Policy",
|
||||||
"privacyPolicyDescription": "Our privacy policy and how we use your data"
|
"privacyPolicyDescription": "Our privacy policy and how we use your data"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
enum LineItemType {
|
export enum LineItemType {
|
||||||
Flat = 'flat',
|
Flat = 'flat',
|
||||||
PerSeat = 'per_seat',
|
PerSeat = 'per_seat',
|
||||||
Metered = 'metered',
|
Metered = 'metered',
|
||||||
}
|
}
|
||||||
|
|
||||||
const BillingIntervalSchema = z.enum(['month', 'year']);
|
const BillingIntervalSchema = z.enum(['month', 'year']);
|
||||||
const LineItemTypeSchema = z.nativeEnum(LineItemType);
|
const LineItemTypeSchema = z.enum(['flat', 'per_seat', 'metered']);
|
||||||
|
|
||||||
export const BillingProviderSchema = z.enum([
|
export const BillingProviderSchema = z.enum([
|
||||||
'stripe',
|
'stripe',
|
||||||
@@ -66,7 +66,8 @@ export const LineItemSchema = z
|
|||||||
})
|
})
|
||||||
.refine(
|
.refine(
|
||||||
(data) =>
|
(data) =>
|
||||||
data.type !== 'metered' || (data.unit && data.tiers !== undefined),
|
data.type !== LineItemType.Metered ||
|
||||||
|
(data.unit && data.tiers !== undefined),
|
||||||
{
|
{
|
||||||
message: 'Metered line items must have a unit and tiers',
|
message: 'Metered line items must have a unit and tiers',
|
||||||
path: ['type', 'unit', 'tiers'],
|
path: ['type', 'unit', 'tiers'],
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { SupabaseClient } from '@supabase/supabase-js';
|
import { SupabaseClient } from '@supabase/supabase-js';
|
||||||
|
|
||||||
import { createBillingWebhooksService } from '@kit/billing-gateway';
|
|
||||||
import { getLogger } from '@kit/shared/logger';
|
import { getLogger } from '@kit/shared/logger';
|
||||||
import { Database } from '@kit/supabase/database';
|
import { Database } from '@kit/supabase/database';
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user