diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index c644a9f..86f2756 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -81,6 +81,7 @@ model Budget { budgetUsers BudgetUser[] transactions Transaction[] invitations BudgetUserInvitation[] + settings BudgetSettings @relation(fields: [id], references: [id], onDelete: Cascade) } enum BudgetType { @@ -112,6 +113,18 @@ enum BudgetPeriodType { CUSTOM } +model BudgetSettings { + id String @id + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + budget Budget? + + canMembersCreateTransactions Boolean @default(true) + canMembersViewOtherTransactions Boolean @default(false) + canMembersUpdateOtherTransactions Boolean @default(false) + canMembersDeleteOtherTransactions Boolean @default(false) +} + model BudgetUser { id String @id @default(cuid()) createdAt DateTime @default(now()) diff --git a/apps/api/v1/index.ts b/apps/api/v1/index.ts index aefc5c8..0e5d041 100644 --- a/apps/api/v1/index.ts +++ b/apps/api/v1/index.ts @@ -8,10 +8,12 @@ import transactionsApp from './routes/transactions' import usersApp from './routes/users' import walletsApp from './routes/wallets' import clerkWebhooksApp from './routes/webhooks/clerk' +import revenuecatWebhooksApp from './routes/webhooks/revenuecat' export const hono = new Hono() .get('/health', (c) => c.text('ok')) .route('/webhooks/clerk', clerkWebhooksApp) + .route('/webhooks/revenuecat', revenuecatWebhooksApp) .use('*', authMiddleware) .route('/auth', authApp)