Skip to content

Commit fa2b9be

Browse files
committed
Merge branch 'dev' into main
2 parents 3e7b718 + 5aa4330 commit fa2b9be

File tree

81 files changed

+272
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+272
-95
lines changed

apps/app-server/src/env.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ declare namespace NodeJS {
5454

5555
STRIPE_PUBLISHABLE_KEY: string;
5656
STRIPE_SECRET_KEY: string;
57-
STRIPE_PRICE_ID: string;
5857
STRIPE_WEBHOOK_SECRET: string;
58+
STRIPE_MONTHLY_PRICE_ID: string;
59+
STRIPE_YEARLY_PRICE_ID: string;
5960
}
6061
}

apps/app-server/src/trpc/api/users/account/stripe/create-checkout-session.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@ import { once } from 'lodash';
55
import type { InferProcedureOpts } from 'src/trpc/helpers';
66
import { authProcedure } from 'src/trpc/helpers';
77
import type Stripe from 'stripe';
8+
import { z } from 'zod';
89

9-
const baseProcedure = authProcedure;
10+
const baseProcedure = authProcedure.input(
11+
z.object({
12+
billingFrequency: z.enum(['monthly', 'yearly']).optional(),
13+
}),
14+
);
1015

1116
export const createCheckoutSessionProcedure = once(() =>
1217
baseProcedure.mutation(createCheckoutSession),
1318
);
1419

1520
export async function createCheckoutSession({
1621
ctx,
22+
input,
1723
}: InferProcedureOpts<typeof baseProcedure>) {
1824
return await ctx.usingLocks(
1925
[[`user-lock:${ctx.userId}`]],
@@ -102,7 +108,10 @@ export async function createCheckoutSession({
102108

103109
line_items: [
104110
{
105-
price: process.env.STRIPE_PRICE_ID,
111+
price:
112+
input.billingFrequency === 'yearly'
113+
? process.env.STRIPE_YEARLY_PRICE_ID
114+
: process.env.STRIPE_MONTHLY_PRICE_ID,
106115
quantity: 1,
107116
},
108117
],

apps/client/components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export {}
77

88
declare module '@vue/runtime-core' {
99
export interface GlobalComponents {
10+
BillingFrequencyToggle: typeof import('./src/components/BillingFrequencyToggle.vue')['default']
1011
Checkbox: typeof import('./src/components/Checkbox.vue')['default']
1112
ColorPalette: typeof import('./src/components/ColorPalette.vue')['default']
1213
ColorSquare: typeof import('./src/components/ColorSquare.vue')['default']

apps/client/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
/>
5151
<meta
5252
property="og:title"
53-
content="DeepNotes - Infinite Canvas Note-taking"
53+
content="DeepNotes - Infinite Canvas Encrypted Note-taking"
5454
/>
5555
<meta
5656
property="og:description"
@@ -72,7 +72,7 @@
7272
/>
7373
<meta
7474
property="twitter:title"
75-
content="DeepNotes - Infinite Canvas Note-taking"
75+
content="DeepNotes - Infinite Canvas Encrypted Note-taking"
7676
/>
7777
<meta
7878
property="twitter:description"
17.3 KB
15.5 KB
17.9 KB
14 KB
15.7 KB
35.3 KB

0 commit comments

Comments
 (0)