Skip to content

Commit

Permalink
Add test_mode billing query
Browse files Browse the repository at this point in the history
  • Loading branch information
yunusefendi52 committed Jan 28, 2025
1 parent c8e7ae4 commit dd0afc6
Show file tree
Hide file tree
Showing 9 changed files with 1,130 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/api/auth/sign-in-google.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default defineEventHandler(async event => {
user_name: subAttrs.user_name,
variant_id: subAttrs.variant_id,
variant_name: subAttrs.variant_name,
test_mode: subAttrs.test_mode,
})
}
}
Expand Down
1 change: 1 addition & 0 deletions server/api/billing/current-billing.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default defineEventHandler(async event => {
user_name: subAttrs.user_name,
variant_id: subAttrs.variant_id,
variant_name: subAttrs.variant_name,
test_mode: subAttrs.test_mode,
})
}

Expand Down
2 changes: 2 additions & 0 deletions server/api/billing/subscription-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export async function syncUserSubscription(
product_name: attributes.product_name,
user_name: attributes.user_name,
variant_name: attributes.variant_name,
testMode: attributes.test_mode,
}
await db.insert(tables.users_subs)
.values(newSub)
Expand All @@ -131,4 +132,5 @@ export type SubscriptionSyncData = {
ends_at: string | null;
created_at: string;
updated_at: string;
test_mode: boolean;
}
2 changes: 1 addition & 1 deletion server/api/create-org.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default defineEventHandler(async (event) => {
const { orgLimit: orgSize } = await getUserMaxOrg(event)
if (myCurrentUserOrgs.count >= orgSize) {
throw createError({
message: `The number of organization has reached the limit ${orgSize} of ${myCurrentUserOrgs.count} organizations`,
message: `The number of organization has reached the limit ${orgSize} of organizations`,
})
}
}
Expand Down
1 change: 1 addition & 0 deletions server/db/drizzle/0070_brave_husk.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE `users_app_subs` ADD `test_mode` integer;
Loading

0 comments on commit dd0afc6

Please sign in to comment.