From fa1ff3b5f6d93cce615b64bfeac0006f57291820 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Mon, 7 Oct 2024 15:09:32 +0800 Subject: [PATCH] refactor: move billing mode inside folder --- src/server/model/{billing.ts => billing/index.ts} | 4 ++-- src/server/router/billing.ts | 2 +- src/server/trpc/routers/billing.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/server/model/{billing.ts => billing/index.ts} (97%) diff --git a/src/server/model/billing.ts b/src/server/model/billing/index.ts similarity index 97% rename from src/server/model/billing.ts rename to src/server/model/billing/index.ts index 0760d48..9e69434 100644 --- a/src/server/model/billing.ts +++ b/src/server/model/billing/index.ts @@ -4,8 +4,8 @@ import { updateSubscription, cancelSubscription as lsCancelSubscription, } from '@lemonsqueezy/lemonsqueezy.js'; -import { env } from '../utils/env.js'; -import { prisma } from './_client.js'; +import { env } from '../../utils/env.js'; +import { prisma } from '../_client.js'; if (env.billing.lemonSqueezy.apiKey) { lemonSqueezySetup({ diff --git a/src/server/router/billing.ts b/src/server/router/billing.ts index ab8f0a8..216a67f 100644 --- a/src/server/router/billing.ts +++ b/src/server/router/billing.ts @@ -2,7 +2,7 @@ import { Router, raw } from 'express'; import crypto from 'crypto'; import { env } from '../utils/env.js'; import { get } from 'lodash-es'; -import { checkIsValidProduct } from '../model/billing.js'; +import { checkIsValidProduct } from '../model/billing/index.js'; import { prisma } from '../model/_client.js'; import dayjs from 'dayjs'; diff --git a/src/server/trpc/routers/billing.ts b/src/server/trpc/routers/billing.ts index 7dfff55..78ce6d5 100644 --- a/src/server/trpc/routers/billing.ts +++ b/src/server/trpc/routers/billing.ts @@ -14,7 +14,7 @@ import { createCheckoutBilling, getTierNameByvariantId, SubscriptionTierType, -} from '../../model/billing.js'; +} from '../../model/billing/index.js'; import { LemonSqueezySubscriptionModelSchema } from '../../prisma/zod/lemonsqueezysubscription.js'; export const billingRouter = router({