2021-03-22 13:48:48 +00:00
|
|
|
// This is your Prisma schema file,
|
|
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
|
|
|
|
datasource db {
|
|
|
|
provider = "postgresql"
|
|
|
|
url = env("DATABASE_URL")
|
|
|
|
}
|
|
|
|
|
|
|
|
generator client {
|
2022-04-06 12:37:06 +00:00
|
|
|
provider = "prisma-client-js"
|
2023-08-07 22:08:13 +00:00
|
|
|
previewFeatures = ["views"]
|
2021-03-22 13:48:48 +00:00
|
|
|
}
|
|
|
|
|
2022-01-21 21:35:31 +00:00
|
|
|
generator zod {
|
|
|
|
provider = "zod-prisma"
|
|
|
|
output = "./zod"
|
|
|
|
imports = "./zod-utils"
|
|
|
|
relationModel = "default"
|
|
|
|
}
|
|
|
|
|
2023-05-02 11:44:05 +00:00
|
|
|
generator enums {
|
|
|
|
provider = "ts-node --transpile-only ./enum-generator"
|
|
|
|
}
|
|
|
|
|
2021-09-14 08:45:28 +00:00
|
|
|
enum SchedulingType {
|
2022-07-22 17:27:06 +00:00
|
|
|
ROUND_ROBIN @map("roundRobin")
|
|
|
|
COLLECTIVE @map("collective")
|
2023-04-13 02:10:23 +00:00
|
|
|
MANAGED @map("managed")
|
2021-09-14 08:45:28 +00:00
|
|
|
}
|
|
|
|
|
2021-11-18 01:03:19 +00:00
|
|
|
enum PeriodType {
|
2022-07-22 17:27:06 +00:00
|
|
|
UNLIMITED @map("unlimited")
|
|
|
|
ROLLING @map("rolling")
|
|
|
|
RANGE @map("range")
|
2021-11-18 01:03:19 +00:00
|
|
|
}
|
|
|
|
|
2023-01-12 21:09:12 +00:00
|
|
|
model Host {
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
userId Int
|
|
|
|
eventType EventType @relation(fields: [eventTypeId], references: [id], onDelete: Cascade)
|
|
|
|
eventTypeId Int
|
|
|
|
isFixed Boolean @default(false)
|
2023-03-08 22:04:33 +00:00
|
|
|
|
|
|
|
@@id([userId, eventTypeId])
|
2023-04-18 23:50:42 +00:00
|
|
|
@@index([userId])
|
|
|
|
@@index([eventTypeId])
|
2023-01-12 21:09:12 +00:00
|
|
|
}
|
|
|
|
|
2021-03-22 13:48:48 +00:00
|
|
|
model EventType {
|
2023-07-31 17:51:11 +00:00
|
|
|
id Int @id @default(autoincrement())
|
2022-10-11 00:28:24 +00:00
|
|
|
/// @zod.min(1)
|
2023-07-31 17:51:11 +00:00
|
|
|
title String
|
2022-01-21 21:35:31 +00:00
|
|
|
/// @zod.custom(imports.eventTypeSlug)
|
2023-07-31 17:51:11 +00:00
|
|
|
slug String
|
|
|
|
description String?
|
|
|
|
position Int @default(0)
|
2022-01-21 21:35:31 +00:00
|
|
|
/// @zod.custom(imports.eventTypeLocations)
|
2023-07-31 17:51:11 +00:00
|
|
|
locations Json?
|
2023-09-06 15:21:24 +00:00
|
|
|
/// @zod.min(1)
|
2023-07-31 17:51:11 +00:00
|
|
|
length Int
|
|
|
|
offsetStart Int @default(0)
|
|
|
|
hidden Boolean @default(false)
|
|
|
|
hosts Host[]
|
|
|
|
users User[] @relation("user_eventtype")
|
|
|
|
owner User? @relation("owner", fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
userId Int?
|
|
|
|
team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
|
|
|
teamId Int?
|
|
|
|
hashedLink HashedLink?
|
|
|
|
bookings Booking[]
|
|
|
|
availability Availability[]
|
|
|
|
webhooks Webhook[]
|
|
|
|
destinationCalendar DestinationCalendar?
|
|
|
|
eventName String?
|
|
|
|
customInputs EventTypeCustomInput[]
|
|
|
|
parentId Int?
|
|
|
|
parent EventType? @relation("managed_eventtype", fields: [parentId], references: [id], onDelete: Cascade)
|
|
|
|
children EventType[] @relation("managed_eventtype")
|
2023-03-02 18:15:28 +00:00
|
|
|
/// @zod.custom(imports.eventTypeBookingFields)
|
2023-07-31 17:51:11 +00:00
|
|
|
bookingFields Json?
|
|
|
|
timeZone String?
|
|
|
|
periodType PeriodType @default(UNLIMITED)
|
2023-08-25 13:29:04 +00:00
|
|
|
/// @zod.custom(imports.coerceToDate)
|
2023-07-31 17:51:11 +00:00
|
|
|
periodStartDate DateTime?
|
2023-08-25 13:29:04 +00:00
|
|
|
/// @zod.custom(imports.coerceToDate)
|
2023-07-31 17:51:11 +00:00
|
|
|
periodEndDate DateTime?
|
|
|
|
periodDays Int?
|
|
|
|
periodCountCalendarDays Boolean?
|
|
|
|
requiresConfirmation Boolean @default(false)
|
|
|
|
requiresBookerEmailVerification Boolean @default(false)
|
2022-06-10 00:32:34 +00:00
|
|
|
/// @zod.custom(imports.recurringEventType)
|
2023-07-31 17:51:11 +00:00
|
|
|
recurringEvent Json?
|
|
|
|
disableGuests Boolean @default(false)
|
|
|
|
hideCalendarNotes Boolean @default(false)
|
2023-03-25 00:37:46 +00:00
|
|
|
/// @zod.min(0)
|
2023-07-31 17:51:11 +00:00
|
|
|
minimumBookingNotice Int @default(120)
|
|
|
|
beforeEventBuffer Int @default(0)
|
|
|
|
afterEventBuffer Int @default(0)
|
|
|
|
seatsPerTimeSlot Int?
|
|
|
|
seatsShowAttendees Boolean? @default(false)
|
2023-09-08 15:37:26 +00:00
|
|
|
seatsShowAvailabilityCount Boolean? @default(true)
|
2023-07-31 17:51:11 +00:00
|
|
|
schedulingType SchedulingType?
|
|
|
|
schedule Schedule? @relation(fields: [scheduleId], references: [id])
|
|
|
|
scheduleId Int?
|
2022-10-14 16:24:43 +00:00
|
|
|
// price is deprecated. It has now moved to metadata.apps.stripe.price. Plan to drop this column.
|
2023-07-31 17:51:11 +00:00
|
|
|
price Int @default(0)
|
2022-10-14 16:24:43 +00:00
|
|
|
// currency is deprecated. It has now moved to metadata.apps.stripe.currency. Plan to drop this column.
|
2023-07-31 17:51:11 +00:00
|
|
|
currency String @default("usd")
|
|
|
|
slotInterval Int?
|
2022-10-14 16:24:43 +00:00
|
|
|
/// @zod.custom(imports.EventTypeMetaDataSchema)
|
2023-07-31 17:51:11 +00:00
|
|
|
metadata Json?
|
2022-08-01 21:44:08 +00:00
|
|
|
/// @zod.custom(imports.successRedirectUrl)
|
2023-07-31 17:51:11 +00:00
|
|
|
successRedirectUrl String?
|
|
|
|
workflows WorkflowsOnEventTypes[]
|
2023-03-10 20:00:19 +00:00
|
|
|
/// @zod.custom(imports.intervalLimitsType)
|
2023-07-31 17:51:11 +00:00
|
|
|
bookingLimits Json?
|
2023-03-10 20:00:19 +00:00
|
|
|
/// @zod.custom(imports.intervalLimitsType)
|
2023-07-31 17:51:11 +00:00
|
|
|
durationLimits Json?
|
2021-10-29 14:13:51 +00:00
|
|
|
|
2021-09-22 18:36:13 +00:00
|
|
|
@@unique([userId, slug])
|
2022-04-20 00:35:12 +00:00
|
|
|
@@unique([teamId, slug])
|
2023-04-13 02:10:23 +00:00
|
|
|
@@unique([userId, parentId])
|
2023-04-18 23:50:42 +00:00
|
|
|
@@index([userId])
|
|
|
|
@@index([teamId])
|
2021-03-22 13:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model Credential {
|
2022-07-06 22:55:29 +00:00
|
|
|
id Int @id @default(autoincrement())
|
2022-08-22 19:34:28 +00:00
|
|
|
// @@type is deprecated
|
2022-07-06 22:55:29 +00:00
|
|
|
type String
|
|
|
|
key Json
|
|
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
userId Int?
|
feat: Enable Apps for Teams & Orgs [CAL-1782] (#9337)
* Initial commit
* Adding feature flag
* Add schema relation for teams and credentials
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* Create getUserAdminTeams function & tRPC endpoint
* Get user admin teams on app store page
* Create UserAdminTeams type
* Add user query to getUserAdminTeams
* Letting duplicate slugs for teams to support orgs
* Covering null on unique clauses
* Add dropdown to install button on app store
* Supporting having the orgId in the session cookie
* On app page, only show dropdown if there are teams
* Add teamId to OAuth state
* Create team credential for OAuth flow
* Create team credential for GCal
* Add create user or team credential for Stripe
* Create webex credentials for users or teams
* Fix type error on useAddAppMutation
* Hubspot create credential on user or team
* Zoho create create credential for user or team
* Zoom create credentials on user or team
* Salesforce create credential on user or teams
* OAuth create credentials for user or teams
* Revert Outlook changes
* Revert GCal changes
* Default app instal, create credential on user or team
* Add teamId to credential creation
* Disable installing for teams for calendars
* Include teams when querying installed apps
* Render team credentials on installed page
* Uninstall team apps
* Type fix on app card
* Add input to include user in teams query
* Add dropdown to install app page for user or team
* Type fixes on category page
* Install app from eventType page to user or team
* Render user and team apps on event type app page
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* Render user and team apps on event type app page
* Add credentialOwner to eventTypeAppCard types
* Type fixes
* Create hook to check if app is enabled
* Clean up console.logs
* Fix useIsAppEnabled by returning not an array
* Convert event type apps to useIsAppEnabled
* Abstract credential owner type
* Remove console.logs
* On installed app page, show apps if only team credential is installed
* Clean up commented lines
* Handle installing app to just an team event from event type page
* Fix early return when creating team app credential
* Zoom add state to callback
* Get team location credentials and save credential id to location
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type fix
* Grab team location credentials
* Add isInstalled to eventType apps query
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* Enable payment apps for team credentials
* Fix for team-user apps for event types
* Fix layout and add teamId to app card
* Disable apps on managed event types
* Add managed event type fields to event type apps
* Include organizations in query
* Change createAppCredential to createOAuthAppCredential
* Show app installed on teams
* Making sure we let localhost still work
* UI show installed for which team
* Type fixes
* For team events move use host location to top
* Add around to appStore
* New team event types organizer default conf app
* Fix app card bug
* Clean up
* Search for teamId or userId when deleting credential
* Type fixes
* Type fixes
* Type fixes
* Type fixes
* Address feedback
* Feedback
* Type check fixes
* feat: Organization branding in side menu (#9279)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Making sure we show the set up profile on org only
* Profile username availability rely on org hook
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: Organization support for event types page (#9449)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Processing orgs and children as profile options
* Reverting change not belonging to this PR
* Making sure we show the set up profile on org only
* Removing console.log
* Comparing memberships to choose the highest one
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type errors
* Refactor and type fixes
* Update orgDomains.ts
* Feedback
* Reverting
* NIT
* Address feedback
* fix issue getting org slug from domain
* Improving orgDomains util
* Host comes with port
* Update useRouterQuery.ts
* Fix app card bug
* Fix schema
* Type fixes
* Revert changes to location apps
* Remove console.log
* Fix app store test
* Handle install app dropdown
* Add CalendarApp to `getCalendar`
* Add PaymentApp type fix
* Payment type fix
* Type fixes
* Match with main
* Change type to account for team
* Fix app count for team events
* Type fixes
* More type fixes
* Type fix?
* Fix the type fix
* Remove UserAdminTeams empty array union
* Type fix
* Type fix
* Type fix
* Uses type predicates
* Use teamId. Fixes installation for teams after user installation
* Fix Team Events not working
* Get embed for org events working
* Fix rewrites
* Address feedback
* Type fix
* Fixes
* Add useAppContextWithSchema in useIsAppEnabled
* Type fix for apps using useIsAppEnabled
* Integrations.handler change credentialIds to userCredentialIds
* Remove apps endpoint
* Add LockedIcon and disabled props to event type app context
* Type fixes
* Type fix
* Type fixes
* Show team installed apps for members
* Type fix
* Reverting findFirst
* Revert findFirst
* Avoid a possible 500
* Fix missing tanslation
* Avoid possible 500
* Undo default app for teams
* Type fix
* Fix test
* Update package.json
* feat: Fix invite bug - added tests (#9945)
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
* chore: Button Component Tidy up (#9888)
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* feat: Make Team Private
## What does this PR do?
Fixes https://github.com/calcom/cal.com/issues/8974
1) When user is admin
<img width="1440" alt="Screenshot 2023-07-03 at 6 45 50 PM" src="https://github.com/calcom/cal.com/assets/53316345/ce15158f-d278-4f1a-ba2e-8b63e4274793">
2) When user is not admin and team is private
<img width="1440" alt="Screenshot 2023-07-03 at 6 47 15 PM" src="https://github.com/calcom/cal.com/assets/53316345/ce23560e-690a-4c42-a76d-49691260aa4d">
3)
<img width="1440" alt="Screenshot 2023-07-03 at 6 51 56 PM" src="https://github.com/calcom/cal.com/assets/53316345/13af38f8-5618-4dae-b359-b24dc91e4eb4">
## Type of change
<!-- Please delete bullets that are not relevant. -->
- New feature (non-breaking change which adds functionality)
## How should this be tested?
1) go to Team members page and turn on switch Make Team Private.
Now after making the team private only admin would be able to see all the members list in the settings. There will not be a button to Book a team member instead on the team page like before.
## Mandatory Tasks
- [ ] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: Alan <alannnc@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2023-07-06 16:48:39 +00:00
|
|
|
team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
|
|
|
teamId Int?
|
2022-07-06 22:55:29 +00:00
|
|
|
app App? @relation(fields: [appId], references: [slug], onDelete: Cascade)
|
2022-06-07 06:13:32 +00:00
|
|
|
// How to make it a required column?
|
2022-07-06 22:55:29 +00:00
|
|
|
appId String?
|
2022-07-01 20:55:27 +00:00
|
|
|
destinationCalendars DestinationCalendar[]
|
2023-09-12 17:09:05 +00:00
|
|
|
selectedCalendars SelectedCalendar[]
|
2022-12-07 21:47:02 +00:00
|
|
|
invalid Boolean? @default(false)
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([userId])
|
|
|
|
@@index([appId])
|
2021-03-22 13:48:48 +00:00
|
|
|
}
|
|
|
|
|
2022-01-13 20:05:23 +00:00
|
|
|
enum IdentityProvider {
|
|
|
|
CAL
|
|
|
|
GOOGLE
|
|
|
|
SAML
|
|
|
|
}
|
|
|
|
|
2021-12-09 15:51:37 +00:00
|
|
|
model DestinationCalendar {
|
2022-07-06 22:55:29 +00:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
integration String
|
|
|
|
externalId String
|
2022-08-22 19:34:28 +00:00
|
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
2022-07-06 22:55:29 +00:00
|
|
|
userId Int? @unique
|
2022-07-18 15:37:47 +00:00
|
|
|
booking Booking[]
|
2022-08-22 19:34:28 +00:00
|
|
|
eventType EventType? @relation(fields: [eventTypeId], references: [id], onDelete: Cascade)
|
2022-07-06 22:55:29 +00:00
|
|
|
eventTypeId Int? @unique
|
2022-07-01 20:55:27 +00:00
|
|
|
credentialId Int?
|
2022-08-22 19:34:28 +00:00
|
|
|
credential Credential? @relation(fields: [credentialId], references: [id], onDelete: Cascade)
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([userId])
|
|
|
|
@@index([eventTypeId])
|
|
|
|
@@index([credentialId])
|
2021-12-09 15:51:37 +00:00
|
|
|
}
|
|
|
|
|
2022-04-26 08:48:17 +00:00
|
|
|
enum UserPermissionRole {
|
|
|
|
USER
|
|
|
|
ADMIN
|
|
|
|
}
|
|
|
|
|
2021-03-22 13:48:48 +00:00
|
|
|
model User {
|
2023-08-15 00:44:09 +00:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
username String?
|
|
|
|
name String?
|
2022-01-21 21:35:31 +00:00
|
|
|
/// @zod.email()
|
2023-08-15 00:44:09 +00:00
|
|
|
email String
|
|
|
|
emailVerified DateTime?
|
|
|
|
password String?
|
|
|
|
bio String?
|
|
|
|
avatar String?
|
|
|
|
timeZone String @default("Europe/London")
|
|
|
|
weekStart String @default("Sunday")
|
2021-12-08 12:08:57 +00:00
|
|
|
// DEPRECATED - TO BE REMOVED
|
2023-08-15 00:44:09 +00:00
|
|
|
startTime Int @default(0)
|
|
|
|
endTime Int @default(1440)
|
2021-12-08 12:08:57 +00:00
|
|
|
// </DEPRECATED>
|
2023-08-15 00:44:09 +00:00
|
|
|
bufferTime Int @default(0)
|
|
|
|
hideBranding Boolean @default(false)
|
|
|
|
theme String?
|
|
|
|
createdDate DateTime @default(now()) @map(name: "created")
|
|
|
|
trialEndsAt DateTime?
|
|
|
|
eventTypes EventType[] @relation("user_eventtype")
|
|
|
|
credentials Credential[]
|
|
|
|
teams Membership[]
|
|
|
|
bookings Booking[]
|
|
|
|
schedules Schedule[]
|
|
|
|
defaultScheduleId Int?
|
|
|
|
selectedCalendars SelectedCalendar[]
|
|
|
|
completedOnboarding Boolean @default(false)
|
|
|
|
locale String?
|
|
|
|
timeFormat Int? @default(12)
|
|
|
|
twoFactorSecret String?
|
|
|
|
twoFactorEnabled Boolean @default(false)
|
2023-08-30 07:33:48 +00:00
|
|
|
backupCodes String?
|
2023-08-15 00:44:09 +00:00
|
|
|
identityProvider IdentityProvider @default(CAL)
|
|
|
|
identityProviderId String?
|
|
|
|
availability Availability[]
|
|
|
|
invitedTo Int?
|
|
|
|
webhooks Webhook[]
|
|
|
|
brandColor String @default("#292929")
|
|
|
|
darkBrandColor String @default("#fafafa")
|
2021-12-09 15:51:37 +00:00
|
|
|
// the location where the events will end up
|
2023-08-15 00:44:09 +00:00
|
|
|
destinationCalendar DestinationCalendar?
|
|
|
|
away Boolean @default(false)
|
2022-04-06 17:20:30 +00:00
|
|
|
// participate in dynamic group booking or not
|
2023-08-15 00:44:09 +00:00
|
|
|
allowDynamicBooking Boolean? @default(true)
|
|
|
|
|
|
|
|
// participate in SEO indexing or not
|
|
|
|
allowSEOIndexing Boolean? @default(true)
|
|
|
|
|
2022-06-14 20:07:54 +00:00
|
|
|
/// @zod.custom(imports.userMetadata)
|
2022-05-25 15:21:18 +00:00
|
|
|
metadata Json?
|
2022-07-14 12:40:53 +00:00
|
|
|
verified Boolean? @default(false)
|
|
|
|
role UserPermissionRole @default(USER)
|
|
|
|
disableImpersonation Boolean @default(false)
|
|
|
|
impersonatedUsers Impersonations[] @relation("impersonated_user")
|
|
|
|
impersonatedBy Impersonations[] @relation("impersonated_by_user")
|
2022-05-25 15:21:18 +00:00
|
|
|
apiKeys ApiKey[]
|
|
|
|
accounts Account[]
|
|
|
|
sessions Session[]
|
2022-07-20 18:49:53 +00:00
|
|
|
Feedback Feedback[]
|
|
|
|
ownedEventTypes EventType[] @relation("owner")
|
2022-07-14 00:10:45 +00:00
|
|
|
workflows Workflow[]
|
2022-07-14 12:40:53 +00:00
|
|
|
routingForms App_RoutingForms_Form[] @relation("routing-form")
|
2022-12-15 21:54:40 +00:00
|
|
|
verifiedNumbers VerifiedNumber[]
|
2023-01-12 21:09:12 +00:00
|
|
|
hosts Host[]
|
feat: Organizations (#8993)
* Initial commit
* Adding feature flag
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* Letting duplicate slugs for teams to support orgs
* Covering null on unique clauses
* Supporting having the orgId in the session cookie
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* Making sure we let localhost still work
* Feedback
* Type check fixes
* feat: Organization branding in side menu (#9279)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Making sure we show the set up profile on org only
* Profile username availability rely on org hook
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: Organization support for event types page (#9449)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Processing orgs and children as profile options
* Reverting change not belonging to this PR
* Making sure we show the set up profile on org only
* Removing console.log
* Comparing memberships to choose the highest one
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type errors
* Refactor and type fixes
* Update orgDomains.ts
* Feedback
* Reverting
* NIT
* fix issue getting org slug from domain
* Improving orgDomains util
* Host comes with port
* Update useRouterQuery.ts
* Feedback
* Feedback
* Feedback
* Feedback: SSR for user event-types to have org context
* chore: Cache node_modules (#9492)
* Adding check for cache hit
* Adding a separate install step first
* Put the restore cache steps back
* Revert the uses type for restoring cache
* Added step to restore nm cache
* Removed the cache-hit check
* Comments and naming
* Removed extra install command
* Updated the name of the linting step to be more clear
* Removes the need for useEffect here
* Feedback
* Feedback
* Cookie domain needs a dot
* Type fix
* Update apps/web/public/static/locales/en/common.json
Co-authored-by: Omar López <zomars@me.com>
* Update packages/emails/src/templates/OrganizationAccountVerifyEmail.tsx
* Feedback
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2023-06-14 21:40:20 +00:00
|
|
|
organizationId Int?
|
|
|
|
organization Team? @relation("scope", fields: [organizationId], references: [id], onDelete: SetNull)
|
|
|
|
// Linking account code for orgs v2
|
|
|
|
//linkedByUserId Int?
|
|
|
|
//linkedBy User? @relation("linked_account", fields: [linkedByUserId], references: [id], onDelete: Cascade)
|
|
|
|
//linkedUsers User[] @relation("linked_account")*/
|
2022-07-14 12:40:53 +00:00
|
|
|
|
feat: Organizations (#8993)
* Initial commit
* Adding feature flag
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* Letting duplicate slugs for teams to support orgs
* Covering null on unique clauses
* Supporting having the orgId in the session cookie
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* Making sure we let localhost still work
* Feedback
* Type check fixes
* feat: Organization branding in side menu (#9279)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Making sure we show the set up profile on org only
* Profile username availability rely on org hook
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: Organization support for event types page (#9449)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Processing orgs and children as profile options
* Reverting change not belonging to this PR
* Making sure we show the set up profile on org only
* Removing console.log
* Comparing memberships to choose the highest one
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type errors
* Refactor and type fixes
* Update orgDomains.ts
* Feedback
* Reverting
* NIT
* fix issue getting org slug from domain
* Improving orgDomains util
* Host comes with port
* Update useRouterQuery.ts
* Feedback
* Feedback
* Feedback
* Feedback: SSR for user event-types to have org context
* chore: Cache node_modules (#9492)
* Adding check for cache hit
* Adding a separate install step first
* Put the restore cache steps back
* Revert the uses type for restoring cache
* Added step to restore nm cache
* Removed the cache-hit check
* Comments and naming
* Removed extra install command
* Updated the name of the linting step to be more clear
* Removes the need for useEffect here
* Feedback
* Feedback
* Cookie domain needs a dot
* Type fix
* Update apps/web/public/static/locales/en/common.json
Co-authored-by: Omar López <zomars@me.com>
* Update packages/emails/src/templates/OrganizationAccountVerifyEmail.tsx
* Feedback
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2023-06-14 21:40:20 +00:00
|
|
|
@@unique([email])
|
|
|
|
@@unique([email, username])
|
|
|
|
@@unique([username, organizationId])
|
2023-04-18 23:50:42 +00:00
|
|
|
@@index([emailVerified])
|
|
|
|
@@index([identityProvider])
|
|
|
|
@@index([identityProviderId])
|
2021-03-22 13:48:48 +00:00
|
|
|
@@map(name: "users")
|
2021-06-05 22:53:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model Team {
|
2023-06-22 22:25:37 +00:00
|
|
|
id Int @id @default(autoincrement())
|
2022-10-11 00:28:24 +00:00
|
|
|
/// @zod.min(1)
|
2023-01-06 10:55:57 +00:00
|
|
|
name String
|
2022-10-11 00:28:24 +00:00
|
|
|
/// @zod.min(1)
|
feat: Organizations (#8993)
* Initial commit
* Adding feature flag
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* Letting duplicate slugs for teams to support orgs
* Covering null on unique clauses
* Supporting having the orgId in the session cookie
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* Making sure we let localhost still work
* Feedback
* Type check fixes
* feat: Organization branding in side menu (#9279)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Making sure we show the set up profile on org only
* Profile username availability rely on org hook
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: Organization support for event types page (#9449)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Processing orgs and children as profile options
* Reverting change not belonging to this PR
* Making sure we show the set up profile on org only
* Removing console.log
* Comparing memberships to choose the highest one
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type errors
* Refactor and type fixes
* Update orgDomains.ts
* Feedback
* Reverting
* NIT
* fix issue getting org slug from domain
* Improving orgDomains util
* Host comes with port
* Update useRouterQuery.ts
* Feedback
* Feedback
* Feedback
* Feedback: SSR for user event-types to have org context
* chore: Cache node_modules (#9492)
* Adding check for cache hit
* Adding a separate install step first
* Put the restore cache steps back
* Revert the uses type for restoring cache
* Added step to restore nm cache
* Removed the cache-hit check
* Comments and naming
* Removed extra install command
* Updated the name of the linting step to be more clear
* Removes the need for useEffect here
* Feedback
* Feedback
* Cookie domain needs a dot
* Type fix
* Update apps/web/public/static/locales/en/common.json
Co-authored-by: Omar López <zomars@me.com>
* Update packages/emails/src/templates/OrganizationAccountVerifyEmail.tsx
* Feedback
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2023-06-14 21:40:20 +00:00
|
|
|
slug String?
|
2023-01-06 10:55:57 +00:00
|
|
|
logo String?
|
2023-04-19 20:55:40 +00:00
|
|
|
appLogo String?
|
|
|
|
appIconLogo String?
|
2023-01-06 10:55:57 +00:00
|
|
|
bio String?
|
2023-06-22 22:25:37 +00:00
|
|
|
hideBranding Boolean @default(false)
|
2023-07-06 09:55:12 +00:00
|
|
|
isPrivate Boolean @default(false)
|
2023-06-22 22:25:37 +00:00
|
|
|
hideBookATeamMember Boolean @default(false)
|
2023-01-06 10:55:57 +00:00
|
|
|
members Membership[]
|
|
|
|
eventTypes EventType[]
|
2023-02-27 07:24:43 +00:00
|
|
|
workflows Workflow[]
|
2023-06-22 22:25:37 +00:00
|
|
|
createdAt DateTime @default(now())
|
2022-11-10 20:23:56 +00:00
|
|
|
/// @zod.custom(imports.teamMetadataSchema)
|
2023-01-06 10:55:57 +00:00
|
|
|
metadata Json?
|
2023-02-01 18:27:26 +00:00
|
|
|
theme String?
|
2023-06-22 22:25:37 +00:00
|
|
|
brandColor String @default("#292929")
|
|
|
|
darkBrandColor String @default("#fafafa")
|
2023-02-27 07:24:43 +00:00
|
|
|
verifiedNumbers VerifiedNumber[]
|
feat: Organizations (#8993)
* Initial commit
* Adding feature flag
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* Letting duplicate slugs for teams to support orgs
* Covering null on unique clauses
* Supporting having the orgId in the session cookie
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* Making sure we let localhost still work
* Feedback
* Type check fixes
* feat: Organization branding in side menu (#9279)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Making sure we show the set up profile on org only
* Profile username availability rely on org hook
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: Organization support for event types page (#9449)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Processing orgs and children as profile options
* Reverting change not belonging to this PR
* Making sure we show the set up profile on org only
* Removing console.log
* Comparing memberships to choose the highest one
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type errors
* Refactor and type fixes
* Update orgDomains.ts
* Feedback
* Reverting
* NIT
* fix issue getting org slug from domain
* Improving orgDomains util
* Host comes with port
* Update useRouterQuery.ts
* Feedback
* Feedback
* Feedback
* Feedback: SSR for user event-types to have org context
* chore: Cache node_modules (#9492)
* Adding check for cache hit
* Adding a separate install step first
* Put the restore cache steps back
* Revert the uses type for restoring cache
* Added step to restore nm cache
* Removed the cache-hit check
* Comments and naming
* Removed extra install command
* Updated the name of the linting step to be more clear
* Removes the need for useEffect here
* Feedback
* Feedback
* Cookie domain needs a dot
* Type fix
* Update apps/web/public/static/locales/en/common.json
Co-authored-by: Omar López <zomars@me.com>
* Update packages/emails/src/templates/OrganizationAccountVerifyEmail.tsx
* Feedback
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2023-06-14 21:40:20 +00:00
|
|
|
parentId Int?
|
2023-06-22 22:25:37 +00:00
|
|
|
parent Team? @relation("organization", fields: [parentId], references: [id], onDelete: Cascade)
|
|
|
|
children Team[] @relation("organization")
|
|
|
|
orgUsers User[] @relation("scope")
|
2023-07-12 21:24:47 +00:00
|
|
|
inviteTokens VerificationToken[]
|
2023-05-23 01:15:29 +00:00
|
|
|
webhooks Webhook[]
|
feat: Org settings - profile,appearance, child teams, create new child (#9231)
* Initial commit
* Adding feature flag
* Desktop first banner, mobile pending
* Removing dead code and img
* AppInstallButtonBase
* WIP
* Adds Email verification template+translations for organizations (#9202)
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Session logic to show org label
* Step 2 done, avatar not working
* List orgs and list teams specific if orgs exist
* Conditionally show org - fix settings layout - add labels for all pages
* Profile Page + update
* Org specific team creation
* appearance page
* Ensure members cant of org cant update settings in UI
* Fix update handler imports
* hide billing on sub teams
* Update profile slug page
* Letting duplicate slugs for teams to support orgs
* Add slug coliisions for org
* Covering null on unique clauses
* Covering null on unique clauses
* Extract to utils
* Update settings to use subdomain path in team url , team + org
* Supporting having the orgId in the session cookie
* Onboarding admins step
* Last step to create teams
* Update handler comments
* Upgrade ORG banner - disabled team banner for child teams
* Handle publishing ORGS
* Fix licenese issue
* Update packages/trpc/server/routers/viewer/teams/create.handler.ts
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* A11ly
* Feedback
* Making an org avatar (temp)
* Add slug colission detection for user and team name
* Fix Import
* Remove update password func
* Fix module import over relative
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* Remove app install button sa its in 9337
* Remove i18n key not being used
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* feat: organization settings general and members page (#9266)
* feat: organization settings general page
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* feat: add members page
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* chore: remove
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: use invalidate
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: delete mutation
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: remove organization id
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* chore
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: use zod schema
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Type fixes
* Reverting changes
* Update UsernameTextfield.tsx
* More reverts
* Update next-auth-options.ts
* Update common.json
* Type fixes
* Include invite token for orgs
* Update org schema
* Make token settings optional as it isnt used in orgs yet
* Fix missing prop
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
2023-06-15 17:27:39 +00:00
|
|
|
timeFormat Int?
|
2023-06-22 22:25:37 +00:00
|
|
|
timeZone String @default("Europe/London")
|
|
|
|
weekStart String @default("Sunday")
|
2023-06-15 08:58:07 +00:00
|
|
|
routingForms App_RoutingForms_Form[]
|
2023-07-14 23:06:57 +00:00
|
|
|
apiKeys ApiKey[]
|
feat: Enable Apps for Teams & Orgs [CAL-1782] (#9337)
* Initial commit
* Adding feature flag
* Add schema relation for teams and credentials
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* Create getUserAdminTeams function & tRPC endpoint
* Get user admin teams on app store page
* Create UserAdminTeams type
* Add user query to getUserAdminTeams
* Letting duplicate slugs for teams to support orgs
* Covering null on unique clauses
* Add dropdown to install button on app store
* Supporting having the orgId in the session cookie
* On app page, only show dropdown if there are teams
* Add teamId to OAuth state
* Create team credential for OAuth flow
* Create team credential for GCal
* Add create user or team credential for Stripe
* Create webex credentials for users or teams
* Fix type error on useAddAppMutation
* Hubspot create credential on user or team
* Zoho create create credential for user or team
* Zoom create credentials on user or team
* Salesforce create credential on user or teams
* OAuth create credentials for user or teams
* Revert Outlook changes
* Revert GCal changes
* Default app instal, create credential on user or team
* Add teamId to credential creation
* Disable installing for teams for calendars
* Include teams when querying installed apps
* Render team credentials on installed page
* Uninstall team apps
* Type fix on app card
* Add input to include user in teams query
* Add dropdown to install app page for user or team
* Type fixes on category page
* Install app from eventType page to user or team
* Render user and team apps on event type app page
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* Render user and team apps on event type app page
* Add credentialOwner to eventTypeAppCard types
* Type fixes
* Create hook to check if app is enabled
* Clean up console.logs
* Fix useIsAppEnabled by returning not an array
* Convert event type apps to useIsAppEnabled
* Abstract credential owner type
* Remove console.logs
* On installed app page, show apps if only team credential is installed
* Clean up commented lines
* Handle installing app to just an team event from event type page
* Fix early return when creating team app credential
* Zoom add state to callback
* Get team location credentials and save credential id to location
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type fix
* Grab team location credentials
* Add isInstalled to eventType apps query
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* Enable payment apps for team credentials
* Fix for team-user apps for event types
* Fix layout and add teamId to app card
* Disable apps on managed event types
* Add managed event type fields to event type apps
* Include organizations in query
* Change createAppCredential to createOAuthAppCredential
* Show app installed on teams
* Making sure we let localhost still work
* UI show installed for which team
* Type fixes
* For team events move use host location to top
* Add around to appStore
* New team event types organizer default conf app
* Fix app card bug
* Clean up
* Search for teamId or userId when deleting credential
* Type fixes
* Type fixes
* Type fixes
* Type fixes
* Address feedback
* Feedback
* Type check fixes
* feat: Organization branding in side menu (#9279)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Making sure we show the set up profile on org only
* Profile username availability rely on org hook
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: Organization support for event types page (#9449)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Processing orgs and children as profile options
* Reverting change not belonging to this PR
* Making sure we show the set up profile on org only
* Removing console.log
* Comparing memberships to choose the highest one
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type errors
* Refactor and type fixes
* Update orgDomains.ts
* Feedback
* Reverting
* NIT
* Address feedback
* fix issue getting org slug from domain
* Improving orgDomains util
* Host comes with port
* Update useRouterQuery.ts
* Fix app card bug
* Fix schema
* Type fixes
* Revert changes to location apps
* Remove console.log
* Fix app store test
* Handle install app dropdown
* Add CalendarApp to `getCalendar`
* Add PaymentApp type fix
* Payment type fix
* Type fixes
* Match with main
* Change type to account for team
* Fix app count for team events
* Type fixes
* More type fixes
* Type fix?
* Fix the type fix
* Remove UserAdminTeams empty array union
* Type fix
* Type fix
* Type fix
* Uses type predicates
* Use teamId. Fixes installation for teams after user installation
* Fix Team Events not working
* Get embed for org events working
* Fix rewrites
* Address feedback
* Type fix
* Fixes
* Add useAppContextWithSchema in useIsAppEnabled
* Type fix for apps using useIsAppEnabled
* Integrations.handler change credentialIds to userCredentialIds
* Remove apps endpoint
* Add LockedIcon and disabled props to event type app context
* Type fixes
* Type fix
* Type fixes
* Show team installed apps for members
* Type fix
* Reverting findFirst
* Revert findFirst
* Avoid a possible 500
* Fix missing tanslation
* Avoid possible 500
* Undo default app for teams
* Type fix
* Fix test
* Update package.json
* feat: Fix invite bug - added tests (#9945)
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
* chore: Button Component Tidy up (#9888)
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* feat: Make Team Private
## What does this PR do?
Fixes https://github.com/calcom/cal.com/issues/8974
1) When user is admin
<img width="1440" alt="Screenshot 2023-07-03 at 6 45 50 PM" src="https://github.com/calcom/cal.com/assets/53316345/ce15158f-d278-4f1a-ba2e-8b63e4274793">
2) When user is not admin and team is private
<img width="1440" alt="Screenshot 2023-07-03 at 6 47 15 PM" src="https://github.com/calcom/cal.com/assets/53316345/ce23560e-690a-4c42-a76d-49691260aa4d">
3)
<img width="1440" alt="Screenshot 2023-07-03 at 6 51 56 PM" src="https://github.com/calcom/cal.com/assets/53316345/13af38f8-5618-4dae-b359-b24dc91e4eb4">
## Type of change
<!-- Please delete bullets that are not relevant. -->
- New feature (non-breaking change which adds functionality)
## How should this be tested?
1) go to Team members page and turn on switch Make Team Private.
Now after making the team private only admin would be able to see all the members list in the settings. There will not be a button to Book a team member instead on the team page like before.
## Mandatory Tasks
- [ ] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: Alan <alannnc@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2023-07-06 16:48:39 +00:00
|
|
|
credentials Credential[]
|
feat: Organizations (#8993)
* Initial commit
* Adding feature flag
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* Letting duplicate slugs for teams to support orgs
* Covering null on unique clauses
* Supporting having the orgId in the session cookie
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* Making sure we let localhost still work
* Feedback
* Type check fixes
* feat: Organization branding in side menu (#9279)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Making sure we show the set up profile on org only
* Profile username availability rely on org hook
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: Organization support for event types page (#9449)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Processing orgs and children as profile options
* Reverting change not belonging to this PR
* Making sure we show the set up profile on org only
* Removing console.log
* Comparing memberships to choose the highest one
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type errors
* Refactor and type fixes
* Update orgDomains.ts
* Feedback
* Reverting
* NIT
* fix issue getting org slug from domain
* Improving orgDomains util
* Host comes with port
* Update useRouterQuery.ts
* Feedback
* Feedback
* Feedback
* Feedback: SSR for user event-types to have org context
* chore: Cache node_modules (#9492)
* Adding check for cache hit
* Adding a separate install step first
* Put the restore cache steps back
* Revert the uses type for restoring cache
* Added step to restore nm cache
* Removed the cache-hit check
* Comments and naming
* Removed extra install command
* Updated the name of the linting step to be more clear
* Removes the need for useEffect here
* Feedback
* Feedback
* Cookie domain needs a dot
* Type fix
* Update apps/web/public/static/locales/en/common.json
Co-authored-by: Omar López <zomars@me.com>
* Update packages/emails/src/templates/OrganizationAccountVerifyEmail.tsx
* Feedback
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2023-06-14 21:40:20 +00:00
|
|
|
|
|
|
|
@@unique([slug, parentId])
|
2021-06-05 22:53:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum MembershipRole {
|
|
|
|
MEMBER
|
2021-12-09 23:51:30 +00:00
|
|
|
ADMIN
|
2021-06-05 22:53:33 +00:00
|
|
|
OWNER
|
|
|
|
}
|
|
|
|
|
|
|
|
model Membership {
|
2023-06-30 15:32:35 +00:00
|
|
|
id Int @id @default(autoincrement())
|
2022-07-21 17:02:20 +00:00
|
|
|
teamId Int
|
|
|
|
userId Int
|
|
|
|
accepted Boolean @default(false)
|
|
|
|
role MembershipRole
|
2022-10-11 01:24:46 +00:00
|
|
|
team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
2022-07-21 17:02:20 +00:00
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
disableImpersonation Boolean @default(false)
|
2021-06-05 22:53:33 +00:00
|
|
|
|
2023-06-30 15:32:35 +00:00
|
|
|
@@unique([userId, teamId])
|
2023-04-18 23:50:42 +00:00
|
|
|
@@index([teamId])
|
|
|
|
@@index([userId])
|
2021-06-09 21:29:31 +00:00
|
|
|
}
|
|
|
|
|
2022-04-21 20:32:25 +00:00
|
|
|
model VerificationToken {
|
2023-06-06 23:34:14 +00:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
identifier String
|
|
|
|
token String @unique
|
|
|
|
expires DateTime
|
|
|
|
expiresInDays Int?
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime @updatedAt
|
2023-07-12 21:24:47 +00:00
|
|
|
teamId Int?
|
2023-06-06 23:34:14 +00:00
|
|
|
team Team? @relation(fields: [teamId], references: [id])
|
2021-09-02 12:13:19 +00:00
|
|
|
|
2021-06-09 21:29:31 +00:00
|
|
|
@@unique([identifier, token])
|
2023-04-18 23:50:42 +00:00
|
|
|
@@index([token])
|
2021-06-11 21:02:07 +00:00
|
|
|
}
|
|
|
|
|
2021-06-05 23:31:03 +00:00
|
|
|
model BookingReference {
|
2022-05-17 19:31:49 +00:00
|
|
|
id Int @id @default(autoincrement())
|
2022-10-11 03:33:38 +00:00
|
|
|
/// @zod.min(1)
|
2022-05-17 19:31:49 +00:00
|
|
|
type String
|
2022-10-11 03:33:38 +00:00
|
|
|
/// @zod.min(1)
|
2022-05-17 19:31:49 +00:00
|
|
|
uid String
|
|
|
|
meetingId String?
|
|
|
|
meetingPassword String?
|
|
|
|
meetingUrl String?
|
|
|
|
booking Booking? @relation(fields: [bookingId], references: [id], onDelete: Cascade)
|
|
|
|
bookingId Int?
|
2022-05-16 20:20:09 +00:00
|
|
|
externalCalendarId String?
|
2022-05-17 19:31:49 +00:00
|
|
|
deleted Boolean?
|
2022-07-18 15:37:47 +00:00
|
|
|
credentialId Int?
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([bookingId])
|
|
|
|
@@index([credentialId])
|
|
|
|
@@index([type])
|
|
|
|
@@index([uid])
|
2021-06-05 23:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model Attendee {
|
2023-03-14 04:19:05 +00:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
email String
|
|
|
|
name String
|
|
|
|
timeZone String
|
|
|
|
locale String? @default("en")
|
|
|
|
booking Booking? @relation(fields: [bookingId], references: [id], onDelete: Cascade)
|
|
|
|
bookingId Int?
|
|
|
|
bookingSeat BookingSeat?
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([email])
|
|
|
|
@@index([bookingId])
|
2021-06-05 23:31:03 +00:00
|
|
|
}
|
|
|
|
|
2021-09-13 08:57:56 +00:00
|
|
|
enum BookingStatus {
|
2022-07-22 17:27:06 +00:00
|
|
|
CANCELLED @map("cancelled")
|
|
|
|
ACCEPTED @map("accepted")
|
|
|
|
REJECTED @map("rejected")
|
|
|
|
PENDING @map("pending")
|
2021-09-13 08:57:56 +00:00
|
|
|
}
|
|
|
|
|
2021-06-05 23:31:03 +00:00
|
|
|
model Booking {
|
2022-07-18 15:37:47 +00:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
uid String @unique
|
2023-03-14 04:19:05 +00:00
|
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
2022-07-18 15:37:47 +00:00
|
|
|
userId Int?
|
|
|
|
references BookingReference[]
|
|
|
|
eventType EventType? @relation(fields: [eventTypeId], references: [id])
|
|
|
|
eventTypeId Int?
|
|
|
|
title String
|
|
|
|
description String?
|
|
|
|
customInputs Json?
|
2023-03-02 18:15:28 +00:00
|
|
|
/// @zod.custom(imports.bookingResponses)
|
|
|
|
responses Json?
|
2022-07-18 15:37:47 +00:00
|
|
|
startTime DateTime
|
|
|
|
endTime DateTime
|
|
|
|
attendees Attendee[]
|
|
|
|
location String?
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime?
|
|
|
|
status BookingStatus @default(ACCEPTED)
|
|
|
|
paid Boolean @default(false)
|
|
|
|
payment Payment[]
|
|
|
|
destinationCalendar DestinationCalendar? @relation(fields: [destinationCalendarId], references: [id])
|
|
|
|
destinationCalendarId Int?
|
|
|
|
cancellationReason String?
|
|
|
|
rejectionReason String?
|
|
|
|
dynamicEventSlugRef String?
|
|
|
|
dynamicGroupSlugRef String?
|
|
|
|
rescheduled Boolean?
|
|
|
|
fromReschedule String?
|
|
|
|
recurringEventId String?
|
|
|
|
smsReminderNumber String?
|
|
|
|
workflowReminders WorkflowReminder[]
|
2022-08-15 20:18:41 +00:00
|
|
|
scheduledJobs String[]
|
2023-03-14 04:19:05 +00:00
|
|
|
seatsReferences BookingSeat[]
|
2022-12-15 21:43:07 +00:00
|
|
|
/// @zod.custom(imports.bookingMetadataSchema)
|
|
|
|
metadata Json?
|
2023-04-13 19:07:10 +00:00
|
|
|
isRecorded Boolean @default(false)
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([eventTypeId])
|
|
|
|
@@index([userId])
|
|
|
|
@@index([destinationCalendarId])
|
|
|
|
@@index([recurringEventId])
|
|
|
|
@@index([uid])
|
|
|
|
@@index([status])
|
2021-09-02 12:13:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model Schedule {
|
2022-03-17 16:48:23 +00:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
userId Int
|
2022-06-22 15:43:25 +00:00
|
|
|
eventType EventType[]
|
2022-03-17 16:48:23 +00:00
|
|
|
name String
|
|
|
|
timeZone String?
|
|
|
|
availability Availability[]
|
2023-01-05 22:29:03 +00:00
|
|
|
|
|
|
|
@@index([userId])
|
2021-06-14 18:53:20 +00:00
|
|
|
}
|
|
|
|
|
2021-06-28 04:24:15 +00:00
|
|
|
model Availability {
|
2021-09-02 12:13:19 +00:00
|
|
|
id Int @id @default(autoincrement())
|
2022-01-14 13:49:15 +00:00
|
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
2021-09-02 12:13:19 +00:00
|
|
|
userId Int?
|
|
|
|
eventType EventType? @relation(fields: [eventTypeId], references: [id])
|
|
|
|
eventTypeId Int?
|
|
|
|
days Int[]
|
2021-11-10 11:16:32 +00:00
|
|
|
startTime DateTime @db.Time
|
|
|
|
endTime DateTime @db.Time
|
2021-09-02 12:13:19 +00:00
|
|
|
date DateTime? @db.Date
|
2022-03-17 16:48:23 +00:00
|
|
|
Schedule Schedule? @relation(fields: [scheduleId], references: [id])
|
|
|
|
scheduleId Int?
|
2023-01-05 22:29:03 +00:00
|
|
|
|
2023-04-18 23:50:42 +00:00
|
|
|
@@index([userId])
|
2023-01-05 22:29:03 +00:00
|
|
|
@@index([eventTypeId])
|
|
|
|
@@index([scheduleId])
|
2021-06-14 18:53:20 +00:00
|
|
|
}
|
2021-06-20 17:52:18 +00:00
|
|
|
|
2021-06-14 17:45:24 +00:00
|
|
|
model SelectedCalendar {
|
2023-09-12 17:09:05 +00:00
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
userId Int
|
|
|
|
integration String
|
|
|
|
externalId String
|
|
|
|
credential Credential? @relation(fields: [credentialId], references: [id], onDelete: Cascade)
|
|
|
|
credentialId Int?
|
2021-09-02 12:13:19 +00:00
|
|
|
|
|
|
|
@@id([userId, integration, externalId])
|
2023-04-18 23:50:42 +00:00
|
|
|
@@index([userId])
|
|
|
|
@@index([integration])
|
|
|
|
@@index([externalId])
|
2021-06-14 17:45:24 +00:00
|
|
|
}
|
2021-06-19 18:55:40 +00:00
|
|
|
|
2021-08-14 17:03:50 +00:00
|
|
|
enum EventTypeCustomInputType {
|
2022-07-22 17:27:06 +00:00
|
|
|
TEXT @map("text")
|
|
|
|
TEXTLONG @map("textLong")
|
|
|
|
NUMBER @map("number")
|
|
|
|
BOOL @map("bool")
|
2022-12-01 21:53:52 +00:00
|
|
|
RADIO @map("radio")
|
2022-12-16 19:39:41 +00:00
|
|
|
PHONE @map("phone")
|
2021-08-14 17:03:50 +00:00
|
|
|
}
|
|
|
|
|
2021-06-19 18:55:40 +00:00
|
|
|
model EventTypeCustomInput {
|
2021-09-02 12:13:19 +00:00
|
|
|
id Int @id @default(autoincrement())
|
2021-06-19 18:55:40 +00:00
|
|
|
eventTypeId Int
|
2022-07-20 18:49:53 +00:00
|
|
|
eventType EventType @relation(fields: [eventTypeId], references: [id], onDelete: Cascade)
|
2021-06-19 18:55:40 +00:00
|
|
|
label String
|
2021-08-14 17:03:50 +00:00
|
|
|
type EventTypeCustomInputType
|
2023-01-07 17:17:32 +00:00
|
|
|
/// @zod.custom(imports.customInputOptionSchema)
|
2022-12-01 21:53:52 +00:00
|
|
|
options Json?
|
2021-06-19 18:55:40 +00:00
|
|
|
required Boolean
|
2021-09-06 13:51:15 +00:00
|
|
|
placeholder String @default("")
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([eventTypeId])
|
2021-06-19 18:55:40 +00:00
|
|
|
}
|
|
|
|
|
2021-06-30 02:01:29 +00:00
|
|
|
model ResetPasswordRequest {
|
2021-09-02 12:13:19 +00:00
|
|
|
id String @id @default(cuid())
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime @updatedAt
|
|
|
|
email String
|
|
|
|
expires DateTime
|
2021-06-30 02:01:29 +00:00
|
|
|
}
|
2021-07-18 19:12:35 +00:00
|
|
|
|
|
|
|
enum ReminderType {
|
|
|
|
PENDING_BOOKING_CONFIRMATION
|
|
|
|
}
|
|
|
|
|
|
|
|
model ReminderMail {
|
2021-09-02 12:13:19 +00:00
|
|
|
id Int @id @default(autoincrement())
|
2021-07-18 19:12:35 +00:00
|
|
|
referenceId Int
|
|
|
|
reminderType ReminderType
|
|
|
|
elapsedMinutes Int
|
2021-09-02 12:13:19 +00:00
|
|
|
createdAt DateTime @default(now())
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([referenceId])
|
|
|
|
@@index([reminderType])
|
2021-07-18 19:12:35 +00:00
|
|
|
}
|
2021-09-22 18:36:13 +00:00
|
|
|
|
|
|
|
model Payment {
|
2023-04-11 21:44:14 +00:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
uid String @unique
|
|
|
|
app App? @relation(fields: [appId], references: [slug], onDelete: Cascade)
|
|
|
|
appId String?
|
|
|
|
bookingId Int
|
|
|
|
booking Booking? @relation(fields: [bookingId], references: [id], onDelete: Cascade)
|
|
|
|
amount Int
|
|
|
|
fee Int
|
|
|
|
currency String
|
|
|
|
success Boolean
|
|
|
|
refunded Boolean
|
|
|
|
data Json
|
2023-08-11 23:56:38 +00:00
|
|
|
externalId String @unique
|
2023-04-11 21:44:14 +00:00
|
|
|
paymentOption PaymentOption? @default(ON_BOOKING)
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([bookingId])
|
|
|
|
@@index([externalId])
|
2023-04-11 21:44:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum PaymentOption {
|
|
|
|
ON_BOOKING
|
|
|
|
HOLD
|
2021-09-22 18:36:13 +00:00
|
|
|
}
|
2021-10-07 15:14:47 +00:00
|
|
|
|
|
|
|
enum WebhookTriggerEvents {
|
|
|
|
BOOKING_CREATED
|
2023-06-13 14:57:59 +00:00
|
|
|
BOOKING_PAID
|
2021-10-07 15:14:47 +00:00
|
|
|
BOOKING_RESCHEDULED
|
2023-05-30 15:35:05 +00:00
|
|
|
BOOKING_REQUESTED
|
2021-10-07 15:14:47 +00:00
|
|
|
BOOKING_CANCELLED
|
2023-05-30 15:35:05 +00:00
|
|
|
BOOKING_REJECTED
|
2022-07-20 18:30:57 +00:00
|
|
|
FORM_SUBMITTED
|
2022-08-15 20:18:41 +00:00
|
|
|
MEETING_ENDED
|
2023-05-10 14:56:31 +00:00
|
|
|
RECORDING_READY
|
2021-10-07 15:14:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model Webhook {
|
2021-11-22 11:37:07 +00:00
|
|
|
id String @id @unique
|
2022-03-02 16:24:57 +00:00
|
|
|
userId Int?
|
2023-05-23 01:15:29 +00:00
|
|
|
teamId Int?
|
2022-03-02 16:24:57 +00:00
|
|
|
eventTypeId Int?
|
2022-10-14 23:41:40 +00:00
|
|
|
/// @zod.url()
|
2021-11-22 11:37:07 +00:00
|
|
|
subscriberUrl String
|
|
|
|
payloadTemplate String?
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
active Boolean @default(true)
|
|
|
|
eventTriggers WebhookTriggerEvents[]
|
2022-03-03 19:29:19 +00:00
|
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
2023-05-23 01:15:29 +00:00
|
|
|
team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
2022-03-03 19:29:19 +00:00
|
|
|
eventType EventType? @relation(fields: [eventTypeId], references: [id], onDelete: Cascade)
|
2022-05-03 23:16:59 +00:00
|
|
|
app App? @relation(fields: [appId], references: [slug], onDelete: Cascade)
|
|
|
|
appId String?
|
2022-06-16 16:21:48 +00:00
|
|
|
secret String?
|
2022-08-31 03:41:23 +00:00
|
|
|
|
|
|
|
@@unique([userId, subscriberUrl], name: "courseIdentifier")
|
2021-10-07 15:14:47 +00:00
|
|
|
}
|
2022-04-16 02:58:34 +00:00
|
|
|
|
2022-04-26 08:48:17 +00:00
|
|
|
model Impersonations {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
createdAt DateTime @default(now())
|
2022-05-26 15:48:02 +00:00
|
|
|
impersonatedUser User @relation("impersonated_user", fields: [impersonatedUserId], references: [id], onDelete: Cascade)
|
|
|
|
impersonatedBy User @relation("impersonated_by_user", fields: [impersonatedById], references: [id], onDelete: Cascade)
|
2022-04-26 08:48:17 +00:00
|
|
|
impersonatedUserId Int
|
|
|
|
impersonatedById Int
|
|
|
|
}
|
|
|
|
|
2022-04-16 02:58:34 +00:00
|
|
|
model ApiKey {
|
|
|
|
id String @id @unique @default(cuid())
|
|
|
|
userId Int
|
2023-07-14 23:06:57 +00:00
|
|
|
teamId Int?
|
2022-04-16 02:58:34 +00:00
|
|
|
note String?
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
expiresAt DateTime?
|
|
|
|
lastUsedAt DateTime?
|
|
|
|
hashedKey String @unique()
|
|
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
2023-07-14 23:06:57 +00:00
|
|
|
team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
2022-05-03 23:16:59 +00:00
|
|
|
app App? @relation(fields: [appId], references: [slug], onDelete: Cascade)
|
|
|
|
appId String?
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([userId])
|
2022-04-16 02:58:34 +00:00
|
|
|
}
|
2022-04-26 15:12:08 +00:00
|
|
|
|
2022-04-28 15:44:26 +00:00
|
|
|
model HashedLink {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
link String @unique()
|
|
|
|
eventType EventType @relation(fields: [eventTypeId], references: [id], onDelete: Cascade)
|
|
|
|
eventTypeId Int @unique
|
|
|
|
}
|
|
|
|
|
2022-04-26 15:12:08 +00:00
|
|
|
model Account {
|
|
|
|
id String @id @default(cuid())
|
|
|
|
userId Int
|
|
|
|
type String
|
|
|
|
provider String
|
|
|
|
providerAccountId String
|
|
|
|
refresh_token String? @db.Text
|
|
|
|
access_token String? @db.Text
|
|
|
|
expires_at Int?
|
|
|
|
token_type String?
|
|
|
|
scope String?
|
|
|
|
id_token String? @db.Text
|
|
|
|
session_state String?
|
|
|
|
|
|
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
|
|
|
|
@@unique([provider, providerAccountId])
|
2023-04-18 23:50:42 +00:00
|
|
|
@@index([userId])
|
|
|
|
@@index([type])
|
2022-04-26 15:12:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model Session {
|
|
|
|
id String @id @default(cuid())
|
|
|
|
sessionToken String @unique
|
|
|
|
userId Int
|
|
|
|
expires DateTime
|
|
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([userId])
|
2022-04-26 15:12:08 +00:00
|
|
|
}
|
2022-05-02 20:39:35 +00:00
|
|
|
|
|
|
|
enum AppCategories {
|
|
|
|
calendar
|
|
|
|
messaging
|
|
|
|
other
|
|
|
|
payment
|
2023-06-28 16:22:51 +00:00
|
|
|
video // deprecated, please use 'conferencing' instead
|
|
|
|
web3 // deprecated, we should no longer have any web3 apps
|
2022-09-15 08:16:56 +00:00
|
|
|
automation
|
2022-10-14 16:24:43 +00:00
|
|
|
analytics
|
2023-07-13 11:57:49 +00:00
|
|
|
// Wherever video is in use, conferencing should also be used for legacy apps can have it.
|
2023-06-28 16:22:51 +00:00
|
|
|
conferencing
|
|
|
|
crm
|
2022-05-02 20:39:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model App {
|
|
|
|
// The slug for the app store public page inside `/apps/[slug]`
|
|
|
|
slug String @id @unique
|
|
|
|
// The directory name for `/packages/app-store/[dirName]`
|
|
|
|
dirName String @unique
|
|
|
|
// Needed API Keys
|
|
|
|
keys Json?
|
|
|
|
// One or multiple categories to which this app belongs
|
|
|
|
categories AppCategories[]
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime @updatedAt
|
|
|
|
credentials Credential[]
|
2023-02-08 20:36:22 +00:00
|
|
|
payments Payment[]
|
2022-05-03 23:16:59 +00:00
|
|
|
Webhook Webhook[]
|
|
|
|
ApiKey ApiKey[]
|
2022-12-07 21:47:02 +00:00
|
|
|
enabled Boolean @default(false)
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([enabled])
|
2022-05-02 20:39:35 +00:00
|
|
|
}
|
2022-05-24 13:29:39 +00:00
|
|
|
|
2022-07-14 12:40:53 +00:00
|
|
|
model App_RoutingForms_Form {
|
|
|
|
id String @id @default(cuid())
|
|
|
|
description String?
|
2023-08-31 18:57:33 +00:00
|
|
|
position Int @default(0)
|
2022-07-14 12:40:53 +00:00
|
|
|
routes Json?
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime @updatedAt
|
|
|
|
name String
|
|
|
|
fields Json?
|
|
|
|
user User @relation("routing-form", fields: [userId], references: [id], onDelete: Cascade)
|
2023-06-15 08:58:07 +00:00
|
|
|
// This is the user who created the form and also the user who has read-write access to the form
|
|
|
|
// If teamId is set, the members of the team would also have access to form readOnly or read-write depending on their permission level as team member.
|
2022-07-14 12:40:53 +00:00
|
|
|
userId Int
|
2023-06-15 08:58:07 +00:00
|
|
|
team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
|
|
|
teamId Int?
|
2022-07-14 12:40:53 +00:00
|
|
|
responses App_RoutingForms_FormResponse[]
|
|
|
|
disabled Boolean @default(false)
|
2022-11-03 14:40:03 +00:00
|
|
|
/// @zod.custom(imports.RoutingFormSettings)
|
|
|
|
settings Json?
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([userId])
|
|
|
|
@@index([disabled])
|
2022-07-14 12:40:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model App_RoutingForms_FormResponse {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
formFillerId String @default(cuid())
|
|
|
|
form App_RoutingForms_Form @relation(fields: [formId], references: [id], onDelete: Cascade)
|
|
|
|
formId String
|
|
|
|
response Json
|
2022-08-13 11:04:57 +00:00
|
|
|
createdAt DateTime @default(now())
|
2022-07-14 12:40:53 +00:00
|
|
|
|
|
|
|
@@unique([formFillerId, formId])
|
2023-04-18 23:50:42 +00:00
|
|
|
@@index([formFillerId])
|
|
|
|
@@index([formId])
|
2022-07-14 12:40:53 +00:00
|
|
|
}
|
|
|
|
|
2022-05-24 13:29:39 +00:00
|
|
|
model Feedback {
|
|
|
|
id Int @id @default(autoincrement())
|
2022-07-20 18:49:53 +00:00
|
|
|
date DateTime @default(now())
|
2022-05-24 13:29:39 +00:00
|
|
|
userId Int
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
rating String
|
|
|
|
comment String?
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([userId])
|
|
|
|
@@index([rating])
|
2022-05-24 13:29:39 +00:00
|
|
|
}
|
2022-07-14 00:10:45 +00:00
|
|
|
|
|
|
|
enum WorkflowTriggerEvents {
|
|
|
|
BEFORE_EVENT
|
|
|
|
EVENT_CANCELLED
|
|
|
|
NEW_EVENT
|
2022-10-07 18:18:28 +00:00
|
|
|
AFTER_EVENT
|
2022-08-31 23:09:34 +00:00
|
|
|
RESCHEDULE_EVENT
|
2022-07-14 00:10:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum WorkflowActions {
|
|
|
|
EMAIL_HOST
|
|
|
|
EMAIL_ATTENDEE
|
|
|
|
SMS_ATTENDEE
|
|
|
|
SMS_NUMBER
|
2022-10-10 13:40:20 +00:00
|
|
|
EMAIL_ADDRESS
|
2023-07-11 15:48:44 +00:00
|
|
|
WHATSAPP_ATTENDEE
|
|
|
|
WHATSAPP_NUMBER
|
2022-07-14 00:10:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model WorkflowStep {
|
2022-12-15 21:54:40 +00:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
stepNumber Int
|
|
|
|
action WorkflowActions
|
|
|
|
workflowId Int
|
|
|
|
workflow Workflow @relation(fields: [workflowId], references: [id], onDelete: Cascade)
|
|
|
|
sendTo String?
|
|
|
|
reminderBody String?
|
|
|
|
emailSubject String?
|
|
|
|
template WorkflowTemplates @default(REMINDER)
|
|
|
|
workflowReminders WorkflowReminder[]
|
|
|
|
numberRequired Boolean?
|
|
|
|
sender String?
|
|
|
|
numberVerificationPending Boolean @default(true)
|
2023-08-29 11:56:26 +00:00
|
|
|
includeCalendarEvent Boolean @default(false)
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([workflowId])
|
2022-07-14 00:10:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model Workflow {
|
|
|
|
id Int @id @default(autoincrement())
|
2023-08-31 18:57:33 +00:00
|
|
|
position Int @default(0)
|
2022-07-14 00:10:45 +00:00
|
|
|
name String
|
2023-02-27 07:24:43 +00:00
|
|
|
userId Int?
|
|
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
|
|
|
teamId Int?
|
2022-07-14 00:10:45 +00:00
|
|
|
activeOn WorkflowsOnEventTypes[]
|
|
|
|
trigger WorkflowTriggerEvents
|
|
|
|
time Int?
|
|
|
|
timeUnit TimeUnit?
|
|
|
|
steps WorkflowStep[]
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([userId])
|
|
|
|
@@index([teamId])
|
2022-07-14 00:10:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model WorkflowsOnEventTypes {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
workflow Workflow @relation(fields: [workflowId], references: [id], onDelete: Cascade)
|
|
|
|
workflowId Int
|
|
|
|
eventType EventType @relation(fields: [eventTypeId], references: [id], onDelete: Cascade)
|
|
|
|
eventTypeId Int
|
2023-04-18 23:50:42 +00:00
|
|
|
|
2023-05-15 13:56:26 +00:00
|
|
|
@@unique([workflowId, eventTypeId])
|
2023-04-18 23:50:42 +00:00
|
|
|
@@index([workflowId])
|
|
|
|
@@index([eventTypeId])
|
2022-07-14 00:10:45 +00:00
|
|
|
}
|
|
|
|
|
2023-01-26 20:36:15 +00:00
|
|
|
model Deployment {
|
|
|
|
/// This is a single row table, so we use a fixed id
|
|
|
|
id Int @id @default(1)
|
|
|
|
logo String?
|
|
|
|
/// @zod.custom(imports.DeploymentTheme)
|
|
|
|
theme Json?
|
|
|
|
licenseKey String?
|
|
|
|
agreedLicenseAt DateTime?
|
|
|
|
}
|
|
|
|
|
2022-07-14 00:10:45 +00:00
|
|
|
enum TimeUnit {
|
2022-07-22 17:27:06 +00:00
|
|
|
DAY @map("day")
|
|
|
|
HOUR @map("hour")
|
|
|
|
MINUTE @map("minute")
|
2022-07-14 00:10:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model WorkflowReminder {
|
2023-08-01 14:13:28 +00:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
bookingUid String?
|
|
|
|
booking Booking? @relation(fields: [bookingUid], references: [uid])
|
|
|
|
method WorkflowMethods
|
|
|
|
scheduledDate DateTime
|
|
|
|
referenceId String? @unique
|
|
|
|
scheduled Boolean
|
|
|
|
workflowStepId Int?
|
|
|
|
workflowStep WorkflowStep? @relation(fields: [workflowStepId], references: [id])
|
|
|
|
cancelled Boolean?
|
|
|
|
seatReferenceId String?
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([bookingUid])
|
|
|
|
@@index([workflowStepId])
|
2023-08-01 14:13:28 +00:00
|
|
|
@@index([seatReferenceId])
|
2022-07-14 00:10:45 +00:00
|
|
|
}
|
|
|
|
|
2023-08-30 23:17:42 +00:00
|
|
|
model WebhookScheduledTriggers {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
jobName String
|
|
|
|
subscriberUrl String
|
|
|
|
payload String
|
|
|
|
startAfter DateTime
|
|
|
|
retryCount Int @default(0)
|
|
|
|
createdAt DateTime? @default(now())
|
|
|
|
}
|
|
|
|
|
2022-07-14 00:10:45 +00:00
|
|
|
enum WorkflowTemplates {
|
|
|
|
REMINDER
|
|
|
|
CUSTOM
|
2023-07-11 15:48:44 +00:00
|
|
|
CANCELLED
|
|
|
|
RESCHEDULED
|
|
|
|
COMPLETED
|
2022-07-14 00:10:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum WorkflowMethods {
|
|
|
|
EMAIL
|
|
|
|
SMS
|
2023-07-11 15:48:44 +00:00
|
|
|
WHATSAPP
|
2022-07-14 00:10:45 +00:00
|
|
|
}
|
2022-12-15 21:54:40 +00:00
|
|
|
|
2023-03-14 04:19:05 +00:00
|
|
|
model BookingSeat {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
referenceUid String @unique
|
|
|
|
bookingId Int
|
|
|
|
booking Booking @relation(fields: [bookingId], references: [id], onDelete: Cascade)
|
|
|
|
attendeeId Int @unique
|
|
|
|
attendee Attendee @relation(fields: [attendeeId], references: [id], onDelete: Cascade)
|
|
|
|
data Json?
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([bookingId])
|
|
|
|
@@index([attendeeId])
|
2023-03-14 04:19:05 +00:00
|
|
|
}
|
|
|
|
|
2022-12-15 21:54:40 +00:00
|
|
|
model VerifiedNumber {
|
|
|
|
id Int @id @default(autoincrement())
|
2023-02-27 07:24:43 +00:00
|
|
|
userId Int?
|
|
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
teamId Int?
|
|
|
|
team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
2022-12-15 21:54:40 +00:00
|
|
|
phoneNumber String
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([userId])
|
|
|
|
@@index([teamId])
|
2022-12-15 21:54:40 +00:00
|
|
|
}
|
2023-03-25 00:59:04 +00:00
|
|
|
|
|
|
|
model Feature {
|
|
|
|
// The feature slug, ex: 'v2-workflows'
|
|
|
|
slug String @id @unique
|
|
|
|
// If the feature is currently enabled
|
|
|
|
enabled Boolean @default(false)
|
|
|
|
// A short description of the feature
|
|
|
|
description String?
|
|
|
|
// The type of feature flag
|
|
|
|
type FeatureType? @default(RELEASE)
|
|
|
|
// If the flag is considered stale
|
|
|
|
stale Boolean? @default(false)
|
|
|
|
lastUsedAt DateTime?
|
|
|
|
createdAt DateTime? @default(now())
|
|
|
|
updatedAt DateTime? @default(now()) @updatedAt
|
|
|
|
updatedBy Int?
|
2023-04-18 23:50:42 +00:00
|
|
|
|
|
|
|
@@index([enabled])
|
|
|
|
@@index([stale])
|
2023-03-25 00:59:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum FeatureType {
|
|
|
|
RELEASE
|
|
|
|
EXPERIMENT
|
|
|
|
OPERATIONAL
|
|
|
|
KILL_SWITCH
|
|
|
|
PERMISSION
|
|
|
|
}
|
2023-04-13 19:55:26 +00:00
|
|
|
|
|
|
|
model SelectedSlots {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
eventTypeId Int
|
|
|
|
userId Int
|
|
|
|
slotUtcStartDate DateTime
|
|
|
|
slotUtcEndDate DateTime
|
|
|
|
uid String
|
|
|
|
releaseAt DateTime
|
|
|
|
isSeat Boolean @default(false)
|
|
|
|
|
|
|
|
@@unique(fields: [userId, slotUtcStartDate, slotUtcEndDate, uid], name: "selectedSlotUnique")
|
|
|
|
}
|
2023-04-19 20:14:09 +00:00
|
|
|
|
|
|
|
view BookingTimeStatus {
|
2023-07-20 19:19:13 +00:00
|
|
|
id Int @unique
|
|
|
|
uid String?
|
|
|
|
eventTypeId Int?
|
|
|
|
title String?
|
|
|
|
description String?
|
|
|
|
startTime DateTime?
|
|
|
|
endTime DateTime?
|
|
|
|
createdAt DateTime?
|
|
|
|
location String?
|
|
|
|
paid Boolean?
|
|
|
|
status BookingStatus?
|
|
|
|
rescheduled Boolean?
|
|
|
|
userId Int?
|
|
|
|
teamId Int?
|
|
|
|
eventLength Int?
|
|
|
|
timeStatus String?
|
|
|
|
eventParentId Int?
|
2023-04-19 20:14:09 +00:00
|
|
|
}
|