diff --git a/front/src/generated/graphql.tsx b/front/src/generated/graphql.tsx index f97be1dad9a..28f3d641b66 100644 --- a/front/src/generated/graphql.tsx +++ b/front/src/generated/graphql.tsx @@ -82,6 +82,19 @@ export type CommentCreateInput = { updatedAt?: InputMaybe; }; +export type CommentCreateManyAuthorInput = { + body: Scalars['String']; + commentThreadId: Scalars['String']; + createdAt?: InputMaybe; + id?: InputMaybe; + updatedAt?: InputMaybe; +}; + +export type CommentCreateManyAuthorInputEnvelope = { + data: Array; + skipDuplicates?: InputMaybe; +}; + export type CommentCreateManyCommentThreadInput = { authorId: Scalars['String']; body: Scalars['String']; @@ -95,15 +108,35 @@ export type CommentCreateManyCommentThreadInputEnvelope = { skipDuplicates?: InputMaybe; }; +export type CommentCreateNestedManyWithoutAuthorInput = { + connect?: InputMaybe>; + connectOrCreate?: InputMaybe>; + create?: InputMaybe>; + createMany?: InputMaybe; +}; + export type CommentCreateNestedManyWithoutCommentThreadInput = { createMany?: InputMaybe; }; +export type CommentCreateOrConnectWithoutAuthorInput = { + create: CommentCreateWithoutAuthorInput; + where: CommentWhereUniqueInput; +}; + export type CommentCreateOrConnectWithoutCommentThreadInput = { create: CommentCreateWithoutCommentThreadInput; where: CommentWhereUniqueInput; }; +export type CommentCreateWithoutAuthorInput = { + body: Scalars['String']; + commentThread: CommentThreadCreateNestedOneWithoutCommentsInput; + createdAt?: InputMaybe; + id?: InputMaybe; + updatedAt?: InputMaybe; +}; + export type CommentCreateWithoutCommentThreadInput = { author: UserCreateNestedOneWithoutCommentsInput; body: Scalars['String']; @@ -136,7 +169,8 @@ export type CommentScalarWhereInput = { export type CommentThread = { __typename?: 'CommentThread'; - authorId?: Maybe; + author: User; + authorId: Scalars['String']; body?: Maybe; commentThreadTargets?: Maybe>; comments?: Maybe>; @@ -147,7 +181,7 @@ export type CommentThread = { }; export type CommentThreadCreateInput = { - authorId?: InputMaybe; + author: UserCreateNestedOneWithoutCommentThreadInput; body?: InputMaybe; commentThreadTargets?: InputMaybe; comments?: InputMaybe; @@ -157,11 +191,72 @@ export type CommentThreadCreateInput = { updatedAt?: InputMaybe; }; +export type CommentThreadCreateManyAuthorInput = { + body?: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; + title?: InputMaybe; + updatedAt?: InputMaybe; +}; + +export type CommentThreadCreateManyAuthorInputEnvelope = { + data: Array; + skipDuplicates?: InputMaybe; +}; + +export type CommentThreadCreateNestedManyWithoutAuthorInput = { + connect?: InputMaybe>; + connectOrCreate?: InputMaybe>; + create?: InputMaybe>; + createMany?: InputMaybe; +}; + export type CommentThreadCreateNestedOneWithoutCommentsInput = { connect?: InputMaybe; }; +export type CommentThreadCreateOrConnectWithoutAuthorInput = { + create: CommentThreadCreateWithoutAuthorInput; + where: CommentThreadWhereUniqueInput; +}; + +export type CommentThreadCreateOrConnectWithoutCommentsInput = { + create: CommentThreadCreateWithoutCommentsInput; + where: CommentThreadWhereUniqueInput; +}; + +export type CommentThreadCreateWithoutAuthorInput = { + body?: InputMaybe; + commentThreadTargets?: InputMaybe; + comments?: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; + title?: InputMaybe; + updatedAt?: InputMaybe; +}; + +export type CommentThreadCreateWithoutCommentsInput = { + author: UserCreateNestedOneWithoutCommentThreadInput; + body?: InputMaybe; + commentThreadTargets?: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; + title?: InputMaybe; + updatedAt?: InputMaybe; +}; + +export type CommentThreadListRelationFilter = { + every?: InputMaybe; + none?: InputMaybe; + some?: InputMaybe; +}; + +export type CommentThreadOrderByRelationAggregateInput = { + _count?: InputMaybe; +}; + export type CommentThreadOrderByWithRelationInput = { + author?: InputMaybe; authorId?: InputMaybe; body?: InputMaybe; commentThreadTargets?: InputMaybe; @@ -188,6 +283,18 @@ export enum CommentThreadScalarFieldEnum { WorkspaceId = 'workspaceId' } +export type CommentThreadScalarWhereInput = { + AND?: InputMaybe>; + NOT?: InputMaybe>; + OR?: InputMaybe>; + authorId?: InputMaybe; + body?: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; + title?: InputMaybe; + updatedAt?: InputMaybe; +}; + export type CommentThreadTarget = { __typename?: 'CommentThreadTarget'; commentThread: CommentThread; @@ -315,7 +422,7 @@ export type CommentThreadTargetWhereUniqueInput = { }; export type CommentThreadUpdateInput = { - authorId?: InputMaybe; + author?: InputMaybe; body?: InputMaybe; commentThreadTargets?: InputMaybe; comments?: InputMaybe; @@ -325,11 +432,83 @@ export type CommentThreadUpdateInput = { updatedAt?: InputMaybe; }; +export type CommentThreadUpdateManyMutationInput = { + body?: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; + title?: InputMaybe; + updatedAt?: InputMaybe; +}; + +export type CommentThreadUpdateManyWithWhereWithoutAuthorInput = { + data: CommentThreadUpdateManyMutationInput; + where: CommentThreadScalarWhereInput; +}; + +export type CommentThreadUpdateManyWithoutAuthorNestedInput = { + connect?: InputMaybe>; + connectOrCreate?: InputMaybe>; + create?: InputMaybe>; + createMany?: InputMaybe; + delete?: InputMaybe>; + deleteMany?: InputMaybe>; + disconnect?: InputMaybe>; + set?: InputMaybe>; + update?: InputMaybe>; + updateMany?: InputMaybe>; + upsert?: InputMaybe>; +}; + +export type CommentThreadUpdateOneRequiredWithoutCommentsNestedInput = { + connect?: InputMaybe; + connectOrCreate?: InputMaybe; + create?: InputMaybe; + update?: InputMaybe; + upsert?: InputMaybe; +}; + +export type CommentThreadUpdateWithWhereUniqueWithoutAuthorInput = { + data: CommentThreadUpdateWithoutAuthorInput; + where: CommentThreadWhereUniqueInput; +}; + +export type CommentThreadUpdateWithoutAuthorInput = { + body?: InputMaybe; + commentThreadTargets?: InputMaybe; + comments?: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; + title?: InputMaybe; + updatedAt?: InputMaybe; +}; + +export type CommentThreadUpdateWithoutCommentsInput = { + author?: InputMaybe; + body?: InputMaybe; + commentThreadTargets?: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; + title?: InputMaybe; + updatedAt?: InputMaybe; +}; + +export type CommentThreadUpsertWithWhereUniqueWithoutAuthorInput = { + create: CommentThreadCreateWithoutAuthorInput; + update: CommentThreadUpdateWithoutAuthorInput; + where: CommentThreadWhereUniqueInput; +}; + +export type CommentThreadUpsertWithoutCommentsInput = { + create: CommentThreadCreateWithoutCommentsInput; + update: CommentThreadUpdateWithoutCommentsInput; +}; + export type CommentThreadWhereInput = { AND?: InputMaybe>; NOT?: InputMaybe>; OR?: InputMaybe>; - authorId?: InputMaybe; + author?: InputMaybe; + authorId?: InputMaybe; body?: InputMaybe; commentThreadTargets?: InputMaybe; comments?: InputMaybe; @@ -350,11 +529,30 @@ export type CommentUpdateManyMutationInput = { updatedAt?: InputMaybe; }; +export type CommentUpdateManyWithWhereWithoutAuthorInput = { + data: CommentUpdateManyMutationInput; + where: CommentScalarWhereInput; +}; + export type CommentUpdateManyWithWhereWithoutCommentThreadInput = { data: CommentUpdateManyMutationInput; where: CommentScalarWhereInput; }; +export type CommentUpdateManyWithoutAuthorNestedInput = { + connect?: InputMaybe>; + connectOrCreate?: InputMaybe>; + create?: InputMaybe>; + createMany?: InputMaybe; + delete?: InputMaybe>; + deleteMany?: InputMaybe>; + disconnect?: InputMaybe>; + set?: InputMaybe>; + update?: InputMaybe>; + updateMany?: InputMaybe>; + upsert?: InputMaybe>; +}; + export type CommentUpdateManyWithoutCommentThreadNestedInput = { connect?: InputMaybe>; connectOrCreate?: InputMaybe>; @@ -369,11 +567,24 @@ export type CommentUpdateManyWithoutCommentThreadNestedInput = { upsert?: InputMaybe>; }; +export type CommentUpdateWithWhereUniqueWithoutAuthorInput = { + data: CommentUpdateWithoutAuthorInput; + where: CommentWhereUniqueInput; +}; + export type CommentUpdateWithWhereUniqueWithoutCommentThreadInput = { data: CommentUpdateWithoutCommentThreadInput; where: CommentWhereUniqueInput; }; +export type CommentUpdateWithoutAuthorInput = { + body?: InputMaybe; + commentThread?: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; + updatedAt?: InputMaybe; +}; + export type CommentUpdateWithoutCommentThreadInput = { author?: InputMaybe; body?: InputMaybe; @@ -382,6 +593,12 @@ export type CommentUpdateWithoutCommentThreadInput = { updatedAt?: InputMaybe; }; +export type CommentUpsertWithWhereUniqueWithoutAuthorInput = { + create: CommentCreateWithoutAuthorInput; + update: CommentUpdateWithoutAuthorInput; + where: CommentWhereUniqueInput; +}; + export type CommentUpsertWithWhereUniqueWithoutCommentThreadInput = { create: CommentCreateWithoutCommentThreadInput; update: CommentUpdateWithoutCommentThreadInput; @@ -1405,6 +1622,7 @@ export type StringNullableFilter = { export type User = { __typename?: 'User'; + CommentThread?: Maybe>; avatarUrl?: Maybe; comments?: Maybe>; companies?: Maybe>; @@ -1424,6 +1642,12 @@ export type User = { workspaceMember?: Maybe; }; +export type UserCreateNestedOneWithoutCommentThreadInput = { + connect?: InputMaybe; + connectOrCreate?: InputMaybe; + create?: InputMaybe; +}; + export type UserCreateNestedOneWithoutCommentsInput = { connect?: InputMaybe; }; @@ -1432,12 +1656,36 @@ export type UserCreateNestedOneWithoutCompaniesInput = { connect?: InputMaybe; }; +export type UserCreateOrConnectWithoutCommentThreadInput = { + create: UserCreateWithoutCommentThreadInput; + where: UserWhereUniqueInput; +}; + export type UserCreateOrConnectWithoutCommentsInput = { create: UserCreateWithoutCommentsInput; where: UserWhereUniqueInput; }; +export type UserCreateWithoutCommentThreadInput = { + avatarUrl?: InputMaybe; + comments?: InputMaybe; + companies?: InputMaybe; + createdAt?: InputMaybe; + disabled?: InputMaybe; + email: Scalars['String']; + emailVerified?: InputMaybe; + firstName: Scalars['String']; + id?: InputMaybe; + lastName: Scalars['String']; + lastSeen?: InputMaybe; + locale: Scalars['String']; + metadata?: InputMaybe; + phoneNumber?: InputMaybe; + updatedAt?: InputMaybe; +}; + export type UserCreateWithoutCommentsInput = { + CommentThread?: InputMaybe; avatarUrl?: InputMaybe; companies?: InputMaybe; createdAt?: InputMaybe; @@ -1455,6 +1703,7 @@ export type UserCreateWithoutCommentsInput = { }; export type UserOrderByWithRelationInput = { + CommentThread?: InputMaybe; avatarUrl?: InputMaybe; comments?: InputMaybe; companies?: InputMaybe; @@ -1495,6 +1744,14 @@ export enum UserScalarFieldEnum { UpdatedAt = 'updatedAt' } +export type UserUpdateOneRequiredWithoutCommentThreadNestedInput = { + connect?: InputMaybe; + connectOrCreate?: InputMaybe; + create?: InputMaybe; + update?: InputMaybe; + upsert?: InputMaybe; +}; + export type UserUpdateOneRequiredWithoutCommentsNestedInput = { connect?: InputMaybe; connectOrCreate?: InputMaybe; @@ -1507,7 +1764,26 @@ export type UserUpdateOneWithoutCompaniesNestedInput = { connect?: InputMaybe; }; +export type UserUpdateWithoutCommentThreadInput = { + avatarUrl?: InputMaybe; + comments?: InputMaybe; + companies?: InputMaybe; + createdAt?: InputMaybe; + disabled?: InputMaybe; + email?: InputMaybe; + emailVerified?: InputMaybe; + firstName?: InputMaybe; + id?: InputMaybe; + lastName?: InputMaybe; + lastSeen?: InputMaybe; + locale?: InputMaybe; + metadata?: InputMaybe; + phoneNumber?: InputMaybe; + updatedAt?: InputMaybe; +}; + export type UserUpdateWithoutCommentsInput = { + CommentThread?: InputMaybe; avatarUrl?: InputMaybe; companies?: InputMaybe; createdAt?: InputMaybe; @@ -1524,6 +1800,11 @@ export type UserUpdateWithoutCommentsInput = { updatedAt?: InputMaybe; }; +export type UserUpsertWithoutCommentThreadInput = { + create: UserCreateWithoutCommentThreadInput; + update: UserUpdateWithoutCommentThreadInput; +}; + export type UserUpsertWithoutCommentsInput = { create: UserCreateWithoutCommentsInput; update: UserUpdateWithoutCommentsInput; @@ -1531,6 +1812,7 @@ export type UserUpsertWithoutCommentsInput = { export type UserWhereInput = { AND?: InputMaybe>; + CommentThread?: InputMaybe; NOT?: InputMaybe>; OR?: InputMaybe>; avatarUrl?: InputMaybe; @@ -1644,7 +1926,7 @@ export type CreateCommentThreadWithCommentMutationVariables = Exact<{ }>; -export type CreateCommentThreadWithCommentMutation = { __typename?: 'Mutation', createOneCommentThread: { __typename?: 'CommentThread', id: string, createdAt: string, updatedAt: string, commentThreadTargets?: Array<{ __typename?: 'CommentThreadTarget', id: string, createdAt: string, updatedAt: string, commentThreadId: string, commentableType: CommentableType, commentableId: string }> | null, comments?: Array<{ __typename?: 'Comment', id: string, createdAt: string, updatedAt: string, body: string, author: { __typename?: 'User', id: string } }> | null } }; +export type CreateCommentThreadWithCommentMutation = { __typename?: 'Mutation', createOneCommentThread: { __typename?: 'CommentThread', id: string, createdAt: string, updatedAt: string, authorId: string, commentThreadTargets?: Array<{ __typename?: 'CommentThreadTarget', id: string, createdAt: string, updatedAt: string, commentThreadId: string, commentableType: CommentableType, commentableId: string }> | null, comments?: Array<{ __typename?: 'Comment', id: string, createdAt: string, updatedAt: string, body: string, author: { __typename?: 'User', id: string } }> | null } }; export type GetCommentThreadsByTargetsQueryVariables = Exact<{ commentThreadTargetIds: Array | Scalars['String']; @@ -1652,14 +1934,14 @@ export type GetCommentThreadsByTargetsQueryVariables = Exact<{ }>; -export type GetCommentThreadsByTargetsQuery = { __typename?: 'Query', findManyCommentThreads: Array<{ __typename?: 'CommentThread', id: string, title?: string | null, body?: string | null, authorId?: string | null, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName: string, lastName: string, avatarUrl?: string | null } }> | null, commentThreadTargets?: Array<{ __typename?: 'CommentThreadTarget', id: string, commentableId: string, commentableType: CommentableType }> | null }> }; +export type GetCommentThreadsByTargetsQuery = { __typename?: 'Query', findManyCommentThreads: Array<{ __typename?: 'CommentThread', id: string, createdAt: string, title?: string | null, body?: string | null, author: { __typename?: 'User', id: string, firstName: string, lastName: string }, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName: string, lastName: string, avatarUrl?: string | null } }> | null, commentThreadTargets?: Array<{ __typename?: 'CommentThreadTarget', id: string, commentableId: string, commentableType: CommentableType }> | null }> }; export type GetCommentThreadQueryVariables = Exact<{ commentThreadId: Scalars['String']; }>; -export type GetCommentThreadQuery = { __typename?: 'Query', findManyCommentThreads: Array<{ __typename?: 'CommentThread', id: string, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName: string, lastName: string, avatarUrl?: string | null } }> | null, commentThreadTargets?: Array<{ __typename?: 'CommentThreadTarget', commentableId: string, commentableType: CommentableType }> | null }> }; +export type GetCommentThreadQuery = { __typename?: 'Query', findManyCommentThreads: Array<{ __typename?: 'CommentThread', id: string, createdAt: string, author: { __typename?: 'User', id: string, firstName: string, lastName: string }, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName: string, lastName: string, avatarUrl?: string | null } }> | null, commentThreadTargets?: Array<{ __typename?: 'CommentThreadTarget', commentableId: string, commentableType: CommentableType }> | null }> }; export type AddCommentThreadTargetOnCommentThreadMutationVariables = Exact<{ commentThreadId: Scalars['String']; @@ -2113,11 +2395,12 @@ export type CreateCommentMutationOptions = Apollo.BaseMutationOptions commentableEntity.id, - ), - orderBy: [ - { - createdAt: SortOrder.Desc, - }, - ], - }, - }); - - const commentThreads: CommentThreadForDrawer[] = - queryResult?.findManyCommentThreads ?? []; - - return ( - - - - {commentThreads.map((commentThread) => ( - - ))} - - - ); -} diff --git a/front/src/modules/comments/components/RightDrawerTimeline.tsx b/front/src/modules/comments/components/RightDrawerTimeline.tsx new file mode 100644 index 00000000000..2b73ccb54fb --- /dev/null +++ b/front/src/modules/comments/components/RightDrawerTimeline.tsx @@ -0,0 +1,29 @@ +import { useRecoilState } from 'recoil'; + +import { RightDrawerBody } from '@/ui/layout/right-drawer/components/RightDrawerBody'; +import { RightDrawerPage } from '@/ui/layout/right-drawer/components/RightDrawerPage'; +import { RightDrawerTopBar } from '@/ui/layout/right-drawer/components/RightDrawerTopBar'; + +import { commentableEntityArrayState } from '../states/commentableEntityArrayState'; + +import { Timeline } from './Timeline'; + +export function RightDrawerTimeline() { + const [commentableEntityArray] = useRecoilState(commentableEntityArrayState); + + return ( + + + + {commentableEntityArray.map((commentableEntity) => ( + + ))} + + + ); +} diff --git a/front/src/modules/comments/components/Timeline.tsx b/front/src/modules/comments/components/Timeline.tsx index c0cd7c25884..ccb1bd429ad 100644 --- a/front/src/modules/comments/components/Timeline.tsx +++ b/front/src/modules/comments/components/Timeline.tsx @@ -1,8 +1,20 @@ +import { Tooltip } from 'react-tooltip'; import styled from '@emotion/styled'; -import { IconNotes } from '@/ui/icons/index'; +import { IconNotes, IconPlus } from '@/ui/icons/index'; +import { + beautifyExactDate, + beautifyPastDateRelativeToNow, +} from '@/utils/datetime/date-utils'; +import { + SortOrder, + useGetCommentThreadsByTargetsQuery, +} from '~/generated/graphql'; import { TableActionBarButtonCreateCommentThreadCompany } from '~/pages/companies/table/TableActionBarButtonCreateCommentThreadCompany'; +import { CommentableEntity } from '../types/CommentableEntity'; +import { CommentThreadForDrawer } from '../types/CommentThreadForDrawer'; + const StyledTimelineContainer = styled.div` align-items: center; align-self: stretch; @@ -10,9 +22,11 @@ const StyledTimelineContainer = styled.div` flex: 1 0 0; flex-direction: column; gap: 4px; - justify-content: flex-end; + justify-content: flex-start; + overflow-y: auto; padding: 12px 16px 64px 16px; `; + const StyledTimelineEmptyContainer = styled.div` align-items: center; align-self: stretch; @@ -59,7 +73,7 @@ const StyledItemTitleDate = styled.div` display: flex; gap: 8px; justify-content: flex-end; - width: 80px; + width: 110px; `; const StyledVerticalLineContainer = styled.div` @@ -116,8 +130,44 @@ const StyledCardContent = styled.div` text-overflow: ellipsis; `; -export function Timeline() { - const commentThreads = ['1']; +const StyledTooltip = styled(Tooltip)` + background-color: ${({ theme }) => theme.background.primary}; + + box-shadow: 0px 2px 4px 3px + ${({ theme }) => theme.background.transparent.light}; + + box-shadow: 2px 4px 16px 6px + ${({ theme }) => theme.background.transparent.light}; + + color: ${({ theme }) => theme.font.color.primary}; + + opacity: 1; + padding: 8px; +`; + +const StyledBottomActionBar = styled.div` + align-items: flex-start; + align-self: stretch; + bottom: 8px; + display: flex; + flex-direction: column; + position: absolute; +`; + +export function Timeline({ entity }: { entity: CommentableEntity }) { + const { data: queryResult } = useGetCommentThreadsByTargetsQuery({ + variables: { + commentThreadTargetIds: [entity.id], + orderBy: [ + { + createdAt: SortOrder.Desc, + }, + ], + }, + }); + + const commentThreads: CommentThreadForDrawer[] = + queryResult?.findManyCommentThreads ?? []; if (!commentThreads.length) { return ( @@ -130,35 +180,59 @@ export function Timeline() { return ( - - - - - - Eddy Cuesent a calendar invite to Steve and Alexandre - - 2 days ago - - - - - - - - - Logged call (Phil Schiller / Steve Anavi) - - - Apple sells its products by focusing on the benefits users gain - from their products, rather than solely highlighting the features. - The same approach should be used for selling to Qonto. Understand - their pain points and how your product can alleviate those issues. - Emphasize how your CRM tool can help streamline their operations, - improve customer service, and ultimately, grow their business. - - - - + {commentThreads.map((commentThread) => { + const beautifiedCreatedAt = beautifyPastDateRelativeToNow( + commentThread.createdAt, + ); + const exactCreatedAt = beautifyExactDate(commentThread.createdAt); + + return ( + <> + + + + + + + {commentThread.author.firstName}{' '} + {commentThread.author.lastName} + + created a note + + + {beautifiedCreatedAt} ago + + + + + + + + + null}> + {commentThread.title} + {commentThread.body} + + + + + ); + })} + + + + + + + + + + ); } diff --git a/front/src/modules/comments/hooks/useOpenCreateCommentDrawerForSelectedRowIds.ts b/front/src/modules/comments/hooks/useOpenCreateCommentDrawerForSelectedRowIds.ts index 63a327a984a..099738d34e8 100644 --- a/front/src/modules/comments/hooks/useOpenCreateCommentDrawerForSelectedRowIds.ts +++ b/front/src/modules/comments/hooks/useOpenCreateCommentDrawerForSelectedRowIds.ts @@ -19,12 +19,12 @@ export function useOpenCreateCommentThreadDrawerForSelectedRowIds() { createdCommentThreadIdState, ); - const selectedPeopleIds = useRecoilValue(selectedRowIdsState); + const selectedEntityIds = useRecoilValue(selectedRowIdsState); return function openCreateCommentDrawerForSelectedRowIds( entityType: CommentableType, ) { - const commentableEntityArray: CommentableEntity[] = selectedPeopleIds.map( + const commentableEntityArray: CommentableEntity[] = selectedEntityIds.map( (id) => ({ type: entityType, id, diff --git a/front/src/modules/comments/hooks/useOpenCommentRightDrawer.ts b/front/src/modules/comments/hooks/useOpenTimelineRightDrawer.ts similarity index 92% rename from front/src/modules/comments/hooks/useOpenCommentRightDrawer.ts rename to front/src/modules/comments/hooks/useOpenTimelineRightDrawer.ts index 6f237e681df..85a6407e489 100644 --- a/front/src/modules/comments/hooks/useOpenCommentRightDrawer.ts +++ b/front/src/modules/comments/hooks/useOpenTimelineRightDrawer.ts @@ -4,7 +4,7 @@ import { useOpenRightDrawer } from '../../ui/layout/right-drawer/hooks/useOpenRi import { commentableEntityArrayState } from '../states/commentableEntityArrayState'; import { CommentableEntity } from '../types/CommentableEntity'; -export function useOpenCommentRightDrawer() { +export function useOpenTimelineRightDrawer() { const openRightDrawer = useOpenRightDrawer(); const [, setCommentableEntityArray] = useRecoilState( commentableEntityArrayState, diff --git a/front/src/modules/comments/services/create.ts b/front/src/modules/comments/services/create.ts index 88b7b1029d7..0ea217b7fc1 100644 --- a/front/src/modules/comments/services/create.ts +++ b/front/src/modules/comments/services/create.ts @@ -45,7 +45,7 @@ export const CREATE_COMMENT_THREAD_WITH_COMMENT = gql` id: $commentThreadId createdAt: $createdAt updatedAt: $createdAt - authorId: $authorId + author: { connect: { id: $authorId } } body: $commentText commentThreadTargets: { createMany: { data: $commentThreadTargetArray, skipDuplicates: true } @@ -55,6 +55,7 @@ export const CREATE_COMMENT_THREAD_WITH_COMMENT = gql` id createdAt updatedAt + authorId commentThreadTargets { id createdAt diff --git a/front/src/modules/comments/services/select.ts b/front/src/modules/comments/services/select.ts index 5653d3ca124..6d3f873db7f 100644 --- a/front/src/modules/comments/services/select.ts +++ b/front/src/modules/comments/services/select.ts @@ -14,9 +14,14 @@ export const GET_COMMENT_THREADS_BY_TARGETS = gql` } ) { id + createdAt title body - authorId + author { + id + firstName + lastName + } comments { id body @@ -43,6 +48,12 @@ export const GET_COMMENT_THREAD = gql` query GetCommentThread($commentThreadId: String!) { findManyCommentThreads(where: { id: { equals: $commentThreadId } }) { id + createdAt + author { + id + firstName + lastName + } comments { id body diff --git a/front/src/modules/companies/components/CompanyEditableNameCell.tsx b/front/src/modules/companies/components/CompanyEditableNameCell.tsx index 51e10030aee..8eb47220409 100644 --- a/front/src/modules/companies/components/CompanyEditableNameCell.tsx +++ b/front/src/modules/companies/components/CompanyEditableNameCell.tsx @@ -1,5 +1,5 @@ import { CellCommentChip } from '@/comments/components/CellCommentChip'; -import { useOpenCommentRightDrawer } from '@/comments/hooks/useOpenCommentRightDrawer'; +import { useOpenTimelineRightDrawer } from '@/comments/hooks/useOpenTimelineRightDrawer'; import EditableChip from '@/ui/components/editable-cell/types/EditableChip'; import { getLogoUrlFromDomainName } from '@/utils/utils'; import { @@ -18,7 +18,7 @@ type OwnProps = { }; export function CompanyEditableNameChipCell({ company }: OwnProps) { - const openCommentRightDrawer = useOpenCommentRightDrawer(); + const openCommentRightDrawer = useOpenTimelineRightDrawer(); const [updateCompany] = useUpdateCompanyMutation(); function handleCommentClick(event: React.MouseEvent) { diff --git a/front/src/modules/people/components/EditablePeopleFullName.tsx b/front/src/modules/people/components/EditablePeopleFullName.tsx index c7b168b48f5..be7ca60daad 100644 --- a/front/src/modules/people/components/EditablePeopleFullName.tsx +++ b/front/src/modules/people/components/EditablePeopleFullName.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import styled from '@emotion/styled'; import { CellCommentChip } from '@/comments/components/CellCommentChip'; -import { useOpenCommentRightDrawer } from '@/comments/hooks/useOpenCommentRightDrawer'; +import { useOpenTimelineRightDrawer } from '@/comments/hooks/useOpenTimelineRightDrawer'; import { EditableDoubleText } from '@/ui/components/editable-cell/types/EditableDoubleText'; import { CommentableType, Person } from '~/generated/graphql'; @@ -27,7 +27,7 @@ const RightContainer = styled.div` export function EditablePeopleFullName({ person, onChange }: OwnProps) { const [firstNameValue, setFirstNameValue] = useState(person.firstName ?? ''); const [lastNameValue, setLastNameValue] = useState(person.lastName ?? ''); - const openCommentRightDrawer = useOpenCommentRightDrawer(); + const openCommentRightDrawer = useOpenTimelineRightDrawer(); function handleDoubleTextChange( firstValue: string, diff --git a/front/src/modules/ui/layout/right-drawer/components/RightDrawerRouter.tsx b/front/src/modules/ui/layout/right-drawer/components/RightDrawerRouter.tsx index b7dafb48b50..83c8c5f3133 100644 --- a/front/src/modules/ui/layout/right-drawer/components/RightDrawerRouter.tsx +++ b/front/src/modules/ui/layout/right-drawer/components/RightDrawerRouter.tsx @@ -1,7 +1,7 @@ import { useRecoilState } from 'recoil'; -import { RightDrawerComments } from '@/comments/components/RightDrawerComments'; import { RightDrawerCreateCommentThread } from '@/comments/components/RightDrawerCreateCommentThread'; +import { RightDrawerTimeline } from '@/comments/components/RightDrawerTimeline'; import { isDefined } from '@/utils/type-guards/isDefined'; import { rightDrawerPageState } from '../states/rightDrawerPageState'; @@ -14,7 +14,7 @@ export function RightDrawerRouter() { } return rightDrawerPage === 'comments' ? ( - + ) : rightDrawerPage === 'create-comment-thread' ? ( ) : ( diff --git a/front/src/pages/companies/CompanyShow.tsx b/front/src/pages/companies/CompanyShow.tsx index 46ed4a725a2..e8049f4e437 100644 --- a/front/src/pages/companies/CompanyShow.tsx +++ b/front/src/pages/companies/CompanyShow.tsx @@ -45,6 +45,7 @@ const StyledRightPanelContainer = styled.div` flex: 1 0 0; flex-direction: column; justify-content: center; + overflow: hidden; `; export function CompanyShow() { @@ -84,7 +85,9 @@ export function CompanyShow() { - + diff --git a/front/src/testing/mock-data/comment-threads.ts b/front/src/testing/mock-data/comment-threads.ts index 6d149136011..63a9f41c7ed 100644 --- a/front/src/testing/mock-data/comment-threads.ts +++ b/front/src/testing/mock-data/comment-threads.ts @@ -6,8 +6,14 @@ import { type MockedCommentThread = Pick< CommentThread, - 'id' | 'createdAt' | 'updatedAt' | '__typename' + 'id' | 'createdAt' | 'updatedAt' | '__typename' | 'body' | 'title' > & { + author: { + __typename?: 'User' | undefined; + id: string; + firstName: string; + lastName: string; + }; commentThreadTargets: Array< Pick< CommentThreadTarget, @@ -27,6 +33,11 @@ export const mockedCommentThreads: Array = [ id: '89bb825c-171e-4bcc-9cf7-43448d6fb230', createdAt: '2023-04-26T10:12:42.33625+00:00', updatedAt: '2023-04-26T10:23:42.33625+00:00', + author: { + id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e', + firstName: 'Charles', + lastName: 'Test', + }, commentThreadTargets: [ { id: '89bb825c-171e-4bcc-9cf7-43448d6fb300', @@ -63,6 +74,11 @@ export const mockedCommentThreads: Array = [ id: '89bb825c-171e-4bcc-9cf7-43448d6fb278', createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), + author: { + id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e', + firstName: 'Charles', + lastName: 'Test', + }, commentThreadTargets: [ { id: '89bb825c-171e-4bcc-9cf7-43448d6fb278', diff --git a/server/src/core/@generated/comment-thread/comment-thread-create-many-author-input-envelope.input.ts b/server/src/core/@generated/comment-thread/comment-thread-create-many-author-input-envelope.input.ts new file mode 100644 index 00000000000..3952bd9485f --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-create-many-author-input-envelope.input.ts @@ -0,0 +1,15 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { CommentThreadCreateManyAuthorInput } from './comment-thread-create-many-author.input'; +import { Type } from 'class-transformer'; + +@InputType() +export class CommentThreadCreateManyAuthorInputEnvelope { + + @Field(() => [CommentThreadCreateManyAuthorInput], {nullable:false}) + @Type(() => CommentThreadCreateManyAuthorInput) + data!: Array; + + @Field(() => Boolean, {nullable:true}) + skipDuplicates?: boolean; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-create-many-author.input.ts b/server/src/core/@generated/comment-thread/comment-thread-create-many-author.input.ts new file mode 100644 index 00000000000..e331f87c3f2 --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-create-many-author.input.ts @@ -0,0 +1,31 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import * as Validator from 'class-validator'; +import { HideField } from '@nestjs/graphql'; + +@InputType() +export class CommentThreadCreateManyAuthorInput { + + @Field(() => String, {nullable:true}) + @Validator.IsString() + @Validator.IsOptional() + id?: string; + + @HideField() + workspaceId!: string; + + @Field(() => String, {nullable:true}) + body?: string; + + @Field(() => String, {nullable:true}) + title?: string; + + @HideField() + deletedAt?: Date | string; + + @Field(() => Date, {nullable:true}) + createdAt?: Date | string; + + @Field(() => Date, {nullable:true}) + updatedAt?: Date | string; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-create-many-workspace.input.ts b/server/src/core/@generated/comment-thread/comment-thread-create-many-workspace.input.ts index 641cb4fe351..9da07684a67 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-create-many-workspace.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-create-many-workspace.input.ts @@ -11,8 +11,8 @@ export class CommentThreadCreateManyWorkspaceInput { @Validator.IsOptional() id?: string; - @Field(() => String, {nullable:true}) - authorId?: string; + @Field(() => String, {nullable:false}) + authorId!: string; @Field(() => String, {nullable:true}) body?: string; diff --git a/server/src/core/@generated/comment-thread/comment-thread-create-many.input.ts b/server/src/core/@generated/comment-thread/comment-thread-create-many.input.ts index 37ae8307609..04b2147cf16 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-create-many.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-create-many.input.ts @@ -14,8 +14,8 @@ export class CommentThreadCreateManyInput { @HideField() workspaceId!: string; - @Field(() => String, {nullable:true}) - authorId?: string; + @Field(() => String, {nullable:false}) + authorId!: string; @Field(() => String, {nullable:true}) body?: string; diff --git a/server/src/core/@generated/comment-thread/comment-thread-create-nested-many-without-author.input.ts b/server/src/core/@generated/comment-thread/comment-thread-create-nested-many-without-author.input.ts new file mode 100644 index 00000000000..d242a2030b8 --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-create-nested-many-without-author.input.ts @@ -0,0 +1,27 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { CommentThreadCreateWithoutAuthorInput } from './comment-thread-create-without-author.input'; +import { Type } from 'class-transformer'; +import { CommentThreadCreateOrConnectWithoutAuthorInput } from './comment-thread-create-or-connect-without-author.input'; +import { CommentThreadCreateManyAuthorInputEnvelope } from './comment-thread-create-many-author-input-envelope.input'; +import { CommentThreadWhereUniqueInput } from './comment-thread-where-unique.input'; + +@InputType() +export class CommentThreadCreateNestedManyWithoutAuthorInput { + + @Field(() => [CommentThreadCreateWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadCreateWithoutAuthorInput) + create?: Array; + + @Field(() => [CommentThreadCreateOrConnectWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadCreateOrConnectWithoutAuthorInput) + connectOrCreate?: Array; + + @Field(() => CommentThreadCreateManyAuthorInputEnvelope, {nullable:true}) + @Type(() => CommentThreadCreateManyAuthorInputEnvelope) + createMany?: CommentThreadCreateManyAuthorInputEnvelope; + + @Field(() => [CommentThreadWhereUniqueInput], {nullable:true}) + @Type(() => CommentThreadWhereUniqueInput) + connect?: Array; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-create-or-connect-without-author.input.ts b/server/src/core/@generated/comment-thread/comment-thread-create-or-connect-without-author.input.ts new file mode 100644 index 00000000000..71076b12957 --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-create-or-connect-without-author.input.ts @@ -0,0 +1,17 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { CommentThreadWhereUniqueInput } from './comment-thread-where-unique.input'; +import { Type } from 'class-transformer'; +import { CommentThreadCreateWithoutAuthorInput } from './comment-thread-create-without-author.input'; + +@InputType() +export class CommentThreadCreateOrConnectWithoutAuthorInput { + + @Field(() => CommentThreadWhereUniqueInput, {nullable:false}) + @Type(() => CommentThreadWhereUniqueInput) + where!: CommentThreadWhereUniqueInput; + + @Field(() => CommentThreadCreateWithoutAuthorInput, {nullable:false}) + @Type(() => CommentThreadCreateWithoutAuthorInput) + create!: CommentThreadCreateWithoutAuthorInput; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-create-without-author.input.ts b/server/src/core/@generated/comment-thread/comment-thread-create-without-author.input.ts new file mode 100644 index 00000000000..b62a7947898 --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-create-without-author.input.ts @@ -0,0 +1,40 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import * as Validator from 'class-validator'; +import { HideField } from '@nestjs/graphql'; +import { CommentThreadTargetCreateNestedManyWithoutCommentThreadInput } from '../comment-thread-target/comment-thread-target-create-nested-many-without-comment-thread.input'; +import { CommentCreateNestedManyWithoutCommentThreadInput } from '../comment/comment-create-nested-many-without-comment-thread.input'; +import { WorkspaceCreateNestedOneWithoutCommentThreadsInput } from '../workspace/workspace-create-nested-one-without-comment-threads.input'; + +@InputType() +export class CommentThreadCreateWithoutAuthorInput { + + @Field(() => String, {nullable:true}) + @Validator.IsString() + @Validator.IsOptional() + id?: string; + + @Field(() => String, {nullable:true}) + body?: string; + + @Field(() => String, {nullable:true}) + title?: string; + + @HideField() + deletedAt?: Date | string; + + @Field(() => Date, {nullable:true}) + createdAt?: Date | string; + + @Field(() => Date, {nullable:true}) + updatedAt?: Date | string; + + @Field(() => CommentThreadTargetCreateNestedManyWithoutCommentThreadInput, {nullable:true}) + commentThreadTargets?: CommentThreadTargetCreateNestedManyWithoutCommentThreadInput; + + @Field(() => CommentCreateNestedManyWithoutCommentThreadInput, {nullable:true}) + comments?: CommentCreateNestedManyWithoutCommentThreadInput; + + @HideField() + workspace!: WorkspaceCreateNestedOneWithoutCommentThreadsInput; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-create-without-comment-thread-targets.input.ts b/server/src/core/@generated/comment-thread/comment-thread-create-without-comment-thread-targets.input.ts index e0f0ba200f4..3b232d56247 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-create-without-comment-thread-targets.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-create-without-comment-thread-targets.input.ts @@ -4,6 +4,7 @@ import * as Validator from 'class-validator'; import { HideField } from '@nestjs/graphql'; import { CommentCreateNestedManyWithoutCommentThreadInput } from '../comment/comment-create-nested-many-without-comment-thread.input'; import { WorkspaceCreateNestedOneWithoutCommentThreadsInput } from '../workspace/workspace-create-nested-one-without-comment-threads.input'; +import { UserCreateNestedOneWithoutCommentThreadInput } from '../user/user-create-nested-one-without-comment-thread.input'; @InputType() export class CommentThreadCreateWithoutCommentThreadTargetsInput { @@ -13,9 +14,6 @@ export class CommentThreadCreateWithoutCommentThreadTargetsInput { @Validator.IsOptional() id?: string; - @Field(() => String, {nullable:true}) - authorId?: string; - @Field(() => String, {nullable:true}) body?: string; @@ -36,4 +34,7 @@ export class CommentThreadCreateWithoutCommentThreadTargetsInput { @HideField() workspace!: WorkspaceCreateNestedOneWithoutCommentThreadsInput; + + @Field(() => UserCreateNestedOneWithoutCommentThreadInput, {nullable:false}) + author!: UserCreateNestedOneWithoutCommentThreadInput; } diff --git a/server/src/core/@generated/comment-thread/comment-thread-create-without-comments.input.ts b/server/src/core/@generated/comment-thread/comment-thread-create-without-comments.input.ts index 376f768ae7f..c9f82907361 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-create-without-comments.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-create-without-comments.input.ts @@ -4,6 +4,7 @@ import * as Validator from 'class-validator'; import { HideField } from '@nestjs/graphql'; import { CommentThreadTargetCreateNestedManyWithoutCommentThreadInput } from '../comment-thread-target/comment-thread-target-create-nested-many-without-comment-thread.input'; import { WorkspaceCreateNestedOneWithoutCommentThreadsInput } from '../workspace/workspace-create-nested-one-without-comment-threads.input'; +import { UserCreateNestedOneWithoutCommentThreadInput } from '../user/user-create-nested-one-without-comment-thread.input'; @InputType() export class CommentThreadCreateWithoutCommentsInput { @@ -13,9 +14,6 @@ export class CommentThreadCreateWithoutCommentsInput { @Validator.IsOptional() id?: string; - @Field(() => String, {nullable:true}) - authorId?: string; - @Field(() => String, {nullable:true}) body?: string; @@ -36,4 +34,7 @@ export class CommentThreadCreateWithoutCommentsInput { @HideField() workspace!: WorkspaceCreateNestedOneWithoutCommentThreadsInput; + + @Field(() => UserCreateNestedOneWithoutCommentThreadInput, {nullable:false}) + author!: UserCreateNestedOneWithoutCommentThreadInput; } diff --git a/server/src/core/@generated/comment-thread/comment-thread-create-without-workspace.input.ts b/server/src/core/@generated/comment-thread/comment-thread-create-without-workspace.input.ts index fe3dd520a2e..c33366bebad 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-create-without-workspace.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-create-without-workspace.input.ts @@ -4,6 +4,7 @@ import * as Validator from 'class-validator'; import { HideField } from '@nestjs/graphql'; import { CommentThreadTargetCreateNestedManyWithoutCommentThreadInput } from '../comment-thread-target/comment-thread-target-create-nested-many-without-comment-thread.input'; import { CommentCreateNestedManyWithoutCommentThreadInput } from '../comment/comment-create-nested-many-without-comment-thread.input'; +import { UserCreateNestedOneWithoutCommentThreadInput } from '../user/user-create-nested-one-without-comment-thread.input'; @InputType() export class CommentThreadCreateWithoutWorkspaceInput { @@ -13,9 +14,6 @@ export class CommentThreadCreateWithoutWorkspaceInput { @Validator.IsOptional() id?: string; - @Field(() => String, {nullable:true}) - authorId?: string; - @Field(() => String, {nullable:true}) body?: string; @@ -36,4 +34,7 @@ export class CommentThreadCreateWithoutWorkspaceInput { @Field(() => CommentCreateNestedManyWithoutCommentThreadInput, {nullable:true}) comments?: CommentCreateNestedManyWithoutCommentThreadInput; + + @Field(() => UserCreateNestedOneWithoutCommentThreadInput, {nullable:false}) + author!: UserCreateNestedOneWithoutCommentThreadInput; } diff --git a/server/src/core/@generated/comment-thread/comment-thread-create.input.ts b/server/src/core/@generated/comment-thread/comment-thread-create.input.ts index 0414667a518..dbbfb03c678 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-create.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-create.input.ts @@ -5,6 +5,7 @@ import { HideField } from '@nestjs/graphql'; import { CommentThreadTargetCreateNestedManyWithoutCommentThreadInput } from '../comment-thread-target/comment-thread-target-create-nested-many-without-comment-thread.input'; import { CommentCreateNestedManyWithoutCommentThreadInput } from '../comment/comment-create-nested-many-without-comment-thread.input'; import { WorkspaceCreateNestedOneWithoutCommentThreadsInput } from '../workspace/workspace-create-nested-one-without-comment-threads.input'; +import { UserCreateNestedOneWithoutCommentThreadInput } from '../user/user-create-nested-one-without-comment-thread.input'; @InputType() export class CommentThreadCreateInput { @@ -14,9 +15,6 @@ export class CommentThreadCreateInput { @Validator.IsOptional() id?: string; - @Field(() => String, {nullable:true}) - authorId?: string; - @Field(() => String, {nullable:true}) body?: string; @@ -40,4 +38,7 @@ export class CommentThreadCreateInput { @HideField() workspace!: WorkspaceCreateNestedOneWithoutCommentThreadsInput; + + @Field(() => UserCreateNestedOneWithoutCommentThreadInput, {nullable:false}) + author!: UserCreateNestedOneWithoutCommentThreadInput; } diff --git a/server/src/core/@generated/comment-thread/comment-thread-group-by.output.ts b/server/src/core/@generated/comment-thread/comment-thread-group-by.output.ts index bb5604163a6..16b8ac21fab 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-group-by.output.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-group-by.output.ts @@ -17,8 +17,8 @@ export class CommentThreadGroupBy { @HideField() workspaceId!: string; - @Field(() => String, {nullable:true}) - authorId?: string; + @Field(() => String, {nullable:false}) + authorId!: string; @Field(() => String, {nullable:true}) body?: string; diff --git a/server/src/core/@generated/comment-thread/comment-thread-order-by-with-relation.input.ts b/server/src/core/@generated/comment-thread/comment-thread-order-by-with-relation.input.ts index 40a2059e65d..965fd2e5a57 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-order-by-with-relation.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-order-by-with-relation.input.ts @@ -5,6 +5,7 @@ import { HideField } from '@nestjs/graphql'; import { CommentThreadTargetOrderByRelationAggregateInput } from '../comment-thread-target/comment-thread-target-order-by-relation-aggregate.input'; import { CommentOrderByRelationAggregateInput } from '../comment/comment-order-by-relation-aggregate.input'; import { WorkspaceOrderByWithRelationInput } from '../workspace/workspace-order-by-with-relation.input'; +import { UserOrderByWithRelationInput } from '../user/user-order-by-with-relation.input'; @InputType() export class CommentThreadOrderByWithRelationInput { @@ -41,4 +42,7 @@ export class CommentThreadOrderByWithRelationInput { @HideField() workspace?: WorkspaceOrderByWithRelationInput; + + @Field(() => UserOrderByWithRelationInput, {nullable:true}) + author?: UserOrderByWithRelationInput; } diff --git a/server/src/core/@generated/comment-thread/comment-thread-scalar-where-with-aggregates.input.ts b/server/src/core/@generated/comment-thread/comment-thread-scalar-where-with-aggregates.input.ts index 60956bee4d9..aba648d585c 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-scalar-where-with-aggregates.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-scalar-where-with-aggregates.input.ts @@ -24,8 +24,8 @@ export class CommentThreadScalarWhereWithAggregatesInput { @HideField() workspaceId?: StringWithAggregatesFilter; - @Field(() => StringNullableWithAggregatesFilter, {nullable:true}) - authorId?: StringNullableWithAggregatesFilter; + @Field(() => StringWithAggregatesFilter, {nullable:true}) + authorId?: StringWithAggregatesFilter; @Field(() => StringNullableWithAggregatesFilter, {nullable:true}) body?: StringNullableWithAggregatesFilter; diff --git a/server/src/core/@generated/comment-thread/comment-thread-scalar-where.input.ts b/server/src/core/@generated/comment-thread/comment-thread-scalar-where.input.ts index f88120aabf1..348b444a3e7 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-scalar-where.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-scalar-where.input.ts @@ -24,8 +24,8 @@ export class CommentThreadScalarWhereInput { @HideField() workspaceId?: StringFilter; - @Field(() => StringNullableFilter, {nullable:true}) - authorId?: StringNullableFilter; + @Field(() => StringFilter, {nullable:true}) + authorId?: StringFilter; @Field(() => StringNullableFilter, {nullable:true}) body?: StringNullableFilter; diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-nested-many-without-author.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-nested-many-without-author.input.ts new file mode 100644 index 00000000000..e3be46bd2be --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-nested-many-without-author.input.ts @@ -0,0 +1,27 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { CommentThreadCreateWithoutAuthorInput } from './comment-thread-create-without-author.input'; +import { Type } from 'class-transformer'; +import { CommentThreadCreateOrConnectWithoutAuthorInput } from './comment-thread-create-or-connect-without-author.input'; +import { CommentThreadCreateManyAuthorInputEnvelope } from './comment-thread-create-many-author-input-envelope.input'; +import { CommentThreadWhereUniqueInput } from './comment-thread-where-unique.input'; + +@InputType() +export class CommentThreadUncheckedCreateNestedManyWithoutAuthorInput { + + @Field(() => [CommentThreadCreateWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadCreateWithoutAuthorInput) + create?: Array; + + @Field(() => [CommentThreadCreateOrConnectWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadCreateOrConnectWithoutAuthorInput) + connectOrCreate?: Array; + + @Field(() => CommentThreadCreateManyAuthorInputEnvelope, {nullable:true}) + @Type(() => CommentThreadCreateManyAuthorInputEnvelope) + createMany?: CommentThreadCreateManyAuthorInputEnvelope; + + @Field(() => [CommentThreadWhereUniqueInput], {nullable:true}) + @Type(() => CommentThreadWhereUniqueInput) + connect?: Array; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-author.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-author.input.ts new file mode 100644 index 00000000000..04e17ff0f0a --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-author.input.ts @@ -0,0 +1,39 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import * as Validator from 'class-validator'; +import { HideField } from '@nestjs/graphql'; +import { CommentThreadTargetUncheckedCreateNestedManyWithoutCommentThreadInput } from '../comment-thread-target/comment-thread-target-unchecked-create-nested-many-without-comment-thread.input'; +import { CommentUncheckedCreateNestedManyWithoutCommentThreadInput } from '../comment/comment-unchecked-create-nested-many-without-comment-thread.input'; + +@InputType() +export class CommentThreadUncheckedCreateWithoutAuthorInput { + + @Field(() => String, {nullable:true}) + @Validator.IsString() + @Validator.IsOptional() + id?: string; + + @HideField() + workspaceId!: string; + + @Field(() => String, {nullable:true}) + body?: string; + + @Field(() => String, {nullable:true}) + title?: string; + + @HideField() + deletedAt?: Date | string; + + @Field(() => Date, {nullable:true}) + createdAt?: Date | string; + + @Field(() => Date, {nullable:true}) + updatedAt?: Date | string; + + @Field(() => CommentThreadTargetUncheckedCreateNestedManyWithoutCommentThreadInput, {nullable:true}) + commentThreadTargets?: CommentThreadTargetUncheckedCreateNestedManyWithoutCommentThreadInput; + + @Field(() => CommentUncheckedCreateNestedManyWithoutCommentThreadInput, {nullable:true}) + comments?: CommentUncheckedCreateNestedManyWithoutCommentThreadInput; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-comment-thread-targets.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-comment-thread-targets.input.ts index d435ab711b8..ff17713a73f 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-comment-thread-targets.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-comment-thread-targets.input.ts @@ -15,8 +15,8 @@ export class CommentThreadUncheckedCreateWithoutCommentThreadTargetsInput { @HideField() workspaceId!: string; - @Field(() => String, {nullable:true}) - authorId?: string; + @Field(() => String, {nullable:false}) + authorId!: string; @Field(() => String, {nullable:true}) body?: string; diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-comments.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-comments.input.ts index a19053771a2..786866edca8 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-comments.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-comments.input.ts @@ -15,8 +15,8 @@ export class CommentThreadUncheckedCreateWithoutCommentsInput { @HideField() workspaceId!: string; - @Field(() => String, {nullable:true}) - authorId?: string; + @Field(() => String, {nullable:false}) + authorId!: string; @Field(() => String, {nullable:true}) body?: string; diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-workspace.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-workspace.input.ts index 36657e8a2a8..99dd0248d1d 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-workspace.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-create-without-workspace.input.ts @@ -13,8 +13,8 @@ export class CommentThreadUncheckedCreateWithoutWorkspaceInput { @Validator.IsOptional() id?: string; - @Field(() => String, {nullable:true}) - authorId?: string; + @Field(() => String, {nullable:false}) + authorId!: string; @Field(() => String, {nullable:true}) body?: string; diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-create.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-create.input.ts index 2733625b34a..493cde6a076 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-unchecked-create.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-create.input.ts @@ -16,8 +16,8 @@ export class CommentThreadUncheckedCreateInput { @HideField() workspaceId!: string; - @Field(() => String, {nullable:true}) - authorId?: string; + @Field(() => String, {nullable:false}) + authorId!: string; @Field(() => String, {nullable:true}) body?: string; diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many-without-author-nested.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many-without-author-nested.input.ts new file mode 100644 index 00000000000..9e19b91675c --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many-without-author-nested.input.ts @@ -0,0 +1,59 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { CommentThreadCreateWithoutAuthorInput } from './comment-thread-create-without-author.input'; +import { Type } from 'class-transformer'; +import { CommentThreadCreateOrConnectWithoutAuthorInput } from './comment-thread-create-or-connect-without-author.input'; +import { CommentThreadUpsertWithWhereUniqueWithoutAuthorInput } from './comment-thread-upsert-with-where-unique-without-author.input'; +import { CommentThreadCreateManyAuthorInputEnvelope } from './comment-thread-create-many-author-input-envelope.input'; +import { CommentThreadWhereUniqueInput } from './comment-thread-where-unique.input'; +import { CommentThreadUpdateWithWhereUniqueWithoutAuthorInput } from './comment-thread-update-with-where-unique-without-author.input'; +import { CommentThreadUpdateManyWithWhereWithoutAuthorInput } from './comment-thread-update-many-with-where-without-author.input'; +import { CommentThreadScalarWhereInput } from './comment-thread-scalar-where.input'; + +@InputType() +export class CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput { + + @Field(() => [CommentThreadCreateWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadCreateWithoutAuthorInput) + create?: Array; + + @Field(() => [CommentThreadCreateOrConnectWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadCreateOrConnectWithoutAuthorInput) + connectOrCreate?: Array; + + @Field(() => [CommentThreadUpsertWithWhereUniqueWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadUpsertWithWhereUniqueWithoutAuthorInput) + upsert?: Array; + + @Field(() => CommentThreadCreateManyAuthorInputEnvelope, {nullable:true}) + @Type(() => CommentThreadCreateManyAuthorInputEnvelope) + createMany?: CommentThreadCreateManyAuthorInputEnvelope; + + @Field(() => [CommentThreadWhereUniqueInput], {nullable:true}) + @Type(() => CommentThreadWhereUniqueInput) + set?: Array; + + @Field(() => [CommentThreadWhereUniqueInput], {nullable:true}) + @Type(() => CommentThreadWhereUniqueInput) + disconnect?: Array; + + @Field(() => [CommentThreadWhereUniqueInput], {nullable:true}) + @Type(() => CommentThreadWhereUniqueInput) + delete?: Array; + + @Field(() => [CommentThreadWhereUniqueInput], {nullable:true}) + @Type(() => CommentThreadWhereUniqueInput) + connect?: Array; + + @Field(() => [CommentThreadUpdateWithWhereUniqueWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadUpdateWithWhereUniqueWithoutAuthorInput) + update?: Array; + + @Field(() => [CommentThreadUpdateManyWithWhereWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadUpdateManyWithWhereWithoutAuthorInput) + updateMany?: Array; + + @Field(() => [CommentThreadScalarWhereInput], {nullable:true}) + @Type(() => CommentThreadScalarWhereInput) + deleteMany?: Array; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many-without-comment-thread.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many-without-comment-thread.input.ts new file mode 100644 index 00000000000..046bc72be02 --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many-without-comment-thread.input.ts @@ -0,0 +1,32 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; +import { HideField } from '@nestjs/graphql'; +import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input'; +import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; +import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-update-operations.input'; + +@InputType() +export class CommentThreadUncheckedUpdateManyWithoutCommentThreadInput { + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + id?: StringFieldUpdateOperationsInput; + + @HideField() + workspaceId?: StringFieldUpdateOperationsInput; + + @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) + body?: NullableStringFieldUpdateOperationsInput; + + @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) + title?: NullableStringFieldUpdateOperationsInput; + + @HideField() + deletedAt?: NullableDateTimeFieldUpdateOperationsInput; + + @Field(() => DateTimeFieldUpdateOperationsInput, {nullable:true}) + createdAt?: DateTimeFieldUpdateOperationsInput; + + @Field(() => DateTimeFieldUpdateOperationsInput, {nullable:true}) + updatedAt?: DateTimeFieldUpdateOperationsInput; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many-without-comment-threads.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many-without-comment-threads.input.ts index 01d1fc79d35..1888e3f19c9 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many-without-comment-threads.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many-without-comment-threads.input.ts @@ -12,8 +12,8 @@ export class CommentThreadUncheckedUpdateManyWithoutCommentThreadsInput { @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) id?: StringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) - authorId?: NullableStringFieldUpdateOperationsInput; + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + authorId?: StringFieldUpdateOperationsInput; @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) body?: NullableStringFieldUpdateOperationsInput; diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many.input.ts index 5d750564bbb..e1f3ea66e57 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-many.input.ts @@ -15,8 +15,8 @@ export class CommentThreadUncheckedUpdateManyInput { @HideField() workspaceId?: StringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) - authorId?: NullableStringFieldUpdateOperationsInput; + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + authorId?: StringFieldUpdateOperationsInput; @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) body?: NullableStringFieldUpdateOperationsInput; diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-author.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-author.input.ts new file mode 100644 index 00000000000..b3fe842f403 --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-author.input.ts @@ -0,0 +1,40 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; +import { HideField } from '@nestjs/graphql'; +import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input'; +import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; +import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-update-operations.input'; +import { CommentThreadTargetUncheckedUpdateManyWithoutCommentThreadNestedInput } from '../comment-thread-target/comment-thread-target-unchecked-update-many-without-comment-thread-nested.input'; +import { CommentUncheckedUpdateManyWithoutCommentThreadNestedInput } from '../comment/comment-unchecked-update-many-without-comment-thread-nested.input'; + +@InputType() +export class CommentThreadUncheckedUpdateWithoutAuthorInput { + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + id?: StringFieldUpdateOperationsInput; + + @HideField() + workspaceId?: StringFieldUpdateOperationsInput; + + @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) + body?: NullableStringFieldUpdateOperationsInput; + + @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) + title?: NullableStringFieldUpdateOperationsInput; + + @HideField() + deletedAt?: NullableDateTimeFieldUpdateOperationsInput; + + @Field(() => DateTimeFieldUpdateOperationsInput, {nullable:true}) + createdAt?: DateTimeFieldUpdateOperationsInput; + + @Field(() => DateTimeFieldUpdateOperationsInput, {nullable:true}) + updatedAt?: DateTimeFieldUpdateOperationsInput; + + @Field(() => CommentThreadTargetUncheckedUpdateManyWithoutCommentThreadNestedInput, {nullable:true}) + commentThreadTargets?: CommentThreadTargetUncheckedUpdateManyWithoutCommentThreadNestedInput; + + @Field(() => CommentUncheckedUpdateManyWithoutCommentThreadNestedInput, {nullable:true}) + comments?: CommentUncheckedUpdateManyWithoutCommentThreadNestedInput; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-comment-thread-targets.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-comment-thread-targets.input.ts index b8daad2db36..3ab751cb38d 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-comment-thread-targets.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-comment-thread-targets.input.ts @@ -16,8 +16,8 @@ export class CommentThreadUncheckedUpdateWithoutCommentThreadTargetsInput { @HideField() workspaceId?: StringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) - authorId?: NullableStringFieldUpdateOperationsInput; + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + authorId?: StringFieldUpdateOperationsInput; @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) body?: NullableStringFieldUpdateOperationsInput; diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-comments.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-comments.input.ts index 70570fbe0d6..b256f8fd198 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-comments.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-comments.input.ts @@ -16,8 +16,8 @@ export class CommentThreadUncheckedUpdateWithoutCommentsInput { @HideField() workspaceId?: StringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) - authorId?: NullableStringFieldUpdateOperationsInput; + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + authorId?: StringFieldUpdateOperationsInput; @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) body?: NullableStringFieldUpdateOperationsInput; diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-workspace.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-workspace.input.ts index b9537cdf0e4..88832fa6ae9 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-workspace.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update-without-workspace.input.ts @@ -14,8 +14,8 @@ export class CommentThreadUncheckedUpdateWithoutWorkspaceInput { @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) id?: StringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) - authorId?: NullableStringFieldUpdateOperationsInput; + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + authorId?: StringFieldUpdateOperationsInput; @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) body?: NullableStringFieldUpdateOperationsInput; diff --git a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update.input.ts b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update.input.ts index 04f22edaecf..cc6268a5f60 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-unchecked-update.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-unchecked-update.input.ts @@ -17,8 +17,8 @@ export class CommentThreadUncheckedUpdateInput { @HideField() workspaceId?: StringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) - authorId?: NullableStringFieldUpdateOperationsInput; + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + authorId?: StringFieldUpdateOperationsInput; @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) body?: NullableStringFieldUpdateOperationsInput; diff --git a/server/src/core/@generated/comment-thread/comment-thread-update-many-mutation.input.ts b/server/src/core/@generated/comment-thread/comment-thread-update-many-mutation.input.ts index 4fb732222d7..e5b15731c2b 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-update-many-mutation.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-update-many-mutation.input.ts @@ -12,9 +12,6 @@ export class CommentThreadUpdateManyMutationInput { @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) id?: StringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) - authorId?: NullableStringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) body?: NullableStringFieldUpdateOperationsInput; diff --git a/server/src/core/@generated/comment-thread/comment-thread-update-many-with-where-without-author.input.ts b/server/src/core/@generated/comment-thread/comment-thread-update-many-with-where-without-author.input.ts new file mode 100644 index 00000000000..44fd12a1d96 --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-update-many-with-where-without-author.input.ts @@ -0,0 +1,17 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { CommentThreadScalarWhereInput } from './comment-thread-scalar-where.input'; +import { Type } from 'class-transformer'; +import { CommentThreadUpdateManyMutationInput } from './comment-thread-update-many-mutation.input'; + +@InputType() +export class CommentThreadUpdateManyWithWhereWithoutAuthorInput { + + @Field(() => CommentThreadScalarWhereInput, {nullable:false}) + @Type(() => CommentThreadScalarWhereInput) + where!: CommentThreadScalarWhereInput; + + @Field(() => CommentThreadUpdateManyMutationInput, {nullable:false}) + @Type(() => CommentThreadUpdateManyMutationInput) + data!: CommentThreadUpdateManyMutationInput; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-update-many-without-author-nested.input.ts b/server/src/core/@generated/comment-thread/comment-thread-update-many-without-author-nested.input.ts new file mode 100644 index 00000000000..1281f5177a3 --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-update-many-without-author-nested.input.ts @@ -0,0 +1,59 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { CommentThreadCreateWithoutAuthorInput } from './comment-thread-create-without-author.input'; +import { Type } from 'class-transformer'; +import { CommentThreadCreateOrConnectWithoutAuthorInput } from './comment-thread-create-or-connect-without-author.input'; +import { CommentThreadUpsertWithWhereUniqueWithoutAuthorInput } from './comment-thread-upsert-with-where-unique-without-author.input'; +import { CommentThreadCreateManyAuthorInputEnvelope } from './comment-thread-create-many-author-input-envelope.input'; +import { CommentThreadWhereUniqueInput } from './comment-thread-where-unique.input'; +import { CommentThreadUpdateWithWhereUniqueWithoutAuthorInput } from './comment-thread-update-with-where-unique-without-author.input'; +import { CommentThreadUpdateManyWithWhereWithoutAuthorInput } from './comment-thread-update-many-with-where-without-author.input'; +import { CommentThreadScalarWhereInput } from './comment-thread-scalar-where.input'; + +@InputType() +export class CommentThreadUpdateManyWithoutAuthorNestedInput { + + @Field(() => [CommentThreadCreateWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadCreateWithoutAuthorInput) + create?: Array; + + @Field(() => [CommentThreadCreateOrConnectWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadCreateOrConnectWithoutAuthorInput) + connectOrCreate?: Array; + + @Field(() => [CommentThreadUpsertWithWhereUniqueWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadUpsertWithWhereUniqueWithoutAuthorInput) + upsert?: Array; + + @Field(() => CommentThreadCreateManyAuthorInputEnvelope, {nullable:true}) + @Type(() => CommentThreadCreateManyAuthorInputEnvelope) + createMany?: CommentThreadCreateManyAuthorInputEnvelope; + + @Field(() => [CommentThreadWhereUniqueInput], {nullable:true}) + @Type(() => CommentThreadWhereUniqueInput) + set?: Array; + + @Field(() => [CommentThreadWhereUniqueInput], {nullable:true}) + @Type(() => CommentThreadWhereUniqueInput) + disconnect?: Array; + + @Field(() => [CommentThreadWhereUniqueInput], {nullable:true}) + @Type(() => CommentThreadWhereUniqueInput) + delete?: Array; + + @Field(() => [CommentThreadWhereUniqueInput], {nullable:true}) + @Type(() => CommentThreadWhereUniqueInput) + connect?: Array; + + @Field(() => [CommentThreadUpdateWithWhereUniqueWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadUpdateWithWhereUniqueWithoutAuthorInput) + update?: Array; + + @Field(() => [CommentThreadUpdateManyWithWhereWithoutAuthorInput], {nullable:true}) + @Type(() => CommentThreadUpdateManyWithWhereWithoutAuthorInput) + updateMany?: Array; + + @Field(() => [CommentThreadScalarWhereInput], {nullable:true}) + @Type(() => CommentThreadScalarWhereInput) + deleteMany?: Array; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-update-with-where-unique-without-author.input.ts b/server/src/core/@generated/comment-thread/comment-thread-update-with-where-unique-without-author.input.ts new file mode 100644 index 00000000000..6adcc0a15ab --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-update-with-where-unique-without-author.input.ts @@ -0,0 +1,17 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { CommentThreadWhereUniqueInput } from './comment-thread-where-unique.input'; +import { Type } from 'class-transformer'; +import { CommentThreadUpdateWithoutAuthorInput } from './comment-thread-update-without-author.input'; + +@InputType() +export class CommentThreadUpdateWithWhereUniqueWithoutAuthorInput { + + @Field(() => CommentThreadWhereUniqueInput, {nullable:false}) + @Type(() => CommentThreadWhereUniqueInput) + where!: CommentThreadWhereUniqueInput; + + @Field(() => CommentThreadUpdateWithoutAuthorInput, {nullable:false}) + @Type(() => CommentThreadUpdateWithoutAuthorInput) + data!: CommentThreadUpdateWithoutAuthorInput; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-update-without-author.input.ts b/server/src/core/@generated/comment-thread/comment-thread-update-without-author.input.ts new file mode 100644 index 00000000000..01b3d157be4 --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-update-without-author.input.ts @@ -0,0 +1,41 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; +import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input'; +import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; +import { HideField } from '@nestjs/graphql'; +import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-update-operations.input'; +import { CommentThreadTargetUpdateManyWithoutCommentThreadNestedInput } from '../comment-thread-target/comment-thread-target-update-many-without-comment-thread-nested.input'; +import { CommentUpdateManyWithoutCommentThreadNestedInput } from '../comment/comment-update-many-without-comment-thread-nested.input'; +import { WorkspaceUpdateOneRequiredWithoutCommentThreadsNestedInput } from '../workspace/workspace-update-one-required-without-comment-threads-nested.input'; + +@InputType() +export class CommentThreadUpdateWithoutAuthorInput { + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + id?: StringFieldUpdateOperationsInput; + + @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) + body?: NullableStringFieldUpdateOperationsInput; + + @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) + title?: NullableStringFieldUpdateOperationsInput; + + @HideField() + deletedAt?: NullableDateTimeFieldUpdateOperationsInput; + + @Field(() => DateTimeFieldUpdateOperationsInput, {nullable:true}) + createdAt?: DateTimeFieldUpdateOperationsInput; + + @Field(() => DateTimeFieldUpdateOperationsInput, {nullable:true}) + updatedAt?: DateTimeFieldUpdateOperationsInput; + + @Field(() => CommentThreadTargetUpdateManyWithoutCommentThreadNestedInput, {nullable:true}) + commentThreadTargets?: CommentThreadTargetUpdateManyWithoutCommentThreadNestedInput; + + @Field(() => CommentUpdateManyWithoutCommentThreadNestedInput, {nullable:true}) + comments?: CommentUpdateManyWithoutCommentThreadNestedInput; + + @HideField() + workspace?: WorkspaceUpdateOneRequiredWithoutCommentThreadsNestedInput; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-update-without-comment-thread-targets.input.ts b/server/src/core/@generated/comment-thread/comment-thread-update-without-comment-thread-targets.input.ts index b60350deba3..73c85e07508 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-update-without-comment-thread-targets.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-update-without-comment-thread-targets.input.ts @@ -7,6 +7,7 @@ import { HideField } from '@nestjs/graphql'; import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-update-operations.input'; import { CommentUpdateManyWithoutCommentThreadNestedInput } from '../comment/comment-update-many-without-comment-thread-nested.input'; import { WorkspaceUpdateOneRequiredWithoutCommentThreadsNestedInput } from '../workspace/workspace-update-one-required-without-comment-threads-nested.input'; +import { UserUpdateOneRequiredWithoutCommentThreadNestedInput } from '../user/user-update-one-required-without-comment-thread-nested.input'; @InputType() export class CommentThreadUpdateWithoutCommentThreadTargetsInput { @@ -14,9 +15,6 @@ export class CommentThreadUpdateWithoutCommentThreadTargetsInput { @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) id?: StringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) - authorId?: NullableStringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) body?: NullableStringFieldUpdateOperationsInput; @@ -37,4 +35,7 @@ export class CommentThreadUpdateWithoutCommentThreadTargetsInput { @HideField() workspace?: WorkspaceUpdateOneRequiredWithoutCommentThreadsNestedInput; + + @Field(() => UserUpdateOneRequiredWithoutCommentThreadNestedInput, {nullable:true}) + author?: UserUpdateOneRequiredWithoutCommentThreadNestedInput; } diff --git a/server/src/core/@generated/comment-thread/comment-thread-update-without-comments.input.ts b/server/src/core/@generated/comment-thread/comment-thread-update-without-comments.input.ts index 6d5e3099b21..13be38fe98c 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-update-without-comments.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-update-without-comments.input.ts @@ -7,6 +7,7 @@ import { HideField } from '@nestjs/graphql'; import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-update-operations.input'; import { CommentThreadTargetUpdateManyWithoutCommentThreadNestedInput } from '../comment-thread-target/comment-thread-target-update-many-without-comment-thread-nested.input'; import { WorkspaceUpdateOneRequiredWithoutCommentThreadsNestedInput } from '../workspace/workspace-update-one-required-without-comment-threads-nested.input'; +import { UserUpdateOneRequiredWithoutCommentThreadNestedInput } from '../user/user-update-one-required-without-comment-thread-nested.input'; @InputType() export class CommentThreadUpdateWithoutCommentsInput { @@ -14,9 +15,6 @@ export class CommentThreadUpdateWithoutCommentsInput { @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) id?: StringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) - authorId?: NullableStringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) body?: NullableStringFieldUpdateOperationsInput; @@ -37,4 +35,7 @@ export class CommentThreadUpdateWithoutCommentsInput { @HideField() workspace?: WorkspaceUpdateOneRequiredWithoutCommentThreadsNestedInput; + + @Field(() => UserUpdateOneRequiredWithoutCommentThreadNestedInput, {nullable:true}) + author?: UserUpdateOneRequiredWithoutCommentThreadNestedInput; } diff --git a/server/src/core/@generated/comment-thread/comment-thread-update-without-workspace.input.ts b/server/src/core/@generated/comment-thread/comment-thread-update-without-workspace.input.ts index f361462d20a..251a0982923 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-update-without-workspace.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-update-without-workspace.input.ts @@ -7,6 +7,7 @@ import { HideField } from '@nestjs/graphql'; import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-update-operations.input'; import { CommentThreadTargetUpdateManyWithoutCommentThreadNestedInput } from '../comment-thread-target/comment-thread-target-update-many-without-comment-thread-nested.input'; import { CommentUpdateManyWithoutCommentThreadNestedInput } from '../comment/comment-update-many-without-comment-thread-nested.input'; +import { UserUpdateOneRequiredWithoutCommentThreadNestedInput } from '../user/user-update-one-required-without-comment-thread-nested.input'; @InputType() export class CommentThreadUpdateWithoutWorkspaceInput { @@ -14,9 +15,6 @@ export class CommentThreadUpdateWithoutWorkspaceInput { @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) id?: StringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) - authorId?: NullableStringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) body?: NullableStringFieldUpdateOperationsInput; @@ -37,4 +35,7 @@ export class CommentThreadUpdateWithoutWorkspaceInput { @Field(() => CommentUpdateManyWithoutCommentThreadNestedInput, {nullable:true}) comments?: CommentUpdateManyWithoutCommentThreadNestedInput; + + @Field(() => UserUpdateOneRequiredWithoutCommentThreadNestedInput, {nullable:true}) + author?: UserUpdateOneRequiredWithoutCommentThreadNestedInput; } diff --git a/server/src/core/@generated/comment-thread/comment-thread-update.input.ts b/server/src/core/@generated/comment-thread/comment-thread-update.input.ts index 4dea417273a..d5f63a2e2a2 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-update.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-update.input.ts @@ -8,6 +8,7 @@ import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-up import { CommentThreadTargetUpdateManyWithoutCommentThreadNestedInput } from '../comment-thread-target/comment-thread-target-update-many-without-comment-thread-nested.input'; import { CommentUpdateManyWithoutCommentThreadNestedInput } from '../comment/comment-update-many-without-comment-thread-nested.input'; import { WorkspaceUpdateOneRequiredWithoutCommentThreadsNestedInput } from '../workspace/workspace-update-one-required-without-comment-threads-nested.input'; +import { UserUpdateOneRequiredWithoutCommentThreadNestedInput } from '../user/user-update-one-required-without-comment-thread-nested.input'; @InputType() export class CommentThreadUpdateInput { @@ -15,9 +16,6 @@ export class CommentThreadUpdateInput { @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) id?: StringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) - authorId?: NullableStringFieldUpdateOperationsInput; - @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) body?: NullableStringFieldUpdateOperationsInput; @@ -41,4 +39,7 @@ export class CommentThreadUpdateInput { @HideField() workspace?: WorkspaceUpdateOneRequiredWithoutCommentThreadsNestedInput; + + @Field(() => UserUpdateOneRequiredWithoutCommentThreadNestedInput, {nullable:true}) + author?: UserUpdateOneRequiredWithoutCommentThreadNestedInput; } diff --git a/server/src/core/@generated/comment-thread/comment-thread-upsert-with-where-unique-without-author.input.ts b/server/src/core/@generated/comment-thread/comment-thread-upsert-with-where-unique-without-author.input.ts new file mode 100644 index 00000000000..d85d75c21f2 --- /dev/null +++ b/server/src/core/@generated/comment-thread/comment-thread-upsert-with-where-unique-without-author.input.ts @@ -0,0 +1,22 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { CommentThreadWhereUniqueInput } from './comment-thread-where-unique.input'; +import { Type } from 'class-transformer'; +import { CommentThreadUpdateWithoutAuthorInput } from './comment-thread-update-without-author.input'; +import { CommentThreadCreateWithoutAuthorInput } from './comment-thread-create-without-author.input'; + +@InputType() +export class CommentThreadUpsertWithWhereUniqueWithoutAuthorInput { + + @Field(() => CommentThreadWhereUniqueInput, {nullable:false}) + @Type(() => CommentThreadWhereUniqueInput) + where!: CommentThreadWhereUniqueInput; + + @Field(() => CommentThreadUpdateWithoutAuthorInput, {nullable:false}) + @Type(() => CommentThreadUpdateWithoutAuthorInput) + update!: CommentThreadUpdateWithoutAuthorInput; + + @Field(() => CommentThreadCreateWithoutAuthorInput, {nullable:false}) + @Type(() => CommentThreadCreateWithoutAuthorInput) + create!: CommentThreadCreateWithoutAuthorInput; +} diff --git a/server/src/core/@generated/comment-thread/comment-thread-where.input.ts b/server/src/core/@generated/comment-thread/comment-thread-where.input.ts index f1dc57b2747..a6ebf673d68 100644 --- a/server/src/core/@generated/comment-thread/comment-thread-where.input.ts +++ b/server/src/core/@generated/comment-thread/comment-thread-where.input.ts @@ -8,6 +8,7 @@ import { DateTimeFilter } from '../prisma/date-time-filter.input'; import { CommentThreadTargetListRelationFilter } from '../comment-thread-target/comment-thread-target-list-relation-filter.input'; import { CommentListRelationFilter } from '../comment/comment-list-relation-filter.input'; import { WorkspaceRelationFilter } from '../workspace/workspace-relation-filter.input'; +import { UserRelationFilter } from '../user/user-relation-filter.input'; @InputType() export class CommentThreadWhereInput { @@ -27,8 +28,8 @@ export class CommentThreadWhereInput { @HideField() workspaceId?: StringFilter; - @Field(() => StringNullableFilter, {nullable:true}) - authorId?: StringNullableFilter; + @Field(() => StringFilter, {nullable:true}) + authorId?: StringFilter; @Field(() => StringNullableFilter, {nullable:true}) body?: StringNullableFilter; @@ -53,4 +54,7 @@ export class CommentThreadWhereInput { @HideField() workspace?: WorkspaceRelationFilter; + + @Field(() => UserRelationFilter, {nullable:true}) + author?: UserRelationFilter; } diff --git a/server/src/core/@generated/comment-thread/comment-thread.model.ts b/server/src/core/@generated/comment-thread/comment-thread.model.ts index ebca169cbdf..e8411c7368f 100644 --- a/server/src/core/@generated/comment-thread/comment-thread.model.ts +++ b/server/src/core/@generated/comment-thread/comment-thread.model.ts @@ -5,6 +5,7 @@ import { HideField } from '@nestjs/graphql'; import { CommentThreadTarget } from '../comment-thread-target/comment-thread-target.model'; import { Comment } from '../comment/comment.model'; import { Workspace } from '../workspace/workspace.model'; +import { User } from '../user/user.model'; import { CommentThreadCount } from '../comment/comment-thread-count.output'; @ObjectType() @@ -16,8 +17,8 @@ export class CommentThread { @HideField() workspaceId!: string; - @Field(() => String, {nullable:true}) - authorId!: string | null; + @Field(() => String, {nullable:false}) + authorId!: string; @Field(() => String, {nullable:true}) body!: string | null; @@ -43,6 +44,9 @@ export class CommentThread { @HideField() workspace?: Workspace; + @Field(() => User, {nullable:false}) + author?: User; + @HideField() _count?: CommentThreadCount; } diff --git a/server/src/core/@generated/user/user-count.output.ts b/server/src/core/@generated/user/user-count.output.ts index a2e33d9c0ef..13d95817fc2 100644 --- a/server/src/core/@generated/user/user-count.output.ts +++ b/server/src/core/@generated/user/user-count.output.ts @@ -13,4 +13,7 @@ export class UserCount { @Field(() => Int, {nullable:false}) comments?: number; + + @Field(() => Int, {nullable:false}) + CommentThread?: number; } diff --git a/server/src/core/@generated/user/user-create-nested-one-without-comment-thread.input.ts b/server/src/core/@generated/user/user-create-nested-one-without-comment-thread.input.ts new file mode 100644 index 00000000000..3ecbc6a70a7 --- /dev/null +++ b/server/src/core/@generated/user/user-create-nested-one-without-comment-thread.input.ts @@ -0,0 +1,22 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { UserCreateWithoutCommentThreadInput } from './user-create-without-comment-thread.input'; +import { Type } from 'class-transformer'; +import { UserCreateOrConnectWithoutCommentThreadInput } from './user-create-or-connect-without-comment-thread.input'; +import { UserWhereUniqueInput } from './user-where-unique.input'; + +@InputType() +export class UserCreateNestedOneWithoutCommentThreadInput { + + @Field(() => UserCreateWithoutCommentThreadInput, {nullable:true}) + @Type(() => UserCreateWithoutCommentThreadInput) + create?: UserCreateWithoutCommentThreadInput; + + @Field(() => UserCreateOrConnectWithoutCommentThreadInput, {nullable:true}) + @Type(() => UserCreateOrConnectWithoutCommentThreadInput) + connectOrCreate?: UserCreateOrConnectWithoutCommentThreadInput; + + @Field(() => UserWhereUniqueInput, {nullable:true}) + @Type(() => UserWhereUniqueInput) + connect?: UserWhereUniqueInput; +} diff --git a/server/src/core/@generated/user/user-create-or-connect-without-comment-thread.input.ts b/server/src/core/@generated/user/user-create-or-connect-without-comment-thread.input.ts new file mode 100644 index 00000000000..8643ebc848d --- /dev/null +++ b/server/src/core/@generated/user/user-create-or-connect-without-comment-thread.input.ts @@ -0,0 +1,17 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { UserWhereUniqueInput } from './user-where-unique.input'; +import { Type } from 'class-transformer'; +import { UserCreateWithoutCommentThreadInput } from './user-create-without-comment-thread.input'; + +@InputType() +export class UserCreateOrConnectWithoutCommentThreadInput { + + @Field(() => UserWhereUniqueInput, {nullable:false}) + @Type(() => UserWhereUniqueInput) + where!: UserWhereUniqueInput; + + @Field(() => UserCreateWithoutCommentThreadInput, {nullable:false}) + @Type(() => UserCreateWithoutCommentThreadInput) + create!: UserCreateWithoutCommentThreadInput; +} diff --git a/server/src/core/@generated/user/user-create-without-comment-thread.input.ts b/server/src/core/@generated/user/user-create-without-comment-thread.input.ts new file mode 100644 index 00000000000..823ed0d55da --- /dev/null +++ b/server/src/core/@generated/user/user-create-without-comment-thread.input.ts @@ -0,0 +1,88 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import * as Validator from 'class-validator'; +import { HideField } from '@nestjs/graphql'; +import { GraphQLJSON } from 'graphql-type-json'; +import { WorkspaceMemberCreateNestedOneWithoutUserInput } from '../workspace-member/workspace-member-create-nested-one-without-user.input'; +import { CompanyCreateNestedManyWithoutAccountOwnerInput } from '../company/company-create-nested-many-without-account-owner.input'; +import { RefreshTokenCreateNestedManyWithoutUserInput } from '../refresh-token/refresh-token-create-nested-many-without-user.input'; +import { CommentCreateNestedManyWithoutAuthorInput } from '../comment/comment-create-nested-many-without-author.input'; + +@InputType() +export class UserCreateWithoutCommentThreadInput { + + @Field(() => String, {nullable:true}) + @Validator.IsString() + @Validator.IsOptional() + id?: string; + + @Field(() => String, {nullable:false}) + @Validator.IsString() + firstName!: string; + + @Field(() => String, {nullable:false}) + @Validator.IsString() + lastName!: string; + + @Field(() => String, {nullable:false}) + @Validator.IsEmail() + email!: string; + + @Field(() => Boolean, {nullable:true}) + @Validator.IsBoolean() + @Validator.IsOptional() + emailVerified?: boolean; + + @Field(() => String, {nullable:true}) + @Validator.IsString() + @Validator.IsOptional() + avatarUrl?: string; + + @Field(() => String, {nullable:false}) + @Validator.IsString() + locale!: string; + + @Field(() => String, {nullable:true}) + @Validator.IsString() + @Validator.IsOptional() + phoneNumber?: string; + + @Field(() => Date, {nullable:true}) + @Validator.IsDate() + @Validator.IsOptional() + lastSeen?: Date | string; + + @Field(() => Boolean, {nullable:true}) + @Validator.IsBoolean() + @Validator.IsOptional() + disabled?: boolean; + + @HideField() + passwordHash?: string; + + @Field(() => GraphQLJSON, {nullable:true}) + @Validator.IsJSON() + @Validator.IsOptional() + metadata?: any; + + @HideField() + deletedAt?: Date | string; + + @Field(() => Date, {nullable:true}) + createdAt?: Date | string; + + @Field(() => Date, {nullable:true}) + updatedAt?: Date | string; + + @HideField() + workspaceMember?: WorkspaceMemberCreateNestedOneWithoutUserInput; + + @Field(() => CompanyCreateNestedManyWithoutAccountOwnerInput, {nullable:true}) + companies?: CompanyCreateNestedManyWithoutAccountOwnerInput; + + @HideField() + refreshTokens?: RefreshTokenCreateNestedManyWithoutUserInput; + + @Field(() => CommentCreateNestedManyWithoutAuthorInput, {nullable:true}) + comments?: CommentCreateNestedManyWithoutAuthorInput; +} diff --git a/server/src/core/@generated/user/user-create-without-comments.input.ts b/server/src/core/@generated/user/user-create-without-comments.input.ts index 2820973bce6..29653026b20 100644 --- a/server/src/core/@generated/user/user-create-without-comments.input.ts +++ b/server/src/core/@generated/user/user-create-without-comments.input.ts @@ -6,6 +6,7 @@ import { GraphQLJSON } from 'graphql-type-json'; import { WorkspaceMemberCreateNestedOneWithoutUserInput } from '../workspace-member/workspace-member-create-nested-one-without-user.input'; import { CompanyCreateNestedManyWithoutAccountOwnerInput } from '../company/company-create-nested-many-without-account-owner.input'; import { RefreshTokenCreateNestedManyWithoutUserInput } from '../refresh-token/refresh-token-create-nested-many-without-user.input'; +import { CommentThreadCreateNestedManyWithoutAuthorInput } from '../comment-thread/comment-thread-create-nested-many-without-author.input'; @InputType() export class UserCreateWithoutCommentsInput { @@ -81,4 +82,7 @@ export class UserCreateWithoutCommentsInput { @HideField() refreshTokens?: RefreshTokenCreateNestedManyWithoutUserInput; + + @Field(() => CommentThreadCreateNestedManyWithoutAuthorInput, {nullable:true}) + CommentThread?: CommentThreadCreateNestedManyWithoutAuthorInput; } diff --git a/server/src/core/@generated/user/user-create-without-companies.input.ts b/server/src/core/@generated/user/user-create-without-companies.input.ts index 05725e78be6..d2f140cb37c 100644 --- a/server/src/core/@generated/user/user-create-without-companies.input.ts +++ b/server/src/core/@generated/user/user-create-without-companies.input.ts @@ -6,6 +6,7 @@ import { GraphQLJSON } from 'graphql-type-json'; import { WorkspaceMemberCreateNestedOneWithoutUserInput } from '../workspace-member/workspace-member-create-nested-one-without-user.input'; import { RefreshTokenCreateNestedManyWithoutUserInput } from '../refresh-token/refresh-token-create-nested-many-without-user.input'; import { CommentCreateNestedManyWithoutAuthorInput } from '../comment/comment-create-nested-many-without-author.input'; +import { CommentThreadCreateNestedManyWithoutAuthorInput } from '../comment-thread/comment-thread-create-nested-many-without-author.input'; @InputType() export class UserCreateWithoutCompaniesInput { @@ -81,4 +82,7 @@ export class UserCreateWithoutCompaniesInput { @Field(() => CommentCreateNestedManyWithoutAuthorInput, {nullable:true}) comments?: CommentCreateNestedManyWithoutAuthorInput; + + @Field(() => CommentThreadCreateNestedManyWithoutAuthorInput, {nullable:true}) + CommentThread?: CommentThreadCreateNestedManyWithoutAuthorInput; } diff --git a/server/src/core/@generated/user/user-create-without-refresh-tokens.input.ts b/server/src/core/@generated/user/user-create-without-refresh-tokens.input.ts index 2de51bc820b..f79e7b5cb95 100644 --- a/server/src/core/@generated/user/user-create-without-refresh-tokens.input.ts +++ b/server/src/core/@generated/user/user-create-without-refresh-tokens.input.ts @@ -6,6 +6,7 @@ import { GraphQLJSON } from 'graphql-type-json'; import { WorkspaceMemberCreateNestedOneWithoutUserInput } from '../workspace-member/workspace-member-create-nested-one-without-user.input'; import { CompanyCreateNestedManyWithoutAccountOwnerInput } from '../company/company-create-nested-many-without-account-owner.input'; import { CommentCreateNestedManyWithoutAuthorInput } from '../comment/comment-create-nested-many-without-author.input'; +import { CommentThreadCreateNestedManyWithoutAuthorInput } from '../comment-thread/comment-thread-create-nested-many-without-author.input'; @InputType() export class UserCreateWithoutRefreshTokensInput { @@ -81,4 +82,7 @@ export class UserCreateWithoutRefreshTokensInput { @Field(() => CommentCreateNestedManyWithoutAuthorInput, {nullable:true}) comments?: CommentCreateNestedManyWithoutAuthorInput; + + @Field(() => CommentThreadCreateNestedManyWithoutAuthorInput, {nullable:true}) + CommentThread?: CommentThreadCreateNestedManyWithoutAuthorInput; } diff --git a/server/src/core/@generated/user/user-create-without-workspace-member.input.ts b/server/src/core/@generated/user/user-create-without-workspace-member.input.ts index 53bbbe4cbed..a297339e3a5 100644 --- a/server/src/core/@generated/user/user-create-without-workspace-member.input.ts +++ b/server/src/core/@generated/user/user-create-without-workspace-member.input.ts @@ -6,6 +6,7 @@ import { GraphQLJSON } from 'graphql-type-json'; import { CompanyCreateNestedManyWithoutAccountOwnerInput } from '../company/company-create-nested-many-without-account-owner.input'; import { RefreshTokenCreateNestedManyWithoutUserInput } from '../refresh-token/refresh-token-create-nested-many-without-user.input'; import { CommentCreateNestedManyWithoutAuthorInput } from '../comment/comment-create-nested-many-without-author.input'; +import { CommentThreadCreateNestedManyWithoutAuthorInput } from '../comment-thread/comment-thread-create-nested-many-without-author.input'; @InputType() export class UserCreateWithoutWorkspaceMemberInput { @@ -81,4 +82,7 @@ export class UserCreateWithoutWorkspaceMemberInput { @Field(() => CommentCreateNestedManyWithoutAuthorInput, {nullable:true}) comments?: CommentCreateNestedManyWithoutAuthorInput; + + @Field(() => CommentThreadCreateNestedManyWithoutAuthorInput, {nullable:true}) + CommentThread?: CommentThreadCreateNestedManyWithoutAuthorInput; } diff --git a/server/src/core/@generated/user/user-create.input.ts b/server/src/core/@generated/user/user-create.input.ts index ffd550aa2e6..457488d94ea 100644 --- a/server/src/core/@generated/user/user-create.input.ts +++ b/server/src/core/@generated/user/user-create.input.ts @@ -7,6 +7,7 @@ import { WorkspaceMemberCreateNestedOneWithoutUserInput } from '../workspace-mem import { CompanyCreateNestedManyWithoutAccountOwnerInput } from '../company/company-create-nested-many-without-account-owner.input'; import { RefreshTokenCreateNestedManyWithoutUserInput } from '../refresh-token/refresh-token-create-nested-many-without-user.input'; import { CommentCreateNestedManyWithoutAuthorInput } from '../comment/comment-create-nested-many-without-author.input'; +import { CommentThreadCreateNestedManyWithoutAuthorInput } from '../comment-thread/comment-thread-create-nested-many-without-author.input'; @InputType() export class UserCreateInput { @@ -85,4 +86,7 @@ export class UserCreateInput { @Field(() => CommentCreateNestedManyWithoutAuthorInput, {nullable:true}) comments?: CommentCreateNestedManyWithoutAuthorInput; + + @Field(() => CommentThreadCreateNestedManyWithoutAuthorInput, {nullable:true}) + CommentThread?: CommentThreadCreateNestedManyWithoutAuthorInput; } diff --git a/server/src/core/@generated/user/user-order-by-with-relation.input.ts b/server/src/core/@generated/user/user-order-by-with-relation.input.ts index 1472696c395..c0408a00584 100644 --- a/server/src/core/@generated/user/user-order-by-with-relation.input.ts +++ b/server/src/core/@generated/user/user-order-by-with-relation.input.ts @@ -6,6 +6,7 @@ import { WorkspaceMemberOrderByWithRelationInput } from '../workspace-member/wor import { CompanyOrderByRelationAggregateInput } from '../company/company-order-by-relation-aggregate.input'; import { RefreshTokenOrderByRelationAggregateInput } from '../refresh-token/refresh-token-order-by-relation-aggregate.input'; import { CommentOrderByRelationAggregateInput } from '../comment/comment-order-by-relation-aggregate.input'; +import { CommentThreadOrderByRelationAggregateInput } from '../comment-thread/comment-thread-order-by-relation-aggregate.input'; @InputType() export class UserOrderByWithRelationInput { @@ -66,4 +67,7 @@ export class UserOrderByWithRelationInput { @Field(() => CommentOrderByRelationAggregateInput, {nullable:true}) comments?: CommentOrderByRelationAggregateInput; + + @Field(() => CommentThreadOrderByRelationAggregateInput, {nullable:true}) + CommentThread?: CommentThreadOrderByRelationAggregateInput; } diff --git a/server/src/core/@generated/user/user-unchecked-create-without-comment-thread.input.ts b/server/src/core/@generated/user/user-unchecked-create-without-comment-thread.input.ts new file mode 100644 index 00000000000..f07addb448d --- /dev/null +++ b/server/src/core/@generated/user/user-unchecked-create-without-comment-thread.input.ts @@ -0,0 +1,88 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import * as Validator from 'class-validator'; +import { HideField } from '@nestjs/graphql'; +import { GraphQLJSON } from 'graphql-type-json'; +import { WorkspaceMemberUncheckedCreateNestedOneWithoutUserInput } from '../workspace-member/workspace-member-unchecked-create-nested-one-without-user.input'; +import { CompanyUncheckedCreateNestedManyWithoutAccountOwnerInput } from '../company/company-unchecked-create-nested-many-without-account-owner.input'; +import { RefreshTokenUncheckedCreateNestedManyWithoutUserInput } from '../refresh-token/refresh-token-unchecked-create-nested-many-without-user.input'; +import { CommentUncheckedCreateNestedManyWithoutAuthorInput } from '../comment/comment-unchecked-create-nested-many-without-author.input'; + +@InputType() +export class UserUncheckedCreateWithoutCommentThreadInput { + + @Field(() => String, {nullable:true}) + @Validator.IsString() + @Validator.IsOptional() + id?: string; + + @Field(() => String, {nullable:false}) + @Validator.IsString() + firstName!: string; + + @Field(() => String, {nullable:false}) + @Validator.IsString() + lastName!: string; + + @Field(() => String, {nullable:false}) + @Validator.IsEmail() + email!: string; + + @Field(() => Boolean, {nullable:true}) + @Validator.IsBoolean() + @Validator.IsOptional() + emailVerified?: boolean; + + @Field(() => String, {nullable:true}) + @Validator.IsString() + @Validator.IsOptional() + avatarUrl?: string; + + @Field(() => String, {nullable:false}) + @Validator.IsString() + locale!: string; + + @Field(() => String, {nullable:true}) + @Validator.IsString() + @Validator.IsOptional() + phoneNumber?: string; + + @Field(() => Date, {nullable:true}) + @Validator.IsDate() + @Validator.IsOptional() + lastSeen?: Date | string; + + @Field(() => Boolean, {nullable:true}) + @Validator.IsBoolean() + @Validator.IsOptional() + disabled?: boolean; + + @HideField() + passwordHash?: string; + + @Field(() => GraphQLJSON, {nullable:true}) + @Validator.IsJSON() + @Validator.IsOptional() + metadata?: any; + + @HideField() + deletedAt?: Date | string; + + @Field(() => Date, {nullable:true}) + createdAt?: Date | string; + + @Field(() => Date, {nullable:true}) + updatedAt?: Date | string; + + @HideField() + workspaceMember?: WorkspaceMemberUncheckedCreateNestedOneWithoutUserInput; + + @Field(() => CompanyUncheckedCreateNestedManyWithoutAccountOwnerInput, {nullable:true}) + companies?: CompanyUncheckedCreateNestedManyWithoutAccountOwnerInput; + + @HideField() + refreshTokens?: RefreshTokenUncheckedCreateNestedManyWithoutUserInput; + + @Field(() => CommentUncheckedCreateNestedManyWithoutAuthorInput, {nullable:true}) + comments?: CommentUncheckedCreateNestedManyWithoutAuthorInput; +} diff --git a/server/src/core/@generated/user/user-unchecked-create-without-comments.input.ts b/server/src/core/@generated/user/user-unchecked-create-without-comments.input.ts index 6a3ff5d9f63..45d8c84235a 100644 --- a/server/src/core/@generated/user/user-unchecked-create-without-comments.input.ts +++ b/server/src/core/@generated/user/user-unchecked-create-without-comments.input.ts @@ -6,6 +6,7 @@ import { GraphQLJSON } from 'graphql-type-json'; import { WorkspaceMemberUncheckedCreateNestedOneWithoutUserInput } from '../workspace-member/workspace-member-unchecked-create-nested-one-without-user.input'; import { CompanyUncheckedCreateNestedManyWithoutAccountOwnerInput } from '../company/company-unchecked-create-nested-many-without-account-owner.input'; import { RefreshTokenUncheckedCreateNestedManyWithoutUserInput } from '../refresh-token/refresh-token-unchecked-create-nested-many-without-user.input'; +import { CommentThreadUncheckedCreateNestedManyWithoutAuthorInput } from '../comment-thread/comment-thread-unchecked-create-nested-many-without-author.input'; @InputType() export class UserUncheckedCreateWithoutCommentsInput { @@ -81,4 +82,7 @@ export class UserUncheckedCreateWithoutCommentsInput { @HideField() refreshTokens?: RefreshTokenUncheckedCreateNestedManyWithoutUserInput; + + @Field(() => CommentThreadUncheckedCreateNestedManyWithoutAuthorInput, {nullable:true}) + CommentThread?: CommentThreadUncheckedCreateNestedManyWithoutAuthorInput; } diff --git a/server/src/core/@generated/user/user-unchecked-create-without-companies.input.ts b/server/src/core/@generated/user/user-unchecked-create-without-companies.input.ts index fb40c877588..c68704321d2 100644 --- a/server/src/core/@generated/user/user-unchecked-create-without-companies.input.ts +++ b/server/src/core/@generated/user/user-unchecked-create-without-companies.input.ts @@ -6,6 +6,7 @@ import { GraphQLJSON } from 'graphql-type-json'; import { WorkspaceMemberUncheckedCreateNestedOneWithoutUserInput } from '../workspace-member/workspace-member-unchecked-create-nested-one-without-user.input'; import { RefreshTokenUncheckedCreateNestedManyWithoutUserInput } from '../refresh-token/refresh-token-unchecked-create-nested-many-without-user.input'; import { CommentUncheckedCreateNestedManyWithoutAuthorInput } from '../comment/comment-unchecked-create-nested-many-without-author.input'; +import { CommentThreadUncheckedCreateNestedManyWithoutAuthorInput } from '../comment-thread/comment-thread-unchecked-create-nested-many-without-author.input'; @InputType() export class UserUncheckedCreateWithoutCompaniesInput { @@ -81,4 +82,7 @@ export class UserUncheckedCreateWithoutCompaniesInput { @Field(() => CommentUncheckedCreateNestedManyWithoutAuthorInput, {nullable:true}) comments?: CommentUncheckedCreateNestedManyWithoutAuthorInput; + + @Field(() => CommentThreadUncheckedCreateNestedManyWithoutAuthorInput, {nullable:true}) + CommentThread?: CommentThreadUncheckedCreateNestedManyWithoutAuthorInput; } diff --git a/server/src/core/@generated/user/user-unchecked-create-without-refresh-tokens.input.ts b/server/src/core/@generated/user/user-unchecked-create-without-refresh-tokens.input.ts index 2a258119fe7..ad815847883 100644 --- a/server/src/core/@generated/user/user-unchecked-create-without-refresh-tokens.input.ts +++ b/server/src/core/@generated/user/user-unchecked-create-without-refresh-tokens.input.ts @@ -6,6 +6,7 @@ import { GraphQLJSON } from 'graphql-type-json'; import { WorkspaceMemberUncheckedCreateNestedOneWithoutUserInput } from '../workspace-member/workspace-member-unchecked-create-nested-one-without-user.input'; import { CompanyUncheckedCreateNestedManyWithoutAccountOwnerInput } from '../company/company-unchecked-create-nested-many-without-account-owner.input'; import { CommentUncheckedCreateNestedManyWithoutAuthorInput } from '../comment/comment-unchecked-create-nested-many-without-author.input'; +import { CommentThreadUncheckedCreateNestedManyWithoutAuthorInput } from '../comment-thread/comment-thread-unchecked-create-nested-many-without-author.input'; @InputType() export class UserUncheckedCreateWithoutRefreshTokensInput { @@ -81,4 +82,7 @@ export class UserUncheckedCreateWithoutRefreshTokensInput { @Field(() => CommentUncheckedCreateNestedManyWithoutAuthorInput, {nullable:true}) comments?: CommentUncheckedCreateNestedManyWithoutAuthorInput; + + @Field(() => CommentThreadUncheckedCreateNestedManyWithoutAuthorInput, {nullable:true}) + CommentThread?: CommentThreadUncheckedCreateNestedManyWithoutAuthorInput; } diff --git a/server/src/core/@generated/user/user-unchecked-create-without-workspace-member.input.ts b/server/src/core/@generated/user/user-unchecked-create-without-workspace-member.input.ts index 12c65db6bb2..565952aeae4 100644 --- a/server/src/core/@generated/user/user-unchecked-create-without-workspace-member.input.ts +++ b/server/src/core/@generated/user/user-unchecked-create-without-workspace-member.input.ts @@ -6,6 +6,7 @@ import { GraphQLJSON } from 'graphql-type-json'; import { CompanyUncheckedCreateNestedManyWithoutAccountOwnerInput } from '../company/company-unchecked-create-nested-many-without-account-owner.input'; import { RefreshTokenUncheckedCreateNestedManyWithoutUserInput } from '../refresh-token/refresh-token-unchecked-create-nested-many-without-user.input'; import { CommentUncheckedCreateNestedManyWithoutAuthorInput } from '../comment/comment-unchecked-create-nested-many-without-author.input'; +import { CommentThreadUncheckedCreateNestedManyWithoutAuthorInput } from '../comment-thread/comment-thread-unchecked-create-nested-many-without-author.input'; @InputType() export class UserUncheckedCreateWithoutWorkspaceMemberInput { @@ -81,4 +82,7 @@ export class UserUncheckedCreateWithoutWorkspaceMemberInput { @Field(() => CommentUncheckedCreateNestedManyWithoutAuthorInput, {nullable:true}) comments?: CommentUncheckedCreateNestedManyWithoutAuthorInput; + + @Field(() => CommentThreadUncheckedCreateNestedManyWithoutAuthorInput, {nullable:true}) + CommentThread?: CommentThreadUncheckedCreateNestedManyWithoutAuthorInput; } diff --git a/server/src/core/@generated/user/user-unchecked-create.input.ts b/server/src/core/@generated/user/user-unchecked-create.input.ts index e9b43a57689..f20fae7f3bb 100644 --- a/server/src/core/@generated/user/user-unchecked-create.input.ts +++ b/server/src/core/@generated/user/user-unchecked-create.input.ts @@ -7,6 +7,7 @@ import { WorkspaceMemberUncheckedCreateNestedOneWithoutUserInput } from '../work import { CompanyUncheckedCreateNestedManyWithoutAccountOwnerInput } from '../company/company-unchecked-create-nested-many-without-account-owner.input'; import { RefreshTokenUncheckedCreateNestedManyWithoutUserInput } from '../refresh-token/refresh-token-unchecked-create-nested-many-without-user.input'; import { CommentUncheckedCreateNestedManyWithoutAuthorInput } from '../comment/comment-unchecked-create-nested-many-without-author.input'; +import { CommentThreadUncheckedCreateNestedManyWithoutAuthorInput } from '../comment-thread/comment-thread-unchecked-create-nested-many-without-author.input'; @InputType() export class UserUncheckedCreateInput { @@ -85,4 +86,7 @@ export class UserUncheckedCreateInput { @Field(() => CommentUncheckedCreateNestedManyWithoutAuthorInput, {nullable:true}) comments?: CommentUncheckedCreateNestedManyWithoutAuthorInput; + + @Field(() => CommentThreadUncheckedCreateNestedManyWithoutAuthorInput, {nullable:true}) + CommentThread?: CommentThreadUncheckedCreateNestedManyWithoutAuthorInput; } diff --git a/server/src/core/@generated/user/user-unchecked-update-without-comment-thread.input.ts b/server/src/core/@generated/user/user-unchecked-update-without-comment-thread.input.ts new file mode 100644 index 00000000000..2db11e77eff --- /dev/null +++ b/server/src/core/@generated/user/user-unchecked-update-without-comment-thread.input.ts @@ -0,0 +1,77 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; +import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; +import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input'; +import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; +import { HideField } from '@nestjs/graphql'; +import { GraphQLJSON } from 'graphql-type-json'; +import * as Validator from 'class-validator'; +import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-update-operations.input'; +import { WorkspaceMemberUncheckedUpdateOneWithoutUserNestedInput } from '../workspace-member/workspace-member-unchecked-update-one-without-user-nested.input'; +import { CompanyUncheckedUpdateManyWithoutAccountOwnerNestedInput } from '../company/company-unchecked-update-many-without-account-owner-nested.input'; +import { RefreshTokenUncheckedUpdateManyWithoutUserNestedInput } from '../refresh-token/refresh-token-unchecked-update-many-without-user-nested.input'; +import { CommentUncheckedUpdateManyWithoutAuthorNestedInput } from '../comment/comment-unchecked-update-many-without-author-nested.input'; + +@InputType() +export class UserUncheckedUpdateWithoutCommentThreadInput { + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + id?: StringFieldUpdateOperationsInput; + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + firstName?: StringFieldUpdateOperationsInput; + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + lastName?: StringFieldUpdateOperationsInput; + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + email?: StringFieldUpdateOperationsInput; + + @Field(() => BoolFieldUpdateOperationsInput, {nullable:true}) + emailVerified?: BoolFieldUpdateOperationsInput; + + @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) + avatarUrl?: NullableStringFieldUpdateOperationsInput; + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + locale?: StringFieldUpdateOperationsInput; + + @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) + phoneNumber?: NullableStringFieldUpdateOperationsInput; + + @Field(() => NullableDateTimeFieldUpdateOperationsInput, {nullable:true}) + lastSeen?: NullableDateTimeFieldUpdateOperationsInput; + + @Field(() => BoolFieldUpdateOperationsInput, {nullable:true}) + disabled?: BoolFieldUpdateOperationsInput; + + @HideField() + passwordHash?: NullableStringFieldUpdateOperationsInput; + + @Field(() => GraphQLJSON, {nullable:true}) + @Validator.IsJSON() + @Validator.IsOptional() + metadata?: any; + + @HideField() + deletedAt?: NullableDateTimeFieldUpdateOperationsInput; + + @Field(() => DateTimeFieldUpdateOperationsInput, {nullable:true}) + createdAt?: DateTimeFieldUpdateOperationsInput; + + @Field(() => DateTimeFieldUpdateOperationsInput, {nullable:true}) + updatedAt?: DateTimeFieldUpdateOperationsInput; + + @HideField() + workspaceMember?: WorkspaceMemberUncheckedUpdateOneWithoutUserNestedInput; + + @Field(() => CompanyUncheckedUpdateManyWithoutAccountOwnerNestedInput, {nullable:true}) + companies?: CompanyUncheckedUpdateManyWithoutAccountOwnerNestedInput; + + @HideField() + refreshTokens?: RefreshTokenUncheckedUpdateManyWithoutUserNestedInput; + + @Field(() => CommentUncheckedUpdateManyWithoutAuthorNestedInput, {nullable:true}) + comments?: CommentUncheckedUpdateManyWithoutAuthorNestedInput; +} diff --git a/server/src/core/@generated/user/user-unchecked-update-without-comments.input.ts b/server/src/core/@generated/user/user-unchecked-update-without-comments.input.ts index 57678cd5c97..2df3eeece1e 100644 --- a/server/src/core/@generated/user/user-unchecked-update-without-comments.input.ts +++ b/server/src/core/@generated/user/user-unchecked-update-without-comments.input.ts @@ -11,6 +11,7 @@ import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-up import { WorkspaceMemberUncheckedUpdateOneWithoutUserNestedInput } from '../workspace-member/workspace-member-unchecked-update-one-without-user-nested.input'; import { CompanyUncheckedUpdateManyWithoutAccountOwnerNestedInput } from '../company/company-unchecked-update-many-without-account-owner-nested.input'; import { RefreshTokenUncheckedUpdateManyWithoutUserNestedInput } from '../refresh-token/refresh-token-unchecked-update-many-without-user-nested.input'; +import { CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput } from '../comment-thread/comment-thread-unchecked-update-many-without-author-nested.input'; @InputType() export class UserUncheckedUpdateWithoutCommentsInput { @@ -70,4 +71,7 @@ export class UserUncheckedUpdateWithoutCommentsInput { @HideField() refreshTokens?: RefreshTokenUncheckedUpdateManyWithoutUserNestedInput; + + @Field(() => CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput, {nullable:true}) + CommentThread?: CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput; } diff --git a/server/src/core/@generated/user/user-unchecked-update-without-companies.input.ts b/server/src/core/@generated/user/user-unchecked-update-without-companies.input.ts index 984f85a67b2..dbad58ff587 100644 --- a/server/src/core/@generated/user/user-unchecked-update-without-companies.input.ts +++ b/server/src/core/@generated/user/user-unchecked-update-without-companies.input.ts @@ -11,6 +11,7 @@ import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-up import { WorkspaceMemberUncheckedUpdateOneWithoutUserNestedInput } from '../workspace-member/workspace-member-unchecked-update-one-without-user-nested.input'; import { RefreshTokenUncheckedUpdateManyWithoutUserNestedInput } from '../refresh-token/refresh-token-unchecked-update-many-without-user-nested.input'; import { CommentUncheckedUpdateManyWithoutAuthorNestedInput } from '../comment/comment-unchecked-update-many-without-author-nested.input'; +import { CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput } from '../comment-thread/comment-thread-unchecked-update-many-without-author-nested.input'; @InputType() export class UserUncheckedUpdateWithoutCompaniesInput { @@ -70,4 +71,7 @@ export class UserUncheckedUpdateWithoutCompaniesInput { @Field(() => CommentUncheckedUpdateManyWithoutAuthorNestedInput, {nullable:true}) comments?: CommentUncheckedUpdateManyWithoutAuthorNestedInput; + + @Field(() => CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput, {nullable:true}) + CommentThread?: CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput; } diff --git a/server/src/core/@generated/user/user-unchecked-update-without-refresh-tokens.input.ts b/server/src/core/@generated/user/user-unchecked-update-without-refresh-tokens.input.ts index 1153e2c0a5c..2c1e4f16b75 100644 --- a/server/src/core/@generated/user/user-unchecked-update-without-refresh-tokens.input.ts +++ b/server/src/core/@generated/user/user-unchecked-update-without-refresh-tokens.input.ts @@ -11,6 +11,7 @@ import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-up import { WorkspaceMemberUncheckedUpdateOneWithoutUserNestedInput } from '../workspace-member/workspace-member-unchecked-update-one-without-user-nested.input'; import { CompanyUncheckedUpdateManyWithoutAccountOwnerNestedInput } from '../company/company-unchecked-update-many-without-account-owner-nested.input'; import { CommentUncheckedUpdateManyWithoutAuthorNestedInput } from '../comment/comment-unchecked-update-many-without-author-nested.input'; +import { CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput } from '../comment-thread/comment-thread-unchecked-update-many-without-author-nested.input'; @InputType() export class UserUncheckedUpdateWithoutRefreshTokensInput { @@ -70,4 +71,7 @@ export class UserUncheckedUpdateWithoutRefreshTokensInput { @Field(() => CommentUncheckedUpdateManyWithoutAuthorNestedInput, {nullable:true}) comments?: CommentUncheckedUpdateManyWithoutAuthorNestedInput; + + @Field(() => CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput, {nullable:true}) + CommentThread?: CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput; } diff --git a/server/src/core/@generated/user/user-unchecked-update-without-workspace-member.input.ts b/server/src/core/@generated/user/user-unchecked-update-without-workspace-member.input.ts index 9d30bd8b69f..43c379ece74 100644 --- a/server/src/core/@generated/user/user-unchecked-update-without-workspace-member.input.ts +++ b/server/src/core/@generated/user/user-unchecked-update-without-workspace-member.input.ts @@ -11,6 +11,7 @@ import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-up import { CompanyUncheckedUpdateManyWithoutAccountOwnerNestedInput } from '../company/company-unchecked-update-many-without-account-owner-nested.input'; import { RefreshTokenUncheckedUpdateManyWithoutUserNestedInput } from '../refresh-token/refresh-token-unchecked-update-many-without-user-nested.input'; import { CommentUncheckedUpdateManyWithoutAuthorNestedInput } from '../comment/comment-unchecked-update-many-without-author-nested.input'; +import { CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput } from '../comment-thread/comment-thread-unchecked-update-many-without-author-nested.input'; @InputType() export class UserUncheckedUpdateWithoutWorkspaceMemberInput { @@ -70,4 +71,7 @@ export class UserUncheckedUpdateWithoutWorkspaceMemberInput { @Field(() => CommentUncheckedUpdateManyWithoutAuthorNestedInput, {nullable:true}) comments?: CommentUncheckedUpdateManyWithoutAuthorNestedInput; + + @Field(() => CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput, {nullable:true}) + CommentThread?: CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput; } diff --git a/server/src/core/@generated/user/user-unchecked-update.input.ts b/server/src/core/@generated/user/user-unchecked-update.input.ts index 20818ebf854..17be05928af 100644 --- a/server/src/core/@generated/user/user-unchecked-update.input.ts +++ b/server/src/core/@generated/user/user-unchecked-update.input.ts @@ -12,6 +12,7 @@ import { WorkspaceMemberUncheckedUpdateOneWithoutUserNestedInput } from '../work import { CompanyUncheckedUpdateManyWithoutAccountOwnerNestedInput } from '../company/company-unchecked-update-many-without-account-owner-nested.input'; import { RefreshTokenUncheckedUpdateManyWithoutUserNestedInput } from '../refresh-token/refresh-token-unchecked-update-many-without-user-nested.input'; import { CommentUncheckedUpdateManyWithoutAuthorNestedInput } from '../comment/comment-unchecked-update-many-without-author-nested.input'; +import { CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput } from '../comment-thread/comment-thread-unchecked-update-many-without-author-nested.input'; @InputType() export class UserUncheckedUpdateInput { @@ -74,4 +75,7 @@ export class UserUncheckedUpdateInput { @Field(() => CommentUncheckedUpdateManyWithoutAuthorNestedInput, {nullable:true}) comments?: CommentUncheckedUpdateManyWithoutAuthorNestedInput; + + @Field(() => CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput, {nullable:true}) + CommentThread?: CommentThreadUncheckedUpdateManyWithoutAuthorNestedInput; } diff --git a/server/src/core/@generated/user/user-update-one-required-without-comment-thread-nested.input.ts b/server/src/core/@generated/user/user-update-one-required-without-comment-thread-nested.input.ts new file mode 100644 index 00000000000..d57bab76569 --- /dev/null +++ b/server/src/core/@generated/user/user-update-one-required-without-comment-thread-nested.input.ts @@ -0,0 +1,32 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { UserCreateWithoutCommentThreadInput } from './user-create-without-comment-thread.input'; +import { Type } from 'class-transformer'; +import { UserCreateOrConnectWithoutCommentThreadInput } from './user-create-or-connect-without-comment-thread.input'; +import { UserUpsertWithoutCommentThreadInput } from './user-upsert-without-comment-thread.input'; +import { UserWhereUniqueInput } from './user-where-unique.input'; +import { UserUpdateWithoutCommentThreadInput } from './user-update-without-comment-thread.input'; + +@InputType() +export class UserUpdateOneRequiredWithoutCommentThreadNestedInput { + + @Field(() => UserCreateWithoutCommentThreadInput, {nullable:true}) + @Type(() => UserCreateWithoutCommentThreadInput) + create?: UserCreateWithoutCommentThreadInput; + + @Field(() => UserCreateOrConnectWithoutCommentThreadInput, {nullable:true}) + @Type(() => UserCreateOrConnectWithoutCommentThreadInput) + connectOrCreate?: UserCreateOrConnectWithoutCommentThreadInput; + + @Field(() => UserUpsertWithoutCommentThreadInput, {nullable:true}) + @Type(() => UserUpsertWithoutCommentThreadInput) + upsert?: UserUpsertWithoutCommentThreadInput; + + @Field(() => UserWhereUniqueInput, {nullable:true}) + @Type(() => UserWhereUniqueInput) + connect?: UserWhereUniqueInput; + + @Field(() => UserUpdateWithoutCommentThreadInput, {nullable:true}) + @Type(() => UserUpdateWithoutCommentThreadInput) + update?: UserUpdateWithoutCommentThreadInput; +} diff --git a/server/src/core/@generated/user/user-update-without-comment-thread.input.ts b/server/src/core/@generated/user/user-update-without-comment-thread.input.ts new file mode 100644 index 00000000000..032189c6c89 --- /dev/null +++ b/server/src/core/@generated/user/user-update-without-comment-thread.input.ts @@ -0,0 +1,77 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; +import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; +import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input'; +import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; +import { HideField } from '@nestjs/graphql'; +import { GraphQLJSON } from 'graphql-type-json'; +import * as Validator from 'class-validator'; +import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-update-operations.input'; +import { WorkspaceMemberUpdateOneWithoutUserNestedInput } from '../workspace-member/workspace-member-update-one-without-user-nested.input'; +import { CompanyUpdateManyWithoutAccountOwnerNestedInput } from '../company/company-update-many-without-account-owner-nested.input'; +import { RefreshTokenUpdateManyWithoutUserNestedInput } from '../refresh-token/refresh-token-update-many-without-user-nested.input'; +import { CommentUpdateManyWithoutAuthorNestedInput } from '../comment/comment-update-many-without-author-nested.input'; + +@InputType() +export class UserUpdateWithoutCommentThreadInput { + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + id?: StringFieldUpdateOperationsInput; + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + firstName?: StringFieldUpdateOperationsInput; + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + lastName?: StringFieldUpdateOperationsInput; + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + email?: StringFieldUpdateOperationsInput; + + @Field(() => BoolFieldUpdateOperationsInput, {nullable:true}) + emailVerified?: BoolFieldUpdateOperationsInput; + + @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) + avatarUrl?: NullableStringFieldUpdateOperationsInput; + + @Field(() => StringFieldUpdateOperationsInput, {nullable:true}) + locale?: StringFieldUpdateOperationsInput; + + @Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true}) + phoneNumber?: NullableStringFieldUpdateOperationsInput; + + @Field(() => NullableDateTimeFieldUpdateOperationsInput, {nullable:true}) + lastSeen?: NullableDateTimeFieldUpdateOperationsInput; + + @Field(() => BoolFieldUpdateOperationsInput, {nullable:true}) + disabled?: BoolFieldUpdateOperationsInput; + + @HideField() + passwordHash?: NullableStringFieldUpdateOperationsInput; + + @Field(() => GraphQLJSON, {nullable:true}) + @Validator.IsJSON() + @Validator.IsOptional() + metadata?: any; + + @HideField() + deletedAt?: NullableDateTimeFieldUpdateOperationsInput; + + @Field(() => DateTimeFieldUpdateOperationsInput, {nullable:true}) + createdAt?: DateTimeFieldUpdateOperationsInput; + + @Field(() => DateTimeFieldUpdateOperationsInput, {nullable:true}) + updatedAt?: DateTimeFieldUpdateOperationsInput; + + @HideField() + workspaceMember?: WorkspaceMemberUpdateOneWithoutUserNestedInput; + + @Field(() => CompanyUpdateManyWithoutAccountOwnerNestedInput, {nullable:true}) + companies?: CompanyUpdateManyWithoutAccountOwnerNestedInput; + + @HideField() + refreshTokens?: RefreshTokenUpdateManyWithoutUserNestedInput; + + @Field(() => CommentUpdateManyWithoutAuthorNestedInput, {nullable:true}) + comments?: CommentUpdateManyWithoutAuthorNestedInput; +} diff --git a/server/src/core/@generated/user/user-update-without-comments.input.ts b/server/src/core/@generated/user/user-update-without-comments.input.ts index 57c4cc819cb..a9f9eea2462 100644 --- a/server/src/core/@generated/user/user-update-without-comments.input.ts +++ b/server/src/core/@generated/user/user-update-without-comments.input.ts @@ -11,6 +11,7 @@ import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-up import { WorkspaceMemberUpdateOneWithoutUserNestedInput } from '../workspace-member/workspace-member-update-one-without-user-nested.input'; import { CompanyUpdateManyWithoutAccountOwnerNestedInput } from '../company/company-update-many-without-account-owner-nested.input'; import { RefreshTokenUpdateManyWithoutUserNestedInput } from '../refresh-token/refresh-token-update-many-without-user-nested.input'; +import { CommentThreadUpdateManyWithoutAuthorNestedInput } from '../comment-thread/comment-thread-update-many-without-author-nested.input'; @InputType() export class UserUpdateWithoutCommentsInput { @@ -70,4 +71,7 @@ export class UserUpdateWithoutCommentsInput { @HideField() refreshTokens?: RefreshTokenUpdateManyWithoutUserNestedInput; + + @Field(() => CommentThreadUpdateManyWithoutAuthorNestedInput, {nullable:true}) + CommentThread?: CommentThreadUpdateManyWithoutAuthorNestedInput; } diff --git a/server/src/core/@generated/user/user-update-without-companies.input.ts b/server/src/core/@generated/user/user-update-without-companies.input.ts index d6746471ec0..7db3cc11f8b 100644 --- a/server/src/core/@generated/user/user-update-without-companies.input.ts +++ b/server/src/core/@generated/user/user-update-without-companies.input.ts @@ -11,6 +11,7 @@ import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-up import { WorkspaceMemberUpdateOneWithoutUserNestedInput } from '../workspace-member/workspace-member-update-one-without-user-nested.input'; import { RefreshTokenUpdateManyWithoutUserNestedInput } from '../refresh-token/refresh-token-update-many-without-user-nested.input'; import { CommentUpdateManyWithoutAuthorNestedInput } from '../comment/comment-update-many-without-author-nested.input'; +import { CommentThreadUpdateManyWithoutAuthorNestedInput } from '../comment-thread/comment-thread-update-many-without-author-nested.input'; @InputType() export class UserUpdateWithoutCompaniesInput { @@ -70,4 +71,7 @@ export class UserUpdateWithoutCompaniesInput { @Field(() => CommentUpdateManyWithoutAuthorNestedInput, {nullable:true}) comments?: CommentUpdateManyWithoutAuthorNestedInput; + + @Field(() => CommentThreadUpdateManyWithoutAuthorNestedInput, {nullable:true}) + CommentThread?: CommentThreadUpdateManyWithoutAuthorNestedInput; } diff --git a/server/src/core/@generated/user/user-update-without-refresh-tokens.input.ts b/server/src/core/@generated/user/user-update-without-refresh-tokens.input.ts index 94d8938ceda..b50fbba7900 100644 --- a/server/src/core/@generated/user/user-update-without-refresh-tokens.input.ts +++ b/server/src/core/@generated/user/user-update-without-refresh-tokens.input.ts @@ -11,6 +11,7 @@ import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-up import { WorkspaceMemberUpdateOneWithoutUserNestedInput } from '../workspace-member/workspace-member-update-one-without-user-nested.input'; import { CompanyUpdateManyWithoutAccountOwnerNestedInput } from '../company/company-update-many-without-account-owner-nested.input'; import { CommentUpdateManyWithoutAuthorNestedInput } from '../comment/comment-update-many-without-author-nested.input'; +import { CommentThreadUpdateManyWithoutAuthorNestedInput } from '../comment-thread/comment-thread-update-many-without-author-nested.input'; @InputType() export class UserUpdateWithoutRefreshTokensInput { @@ -70,4 +71,7 @@ export class UserUpdateWithoutRefreshTokensInput { @Field(() => CommentUpdateManyWithoutAuthorNestedInput, {nullable:true}) comments?: CommentUpdateManyWithoutAuthorNestedInput; + + @Field(() => CommentThreadUpdateManyWithoutAuthorNestedInput, {nullable:true}) + CommentThread?: CommentThreadUpdateManyWithoutAuthorNestedInput; } diff --git a/server/src/core/@generated/user/user-update-without-workspace-member.input.ts b/server/src/core/@generated/user/user-update-without-workspace-member.input.ts index 6b24e0df758..f783f2c4319 100644 --- a/server/src/core/@generated/user/user-update-without-workspace-member.input.ts +++ b/server/src/core/@generated/user/user-update-without-workspace-member.input.ts @@ -11,6 +11,7 @@ import { DateTimeFieldUpdateOperationsInput } from '../prisma/date-time-field-up import { CompanyUpdateManyWithoutAccountOwnerNestedInput } from '../company/company-update-many-without-account-owner-nested.input'; import { RefreshTokenUpdateManyWithoutUserNestedInput } from '../refresh-token/refresh-token-update-many-without-user-nested.input'; import { CommentUpdateManyWithoutAuthorNestedInput } from '../comment/comment-update-many-without-author-nested.input'; +import { CommentThreadUpdateManyWithoutAuthorNestedInput } from '../comment-thread/comment-thread-update-many-without-author-nested.input'; @InputType() export class UserUpdateWithoutWorkspaceMemberInput { @@ -70,4 +71,7 @@ export class UserUpdateWithoutWorkspaceMemberInput { @Field(() => CommentUpdateManyWithoutAuthorNestedInput, {nullable:true}) comments?: CommentUpdateManyWithoutAuthorNestedInput; + + @Field(() => CommentThreadUpdateManyWithoutAuthorNestedInput, {nullable:true}) + CommentThread?: CommentThreadUpdateManyWithoutAuthorNestedInput; } diff --git a/server/src/core/@generated/user/user-update.input.ts b/server/src/core/@generated/user/user-update.input.ts index 8892a70e2d0..070650fc8df 100644 --- a/server/src/core/@generated/user/user-update.input.ts +++ b/server/src/core/@generated/user/user-update.input.ts @@ -12,6 +12,7 @@ import { WorkspaceMemberUpdateOneWithoutUserNestedInput } from '../workspace-mem import { CompanyUpdateManyWithoutAccountOwnerNestedInput } from '../company/company-update-many-without-account-owner-nested.input'; import { RefreshTokenUpdateManyWithoutUserNestedInput } from '../refresh-token/refresh-token-update-many-without-user-nested.input'; import { CommentUpdateManyWithoutAuthorNestedInput } from '../comment/comment-update-many-without-author-nested.input'; +import { CommentThreadUpdateManyWithoutAuthorNestedInput } from '../comment-thread/comment-thread-update-many-without-author-nested.input'; @InputType() export class UserUpdateInput { @@ -74,4 +75,7 @@ export class UserUpdateInput { @Field(() => CommentUpdateManyWithoutAuthorNestedInput, {nullable:true}) comments?: CommentUpdateManyWithoutAuthorNestedInput; + + @Field(() => CommentThreadUpdateManyWithoutAuthorNestedInput, {nullable:true}) + CommentThread?: CommentThreadUpdateManyWithoutAuthorNestedInput; } diff --git a/server/src/core/@generated/user/user-upsert-without-comment-thread.input.ts b/server/src/core/@generated/user/user-upsert-without-comment-thread.input.ts new file mode 100644 index 00000000000..5845fa9129f --- /dev/null +++ b/server/src/core/@generated/user/user-upsert-without-comment-thread.input.ts @@ -0,0 +1,17 @@ +import { Field } from '@nestjs/graphql'; +import { InputType } from '@nestjs/graphql'; +import { UserUpdateWithoutCommentThreadInput } from './user-update-without-comment-thread.input'; +import { Type } from 'class-transformer'; +import { UserCreateWithoutCommentThreadInput } from './user-create-without-comment-thread.input'; + +@InputType() +export class UserUpsertWithoutCommentThreadInput { + + @Field(() => UserUpdateWithoutCommentThreadInput, {nullable:false}) + @Type(() => UserUpdateWithoutCommentThreadInput) + update!: UserUpdateWithoutCommentThreadInput; + + @Field(() => UserCreateWithoutCommentThreadInput, {nullable:false}) + @Type(() => UserCreateWithoutCommentThreadInput) + create!: UserCreateWithoutCommentThreadInput; +} diff --git a/server/src/core/@generated/user/user-where.input.ts b/server/src/core/@generated/user/user-where.input.ts index 2e1cd9434d2..8d59b00abcc 100644 --- a/server/src/core/@generated/user/user-where.input.ts +++ b/server/src/core/@generated/user/user-where.input.ts @@ -11,6 +11,7 @@ import { WorkspaceMemberRelationFilter } from '../workspace-member/workspace-mem import { CompanyListRelationFilter } from '../company/company-list-relation-filter.input'; import { RefreshTokenListRelationFilter } from '../refresh-token/refresh-token-list-relation-filter.input'; import { CommentListRelationFilter } from '../comment/comment-list-relation-filter.input'; +import { CommentThreadListRelationFilter } from '../comment-thread/comment-thread-list-relation-filter.input'; @InputType() export class UserWhereInput { @@ -80,4 +81,7 @@ export class UserWhereInput { @Field(() => CommentListRelationFilter, {nullable:true}) comments?: CommentListRelationFilter; + + @Field(() => CommentThreadListRelationFilter, {nullable:true}) + CommentThread?: CommentThreadListRelationFilter; } diff --git a/server/src/core/@generated/user/user.model.ts b/server/src/core/@generated/user/user.model.ts index 0a053ce3f00..70b2bfcf70d 100644 --- a/server/src/core/@generated/user/user.model.ts +++ b/server/src/core/@generated/user/user.model.ts @@ -7,6 +7,7 @@ import { WorkspaceMember } from '../workspace-member/workspace-member.model'; import { Company } from '../company/company.model'; import { RefreshToken } from '../refresh-token/refresh-token.model'; import { Comment } from '../comment/comment.model'; +import { CommentThread } from '../comment-thread/comment-thread.model'; import { UserCount } from './user-count.output'; @ObjectType() @@ -69,6 +70,9 @@ export class User { @Field(() => [Comment], {nullable:true}) comments?: Array; + @Field(() => [CommentThread], {nullable:true}) + CommentThread?: Array; + @HideField() _count?: UserCount; } diff --git a/server/src/database/migrations/20230706072223_add_body_title_author_fields_to_comment_threads/migration.sql b/server/src/database/migrations/20230706072223_add_body_title_author_fields_to_comment_threads/migration.sql index 7d1dd8f8984..2e333f05eb6 100644 --- a/server/src/database/migrations/20230706072223_add_body_title_author_fields_to_comment_threads/migration.sql +++ b/server/src/database/migrations/20230706072223_add_body_title_author_fields_to_comment_threads/migration.sql @@ -1,4 +1,15 @@ -- AlterTable ALTER TABLE "comment_threads" ADD COLUMN "body" TEXT, ADD COLUMN "title" TEXT, -ADD COLUMN "authorId" TEXT; \ No newline at end of file +ADD COLUMN "authorId" TEXT; + + +-- Update field with a random user if some rows already exist... +UPDATE "comment_threads" +SET "authorId" = (SELECT id FROM users LIMIT 1); + + +ALTER TABLE "comment_threads" +ALTER COLUMN "authorId" SET NOT NULL; + +ALTER TABLE "comment_threads" ADD CONSTRAINT "comment_threads_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/server/src/database/schema.prisma b/server/src/database/schema.prisma index 4301cbc78a3..4c9e45375fa 100644 --- a/server/src/database/schema.prisma +++ b/server/src/database/schema.prisma @@ -173,8 +173,9 @@ model User { /// @TypeGraphQL.omit(input: true, output: true) deletedAt DateTime? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + CommentThread CommentThread[] @@map("users") } @@ -328,7 +329,8 @@ model CommentThread { /// @TypeGraphQL.omit(input: true, output: true) workspaceId String - authorId String? + authorId String + author User @relation(fields: [authorId], references: [id]) body String? title String? diff --git a/server/src/database/seeds/comments.ts b/server/src/database/seeds/comments.ts index 73ec7cf2926..a3464a3cf84 100644 --- a/server/src/database/seeds/comments.ts +++ b/server/src/database/seeds/comments.ts @@ -6,6 +6,9 @@ export const seedComments = async (prisma: PrismaClient) => { create: { id: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb400', workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419', + title: 'Performance update', + body: 'In the North American region, we have observed a strong growth rate of 18% in sales. Europe followed suit with a significant 14% increase, while Asia-Pacific sustained its performance with a steady 10% rise. Special kudos to the North American team for the excellent work done in penetrating new markets and establishing stronger footholds in the existing ones.', + authorId: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfa408', }, }); @@ -50,6 +53,9 @@ export const seedComments = async (prisma: PrismaClient) => { create: { id: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfc408', workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419', + title: 'Buyout Proposal', + body: 'We are considering the potential acquisition of [Company], a leading company in [Industry/Specific Technology]. This company has demonstrated remarkable success and pioneering advancements in their field, paralleling our own commitment to progress. By integrating their expertise with our own, we believe that we can amplify our growth, broaden our offerings, and fortify our position at the forefront of technology. This prospective partnership could help to ensure our continued leadership in the industry and allow us to deliver even more innovative solutions for our customers.', + authorId: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfa408', }, }); @@ -82,6 +88,9 @@ export const seedComments = async (prisma: PrismaClient) => { create: { id: 'twenty-dev-fe256b39-3ec3-4fe3-8997-b76aaabfb408', workspaceId: 'twenty-dev-7ed9d212-1c25-4d02-bf25-6aeccf7ea420', + title: 'Call summary', + body: 'Valuation & Due Diligence: The CFO highlighted the financial implications, pointing out that the acquisition will be accretive to earnings. The M&A team has been directed to commence due diligence and work closely with legal counsel to assess all aspects of the acquisition.', + authorId: 'twenty-dev-gk256b39-3ec3-4fe3-8997-b76aa0boa408', }, });