Fix linting

This commit is contained in:
giancarlo
2024-04-23 00:15:41 +08:00
parent 17e0781581
commit 6814cc7089
6 changed files with 2027 additions and 2031 deletions

View File

@@ -1,13 +1,13 @@
import { z } from 'zod';
enum LineItemType {
export enum LineItemType {
Flat = 'flat',
PerSeat = 'per_seat',
Metered = 'metered',
}
const BillingIntervalSchema = z.enum(['month', 'year']);
const LineItemTypeSchema = z.nativeEnum(LineItemType);
const LineItemTypeSchema = z.enum(['flat', 'per_seat', 'metered']);
export const BillingProviderSchema = z.enum([
'stripe',
@@ -66,7 +66,8 @@ export const LineItemSchema = z
})
.refine(
(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',
path: ['type', 'unit', 'tiers'],