cal.pub0.org/packages/prisma/selects/user.ts

51 lines
1.0 KiB
TypeScript
Raw Normal View History

2022-06-10 18:38:46 +00:00
import { Prisma } from "@prisma/client";
export const availabilityUserSelect = Prisma.validator<Prisma.UserSelect>()({
id: true,
2022-06-10 18:38:46 +00:00
timeZone: true,
email: true,
2022-06-10 18:38:46 +00:00
bufferTime: true,
startTime: true,
username: true,
2022-06-10 18:38:46 +00:00
endTime: true,
timeFormat: true,
defaultScheduleId: true,
// Relationships
2022-06-10 18:38:46 +00:00
schedules: {
select: {
availability: true,
timeZone: true,
id: true,
},
},
availability: true,
selectedCalendars: true,
2022-06-10 18:38:46 +00:00
});
export const baseUserSelect = Prisma.validator<Prisma.UserSelect>()({
name: true,
destinationCalendar: true,
locale: true,
hideBranding: true,
theme: true,
brandColor: true,
darkBrandColor: true,
...availabilityUserSelect,
});
export const userSelect = Prisma.validator<Prisma.UserArgs>()({
select: {
name: true,
allowDynamicBooking: true,
2022-06-10 18:38:46 +00:00
destinationCalendar: true,
locale: true,
hideBranding: true,
theme: true,
brandColor: true,
darkBrandColor: true,
metadata: true,
organizationId: true,
2022-06-10 18:38:46 +00:00
...availabilityUserSelect,
},
});