fix: add firstName and lastName to user model (#473)

* fix: add firstname and lastanme to user model

* fix: avoid undefined in displayName resolve field

* fix: user firstName and lastName instead of firstname lastname

* fix: person table proper naming firstName lastName

* fix: migrate front with firstName and lastName

* fix: make front-graphql-generate not working
This commit is contained in:
Jérémy M
2023-06-29 17:11:15 +02:00
committed by GitHub
parent d9af205ccb
commit 097b278b11
100 changed files with 606 additions and 329 deletions

View File

@ -56,7 +56,6 @@ export type Comment = {
commentThread: CommentThread;
commentThreadId: Scalars['String'];
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
id: Scalars['ID'];
updatedAt: Scalars['DateTime'];
};
@ -66,7 +65,6 @@ export type CommentCreateInput = {
body: Scalars['String'];
commentThread: CommentThreadCreateNestedOneWithoutCommentsInput;
createdAt?: InputMaybe<Scalars['DateTime']>;
deletedAt?: InputMaybe<Scalars['DateTime']>;
id?: InputMaybe<Scalars['String']>;
updatedAt?: InputMaybe<Scalars['DateTime']>;
};
@ -75,7 +73,6 @@ export type CommentCreateManyCommentThreadInput = {
authorId: Scalars['String'];
body: Scalars['String'];
createdAt?: InputMaybe<Scalars['DateTime']>;
deletedAt?: InputMaybe<Scalars['DateTime']>;
id?: InputMaybe<Scalars['String']>;
updatedAt?: InputMaybe<Scalars['DateTime']>;
};
@ -98,7 +95,6 @@ export type CommentCreateWithoutCommentThreadInput = {
author: UserCreateNestedOneWithoutCommentsInput;
body: Scalars['String'];
createdAt?: InputMaybe<Scalars['DateTime']>;
deletedAt?: InputMaybe<Scalars['DateTime']>;
id?: InputMaybe<Scalars['String']>;
updatedAt?: InputMaybe<Scalars['DateTime']>;
};
@ -121,7 +117,6 @@ export type CommentScalarWhereInput = {
body?: InputMaybe<StringFilter>;
commentThreadId?: InputMaybe<StringFilter>;
createdAt?: InputMaybe<DateTimeFilter>;
deletedAt?: InputMaybe<DateTimeNullableFilter>;
id?: InputMaybe<StringFilter>;
updatedAt?: InputMaybe<DateTimeFilter>;
};
@ -131,7 +126,6 @@ export type CommentThread = {
commentThreadTargets?: Maybe<Array<CommentThreadTarget>>;
comments?: Maybe<Array<Comment>>;
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
id: Scalars['ID'];
updatedAt: Scalars['DateTime'];
};
@ -140,7 +134,6 @@ export type CommentThreadCreateInput = {
commentThreadTargets?: InputMaybe<CommentThreadTargetCreateNestedManyWithoutCommentThreadInput>;
comments?: InputMaybe<CommentCreateNestedManyWithoutCommentThreadInput>;
createdAt?: InputMaybe<Scalars['DateTime']>;
deletedAt?: InputMaybe<Scalars['DateTime']>;
id?: InputMaybe<Scalars['String']>;
updatedAt?: InputMaybe<Scalars['DateTime']>;
};
@ -153,7 +146,6 @@ export type CommentThreadOrderByWithRelationInput = {
commentThreadTargets?: InputMaybe<CommentThreadTargetOrderByRelationAggregateInput>;
comments?: InputMaybe<CommentOrderByRelationAggregateInput>;
createdAt?: InputMaybe<SortOrder>;
deletedAt?: InputMaybe<SortOrder>;
id?: InputMaybe<SortOrder>;
updatedAt?: InputMaybe<SortOrder>;
};
@ -178,7 +170,6 @@ export type CommentThreadTarget = {
commentableId: Scalars['String'];
commentableType: CommentableType;
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
id: Scalars['ID'];
updatedAt: Scalars['DateTime'];
};
@ -187,7 +178,6 @@ export type CommentThreadTargetCreateManyCommentThreadInput = {
commentableId: Scalars['String'];
commentableType: CommentableType;
createdAt?: InputMaybe<Scalars['DateTime']>;
deletedAt?: InputMaybe<Scalars['DateTime']>;
id?: InputMaybe<Scalars['String']>;
updatedAt?: InputMaybe<Scalars['DateTime']>;
};
@ -210,7 +200,6 @@ export type CommentThreadTargetCreateWithoutCommentThreadInput = {
commentableId: Scalars['String'];
commentableType: CommentableType;
createdAt?: InputMaybe<Scalars['DateTime']>;
deletedAt?: InputMaybe<Scalars['DateTime']>;
id?: InputMaybe<Scalars['String']>;
updatedAt?: InputMaybe<Scalars['DateTime']>;
};
@ -233,7 +222,6 @@ export type CommentThreadTargetScalarWhereInput = {
commentableId?: InputMaybe<StringFilter>;
commentableType?: InputMaybe<EnumCommentableTypeFilter>;
createdAt?: InputMaybe<DateTimeFilter>;
deletedAt?: InputMaybe<DateTimeNullableFilter>;
id?: InputMaybe<StringFilter>;
updatedAt?: InputMaybe<DateTimeFilter>;
};
@ -242,7 +230,6 @@ export type CommentThreadTargetUpdateManyMutationInput = {
commentableId?: InputMaybe<StringFieldUpdateOperationsInput>;
commentableType?: InputMaybe<EnumCommentableTypeFieldUpdateOperationsInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
deletedAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>;
id?: InputMaybe<StringFieldUpdateOperationsInput>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
};
@ -275,7 +262,6 @@ export type CommentThreadTargetUpdateWithoutCommentThreadInput = {
commentableId?: InputMaybe<StringFieldUpdateOperationsInput>;
commentableType?: InputMaybe<EnumCommentableTypeFieldUpdateOperationsInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
deletedAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>;
id?: InputMaybe<StringFieldUpdateOperationsInput>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
};
@ -295,7 +281,6 @@ export type CommentThreadTargetWhereInput = {
commentableId?: InputMaybe<StringFilter>;
commentableType?: InputMaybe<EnumCommentableTypeFilter>;
createdAt?: InputMaybe<DateTimeFilter>;
deletedAt?: InputMaybe<DateTimeNullableFilter>;
id?: InputMaybe<StringFilter>;
updatedAt?: InputMaybe<DateTimeFilter>;
};
@ -308,7 +293,6 @@ export type CommentThreadUpdateInput = {
commentThreadTargets?: InputMaybe<CommentThreadTargetUpdateManyWithoutCommentThreadNestedInput>;
comments?: InputMaybe<CommentUpdateManyWithoutCommentThreadNestedInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
deletedAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>;
id?: InputMaybe<StringFieldUpdateOperationsInput>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
};
@ -320,7 +304,6 @@ export type CommentThreadWhereInput = {
commentThreadTargets?: InputMaybe<CommentThreadTargetListRelationFilter>;
comments?: InputMaybe<CommentListRelationFilter>;
createdAt?: InputMaybe<DateTimeFilter>;
deletedAt?: InputMaybe<DateTimeNullableFilter>;
id?: InputMaybe<StringFilter>;
updatedAt?: InputMaybe<DateTimeFilter>;
};
@ -332,7 +315,6 @@ export type CommentThreadWhereUniqueInput = {
export type CommentUpdateManyMutationInput = {
body?: InputMaybe<StringFieldUpdateOperationsInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
deletedAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>;
id?: InputMaybe<StringFieldUpdateOperationsInput>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
};
@ -365,7 +347,6 @@ export type CommentUpdateWithoutCommentThreadInput = {
author?: InputMaybe<UserUpdateOneRequiredWithoutCommentsNestedInput>;
body?: InputMaybe<StringFieldUpdateOperationsInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
deletedAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>;
id?: InputMaybe<StringFieldUpdateOperationsInput>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
};
@ -386,7 +367,6 @@ export type CommentWhereInput = {
commentThread?: InputMaybe<CommentThreadRelationFilter>;
commentThreadId?: InputMaybe<StringFilter>;
createdAt?: InputMaybe<DateTimeFilter>;
deletedAt?: InputMaybe<DateTimeNullableFilter>;
id?: InputMaybe<StringFilter>;
updatedAt?: InputMaybe<DateTimeFilter>;
};
@ -409,7 +389,6 @@ export type Company = {
commentThreads: Array<CommentThread>;
comments: Array<Comment>;
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
domainName: Scalars['String'];
employees?: Maybe<Scalars['Int']>;
id: Scalars['ID'];
@ -422,7 +401,6 @@ export type CompanyCreateInput = {
accountOwner?: InputMaybe<UserCreateNestedOneWithoutCompaniesInput>;
address: Scalars['String'];
createdAt?: InputMaybe<Scalars['DateTime']>;
deletedAt?: InputMaybe<Scalars['DateTime']>;
domainName: Scalars['String'];
employees?: InputMaybe<Scalars['Int']>;
id?: InputMaybe<Scalars['String']>;
@ -434,7 +412,6 @@ export type CompanyCreateInput = {
export type CompanyCreateManyAccountOwnerInput = {
address: Scalars['String'];
createdAt?: InputMaybe<Scalars['DateTime']>;
deletedAt?: InputMaybe<Scalars['DateTime']>;
domainName: Scalars['String'];
employees?: InputMaybe<Scalars['Int']>;
id?: InputMaybe<Scalars['String']>;
@ -466,7 +443,6 @@ export type CompanyCreateOrConnectWithoutAccountOwnerInput = {
export type CompanyCreateWithoutAccountOwnerInput = {
address: Scalars['String'];
createdAt?: InputMaybe<Scalars['DateTime']>;
deletedAt?: InputMaybe<Scalars['DateTime']>;
domainName: Scalars['String'];
employees?: InputMaybe<Scalars['Int']>;
id?: InputMaybe<Scalars['String']>;
@ -490,7 +466,6 @@ export type CompanyOrderByWithRelationInput = {
accountOwnerId?: InputMaybe<SortOrder>;
address?: InputMaybe<SortOrder>;
createdAt?: InputMaybe<SortOrder>;
deletedAt?: InputMaybe<SortOrder>;
domainName?: InputMaybe<SortOrder>;
employees?: InputMaybe<SortOrder>;
id?: InputMaybe<SortOrder>;
@ -524,7 +499,6 @@ export type CompanyScalarWhereInput = {
accountOwnerId?: InputMaybe<StringNullableFilter>;
address?: InputMaybe<StringFilter>;
createdAt?: InputMaybe<DateTimeFilter>;
deletedAt?: InputMaybe<DateTimeNullableFilter>;
domainName?: InputMaybe<StringFilter>;
employees?: InputMaybe<IntNullableFilter>;
id?: InputMaybe<StringFilter>;
@ -536,7 +510,6 @@ export type CompanyUpdateInput = {
accountOwner?: InputMaybe<UserUpdateOneWithoutCompaniesNestedInput>;
address?: InputMaybe<StringFieldUpdateOperationsInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
deletedAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>;
domainName?: InputMaybe<StringFieldUpdateOperationsInput>;
employees?: InputMaybe<NullableIntFieldUpdateOperationsInput>;
id?: InputMaybe<StringFieldUpdateOperationsInput>;
@ -548,7 +521,6 @@ export type CompanyUpdateInput = {
export type CompanyUpdateManyMutationInput = {
address?: InputMaybe<StringFieldUpdateOperationsInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
deletedAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>;
domainName?: InputMaybe<StringFieldUpdateOperationsInput>;
employees?: InputMaybe<NullableIntFieldUpdateOperationsInput>;
id?: InputMaybe<StringFieldUpdateOperationsInput>;
@ -587,7 +559,6 @@ export type CompanyUpdateWithWhereUniqueWithoutAccountOwnerInput = {
export type CompanyUpdateWithoutAccountOwnerInput = {
address?: InputMaybe<StringFieldUpdateOperationsInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
deletedAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>;
domainName?: InputMaybe<StringFieldUpdateOperationsInput>;
employees?: InputMaybe<NullableIntFieldUpdateOperationsInput>;
id?: InputMaybe<StringFieldUpdateOperationsInput>;
@ -610,7 +581,6 @@ export type CompanyWhereInput = {
accountOwnerId?: InputMaybe<StringNullableFilter>;
address?: InputMaybe<StringFilter>;
createdAt?: InputMaybe<DateTimeFilter>;
deletedAt?: InputMaybe<DateTimeNullableFilter>;
domainName?: InputMaybe<StringFilter>;
employees?: InputMaybe<IntNullableFilter>;
id?: InputMaybe<StringFilter>;
@ -913,11 +883,10 @@ export type Person = {
company?: Maybe<Company>;
companyId?: Maybe<Scalars['String']>;
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
email: Scalars['String'];
firstname: Scalars['String'];
firstName: Scalars['String'];
id: Scalars['ID'];
lastname: Scalars['String'];
lastName: Scalars['String'];
phone: Scalars['String'];
updatedAt: Scalars['DateTime'];
};
@ -926,11 +895,10 @@ export type PersonCreateInput = {
city: Scalars['String'];
company?: InputMaybe<CompanyCreateNestedOneWithoutPeopleInput>;
createdAt?: InputMaybe<Scalars['DateTime']>;
deletedAt?: InputMaybe<Scalars['DateTime']>;
email: Scalars['String'];
firstname: Scalars['String'];
firstName: Scalars['String'];
id?: InputMaybe<Scalars['String']>;
lastname: Scalars['String'];
lastName: Scalars['String'];
phone: Scalars['String'];
updatedAt?: InputMaybe<Scalars['DateTime']>;
};
@ -954,11 +922,10 @@ export type PersonOrderByWithRelationInput = {
company?: InputMaybe<CompanyOrderByWithRelationInput>;
companyId?: InputMaybe<SortOrder>;
createdAt?: InputMaybe<SortOrder>;
deletedAt?: InputMaybe<SortOrder>;
email?: InputMaybe<SortOrder>;
firstname?: InputMaybe<SortOrder>;
firstName?: InputMaybe<SortOrder>;
id?: InputMaybe<SortOrder>;
lastname?: InputMaybe<SortOrder>;
lastName?: InputMaybe<SortOrder>;
phone?: InputMaybe<SortOrder>;
updatedAt?: InputMaybe<SortOrder>;
};
@ -969,9 +936,9 @@ export enum PersonScalarFieldEnum {
CreatedAt = 'createdAt',
DeletedAt = 'deletedAt',
Email = 'email',
Firstname = 'firstname',
FirstName = 'firstName',
Id = 'id',
Lastname = 'lastname',
LastName = 'lastName',
Phone = 'phone',
UpdatedAt = 'updatedAt',
WorkspaceId = 'workspaceId'
@ -981,11 +948,10 @@ export type PersonUpdateInput = {
city?: InputMaybe<StringFieldUpdateOperationsInput>;
company?: InputMaybe<CompanyUpdateOneWithoutPeopleNestedInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
deletedAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>;
email?: InputMaybe<StringFieldUpdateOperationsInput>;
firstname?: InputMaybe<StringFieldUpdateOperationsInput>;
firstName?: InputMaybe<StringFieldUpdateOperationsInput>;
id?: InputMaybe<StringFieldUpdateOperationsInput>;
lastname?: InputMaybe<StringFieldUpdateOperationsInput>;
lastName?: InputMaybe<StringFieldUpdateOperationsInput>;
phone?: InputMaybe<StringFieldUpdateOperationsInput>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
};
@ -1002,11 +968,10 @@ export type PersonWhereInput = {
company?: InputMaybe<CompanyRelationFilter>;
companyId?: InputMaybe<StringNullableFilter>;
createdAt?: InputMaybe<DateTimeFilter>;
deletedAt?: InputMaybe<DateTimeNullableFilter>;
email?: InputMaybe<StringFilter>;
firstname?: InputMaybe<StringFilter>;
firstName?: InputMaybe<StringFilter>;
id?: InputMaybe<StringFilter>;
lastname?: InputMaybe<StringFilter>;
lastName?: InputMaybe<StringFilter>;
phone?: InputMaybe<StringFilter>;
updatedAt?: InputMaybe<DateTimeFilter>;
};
@ -1018,7 +983,6 @@ export type PersonWhereUniqueInput = {
export type Pipeline = {
__typename?: 'Pipeline';
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
icon: Scalars['String'];
id: Scalars['ID'];
name: Scalars['String'];
@ -1034,7 +998,6 @@ export type PipelineCreateNestedOneWithoutPipelineProgressesInput = {
export type PipelineOrderByWithRelationInput = {
createdAt?: InputMaybe<SortOrder>;
deletedAt?: InputMaybe<SortOrder>;
icon?: InputMaybe<SortOrder>;
id?: InputMaybe<SortOrder>;
name?: InputMaybe<SortOrder>;
@ -1047,7 +1010,6 @@ export type PipelineOrderByWithRelationInput = {
export type PipelineProgress = {
__typename?: 'PipelineProgress';
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
id: Scalars['ID'];
pipeline: Pipeline;
pipelineId: Scalars['String'];
@ -1060,7 +1022,6 @@ export type PipelineProgress = {
export type PipelineProgressCreateInput = {
createdAt?: InputMaybe<Scalars['DateTime']>;
deletedAt?: InputMaybe<Scalars['DateTime']>;
id?: InputMaybe<Scalars['String']>;
pipeline: PipelineCreateNestedOneWithoutPipelineProgressesInput;
pipelineStage: PipelineStageCreateNestedOneWithoutPipelineProgressesInput;
@ -1081,7 +1042,6 @@ export type PipelineProgressOrderByRelationAggregateInput = {
export type PipelineProgressOrderByWithRelationInput = {
createdAt?: InputMaybe<SortOrder>;
deletedAt?: InputMaybe<SortOrder>;
id?: InputMaybe<SortOrder>;
pipeline?: InputMaybe<PipelineOrderByWithRelationInput>;
pipelineId?: InputMaybe<SortOrder>;
@ -1106,7 +1066,6 @@ export enum PipelineProgressScalarFieldEnum {
export type PipelineProgressUpdateInput = {
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
deletedAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>;
id?: InputMaybe<StringFieldUpdateOperationsInput>;
pipeline?: InputMaybe<PipelineUpdateOneRequiredWithoutPipelineProgressesNestedInput>;
pipelineStage?: InputMaybe<PipelineStageUpdateOneRequiredWithoutPipelineProgressesNestedInput>;
@ -1120,7 +1079,6 @@ export type PipelineProgressWhereInput = {
NOT?: InputMaybe<Array<PipelineProgressWhereInput>>;
OR?: InputMaybe<Array<PipelineProgressWhereInput>>;
createdAt?: InputMaybe<DateTimeFilter>;
deletedAt?: InputMaybe<DateTimeNullableFilter>;
id?: InputMaybe<StringFilter>;
pipeline?: InputMaybe<PipelineRelationFilter>;
pipelineId?: InputMaybe<StringFilter>;
@ -1160,7 +1118,6 @@ export type PipelineStage = {
__typename?: 'PipelineStage';
color: Scalars['String'];
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
id: Scalars['ID'];
name: Scalars['String'];
pipeline: Pipeline;
@ -1187,7 +1144,6 @@ export type PipelineStageOrderByRelationAggregateInput = {
export type PipelineStageOrderByWithRelationInput = {
color?: InputMaybe<SortOrder>;
createdAt?: InputMaybe<SortOrder>;
deletedAt?: InputMaybe<SortOrder>;
id?: InputMaybe<SortOrder>;
name?: InputMaybe<SortOrder>;
pipeline?: InputMaybe<PipelineOrderByWithRelationInput>;
@ -1224,7 +1180,6 @@ export type PipelineStageWhereInput = {
OR?: InputMaybe<Array<PipelineStageWhereInput>>;
color?: InputMaybe<StringFilter>;
createdAt?: InputMaybe<DateTimeFilter>;
deletedAt?: InputMaybe<DateTimeNullableFilter>;
id?: InputMaybe<StringFilter>;
name?: InputMaybe<StringFilter>;
pipeline?: InputMaybe<PipelineRelationFilter>;
@ -1247,7 +1202,6 @@ export type PipelineWhereInput = {
NOT?: InputMaybe<Array<PipelineWhereInput>>;
OR?: InputMaybe<Array<PipelineWhereInput>>;
createdAt?: InputMaybe<DateTimeFilter>;
deletedAt?: InputMaybe<DateTimeNullableFilter>;
icon?: InputMaybe<StringFilter>;
id?: InputMaybe<StringFilter>;
name?: InputMaybe<StringFilter>;
@ -1392,12 +1346,13 @@ export type User = {
comments?: Maybe<Array<Comment>>;
companies?: Maybe<Array<Company>>;
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
disabled: Scalars['Boolean'];
displayName: Scalars['String'];
email: Scalars['String'];
emailVerified: Scalars['Boolean'];
firstName: Scalars['String'];
id: Scalars['ID'];
lastName: Scalars['String'];
lastSeen?: Maybe<Scalars['DateTime']>;
locale: Scalars['String'];
metadata?: Maybe<Scalars['JSON']>;
@ -1423,12 +1378,13 @@ export type UserCreateWithoutCommentsInput = {
avatarUrl?: InputMaybe<Scalars['String']>;
companies?: InputMaybe<CompanyCreateNestedManyWithoutAccountOwnerInput>;
createdAt?: InputMaybe<Scalars['DateTime']>;
deletedAt?: InputMaybe<Scalars['DateTime']>;
disabled?: InputMaybe<Scalars['Boolean']>;
displayName: Scalars['String'];
displayName?: InputMaybe<Scalars['String']>;
email: Scalars['String'];
emailVerified?: InputMaybe<Scalars['Boolean']>;
firstName: Scalars['String'];
id?: InputMaybe<Scalars['String']>;
lastName: Scalars['String'];
lastSeen?: InputMaybe<Scalars['DateTime']>;
locale: Scalars['String'];
metadata?: InputMaybe<Scalars['JSON']>;
@ -1441,12 +1397,13 @@ export type UserOrderByWithRelationInput = {
comments?: InputMaybe<CommentOrderByRelationAggregateInput>;
companies?: InputMaybe<CompanyOrderByRelationAggregateInput>;
createdAt?: InputMaybe<SortOrder>;
deletedAt?: InputMaybe<SortOrder>;
disabled?: InputMaybe<SortOrder>;
displayName?: InputMaybe<SortOrder>;
email?: InputMaybe<SortOrder>;
emailVerified?: InputMaybe<SortOrder>;
firstName?: InputMaybe<SortOrder>;
id?: InputMaybe<SortOrder>;
lastName?: InputMaybe<SortOrder>;
lastSeen?: InputMaybe<SortOrder>;
locale?: InputMaybe<SortOrder>;
metadata?: InputMaybe<SortOrder>;
@ -1467,7 +1424,9 @@ export enum UserScalarFieldEnum {
DisplayName = 'displayName',
Email = 'email',
EmailVerified = 'emailVerified',
FirstName = 'firstName',
Id = 'id',
LastName = 'lastName',
LastSeen = 'lastSeen',
Locale = 'locale',
Metadata = 'metadata',
@ -1492,12 +1451,13 @@ export type UserUpdateWithoutCommentsInput = {
avatarUrl?: InputMaybe<NullableStringFieldUpdateOperationsInput>;
companies?: InputMaybe<CompanyUpdateManyWithoutAccountOwnerNestedInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>;
deletedAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>;
disabled?: InputMaybe<BoolFieldUpdateOperationsInput>;
displayName?: InputMaybe<StringFieldUpdateOperationsInput>;
displayName?: InputMaybe<NullableStringFieldUpdateOperationsInput>;
email?: InputMaybe<StringFieldUpdateOperationsInput>;
emailVerified?: InputMaybe<BoolFieldUpdateOperationsInput>;
firstName?: InputMaybe<StringFieldUpdateOperationsInput>;
id?: InputMaybe<StringFieldUpdateOperationsInput>;
lastName?: InputMaybe<StringFieldUpdateOperationsInput>;
lastSeen?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>;
locale?: InputMaybe<StringFieldUpdateOperationsInput>;
metadata?: InputMaybe<Scalars['JSON']>;
@ -1518,12 +1478,13 @@ export type UserWhereInput = {
comments?: InputMaybe<CommentListRelationFilter>;
companies?: InputMaybe<CompanyListRelationFilter>;
createdAt?: InputMaybe<DateTimeFilter>;
deletedAt?: InputMaybe<DateTimeNullableFilter>;
disabled?: InputMaybe<BoolFilter>;
displayName?: InputMaybe<StringFilter>;
displayName?: InputMaybe<StringNullableFilter>;
email?: InputMaybe<StringFilter>;
emailVerified?: InputMaybe<BoolFilter>;
firstName?: InputMaybe<StringFilter>;
id?: InputMaybe<StringFilter>;
lastName?: InputMaybe<StringFilter>;
lastSeen?: InputMaybe<DateTimeNullableFilter>;
locale?: InputMaybe<StringFilter>;
metadata?: InputMaybe<JsonNullableFilter>;
@ -1548,7 +1509,6 @@ export type Workspace = {
comments?: Maybe<Array<Comment>>;
companies?: Maybe<Array<Company>>;
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
displayName: Scalars['String'];
domainName: Scalars['String'];
id: Scalars['ID'];
@ -1564,7 +1524,6 @@ export type Workspace = {
export type WorkspaceMember = {
__typename?: 'WorkspaceMember';
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
id: Scalars['ID'];
updatedAt: Scalars['DateTime'];
user: User;
@ -1731,12 +1690,12 @@ export type GetPeopleQueryVariables = Exact<{
}>;
export type GetPeopleQuery = { __typename?: 'Query', people: Array<{ __typename?: 'Person', id: string, phone: string, email: string, city: string, firstname: string, lastname: string, createdAt: string, _commentCount: number, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null }> };
export type GetPeopleQuery = { __typename?: 'Query', people: Array<{ __typename?: 'Person', id: string, phone: string, email: string, city: string, firstName: string, lastName: string, createdAt: string, _commentCount: number, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null }> };
export type UpdatePeopleMutationVariables = Exact<{
id?: InputMaybe<Scalars['String']>;
firstname?: InputMaybe<Scalars['String']>;
lastname?: InputMaybe<Scalars['String']>;
firstName?: InputMaybe<Scalars['String']>;
lastName?: InputMaybe<Scalars['String']>;
phone?: InputMaybe<Scalars['String']>;
city?: InputMaybe<Scalars['String']>;
companyId?: InputMaybe<Scalars['String']>;
@ -1745,12 +1704,12 @@ export type UpdatePeopleMutationVariables = Exact<{
}>;
export type UpdatePeopleMutation = { __typename?: 'Mutation', updateOnePerson?: { __typename?: 'Person', city: string, email: string, firstname: string, id: string, lastname: string, phone: string, createdAt: string, company?: { __typename?: 'Company', domainName: string, name: string, id: string } | null } | null };
export type UpdatePeopleMutation = { __typename?: 'Mutation', updateOnePerson?: { __typename?: 'Person', id: string, city: string, email: string, firstName: string, lastName: string, phone: string, createdAt: string, company?: { __typename?: 'Company', domainName: string, name: string, id: string } | null } | null };
export type InsertPersonMutationVariables = Exact<{
id: Scalars['String'];
firstname: Scalars['String'];
lastname: Scalars['String'];
firstName: Scalars['String'];
lastName: Scalars['String'];
phone: Scalars['String'];
city: Scalars['String'];
email: Scalars['String'];
@ -1758,7 +1717,7 @@ export type InsertPersonMutationVariables = Exact<{
}>;
export type InsertPersonMutation = { __typename?: 'Mutation', createOnePerson: { __typename?: 'Person', city: string, email: string, firstname: string, id: string, lastname: string, phone: string, createdAt: string, company?: { __typename?: 'Company', domainName: string, name: string, id: string } | null } };
export type InsertPersonMutation = { __typename?: 'Mutation', createOnePerson: { __typename?: 'Person', id: string, city: string, email: string, firstName: string, lastName: string, phone: string, createdAt: string, company?: { __typename?: 'Company', domainName: string, name: string, id: string } | null } };
export type DeletePeopleMutationVariables = Exact<{
ids?: InputMaybe<Array<Scalars['String']> | Scalars['String']>;
@ -1774,7 +1733,7 @@ export type SearchPeopleQueryVariables = Exact<{
}>;
export type SearchPeopleQuery = { __typename?: 'Query', searchResults: Array<{ __typename?: 'Person', id: string, phone: string, email: string, city: string, firstname: string, lastname: string, createdAt: string }> };
export type SearchPeopleQuery = { __typename?: 'Query', searchResults: Array<{ __typename?: 'Person', id: string, phone: string, email: string, city: string, firstName: string, lastName: string, createdAt: string }> };
export type SearchUserQueryVariables = Exact<{
where?: InputMaybe<UserWhereInput>;
@ -2593,8 +2552,8 @@ export const GetPeopleDocument = gql`
phone
email
city
firstname
lastname
firstName
lastName
createdAt
_commentCount
company {
@ -2636,11 +2595,12 @@ export type GetPeopleQueryHookResult = ReturnType<typeof useGetPeopleQuery>;
export type GetPeopleLazyQueryHookResult = ReturnType<typeof useGetPeopleLazyQuery>;
export type GetPeopleQueryResult = Apollo.QueryResult<GetPeopleQuery, GetPeopleQueryVariables>;
export const UpdatePeopleDocument = gql`
mutation UpdatePeople($id: String, $firstname: String, $lastname: String, $phone: String, $city: String, $companyId: String, $email: String, $createdAt: DateTime) {
mutation UpdatePeople($id: String, $firstName: String, $lastName: String, $phone: String, $city: String, $companyId: String, $email: String, $createdAt: DateTime) {
updateOnePerson(
where: {id: $id}
data: {city: {set: $city}, company: {connect: {id: $companyId}}, email: {set: $email}, firstname: {set: $firstname}, id: {set: $id}, lastname: {set: $lastname}, phone: {set: $phone}, createdAt: {set: $createdAt}}
data: {city: {set: $city}, company: {connect: {id: $companyId}}, email: {set: $email}, firstName: {set: $firstName}, id: {set: $id}, lastName: {set: $lastName}, phone: {set: $phone}, createdAt: {set: $createdAt}}
) {
id
city
company {
domainName
@ -2648,9 +2608,8 @@ export const UpdatePeopleDocument = gql`
id
}
email
firstname
id
lastname
firstName
lastName
phone
createdAt
}
@ -2672,8 +2631,8 @@ export type UpdatePeopleMutationFn = Apollo.MutationFunction<UpdatePeopleMutatio
* const [updatePeopleMutation, { data, loading, error }] = useUpdatePeopleMutation({
* variables: {
* id: // value for 'id'
* firstname: // value for 'firstname'
* lastname: // value for 'lastname'
* firstName: // value for 'firstName'
* lastName: // value for 'lastName'
* phone: // value for 'phone'
* city: // value for 'city'
* companyId: // value for 'companyId'
@ -2690,10 +2649,11 @@ export type UpdatePeopleMutationHookResult = ReturnType<typeof useUpdatePeopleMu
export type UpdatePeopleMutationResult = Apollo.MutationResult<UpdatePeopleMutation>;
export type UpdatePeopleMutationOptions = Apollo.BaseMutationOptions<UpdatePeopleMutation, UpdatePeopleMutationVariables>;
export const InsertPersonDocument = gql`
mutation InsertPerson($id: String!, $firstname: String!, $lastname: String!, $phone: String!, $city: String!, $email: String!, $createdAt: DateTime) {
mutation InsertPerson($id: String!, $firstName: String!, $lastName: String!, $phone: String!, $city: String!, $email: String!, $createdAt: DateTime) {
createOnePerson(
data: {id: $id, firstname: $firstname, lastname: $lastname, phone: $phone, city: $city, email: $email, createdAt: $createdAt}
data: {id: $id, firstName: $firstName, lastName: $lastName, phone: $phone, city: $city, email: $email, createdAt: $createdAt}
) {
id
city
company {
domainName
@ -2701,9 +2661,8 @@ export const InsertPersonDocument = gql`
id
}
email
firstname
id
lastname
firstName
lastName
phone
createdAt
}
@ -2725,8 +2684,8 @@ export type InsertPersonMutationFn = Apollo.MutationFunction<InsertPersonMutatio
* const [insertPersonMutation, { data, loading, error }] = useInsertPersonMutation({
* variables: {
* id: // value for 'id'
* firstname: // value for 'firstname'
* lastname: // value for 'lastname'
* firstName: // value for 'firstName'
* lastName: // value for 'lastName'
* phone: // value for 'phone'
* city: // value for 'city'
* email: // value for 'email'
@ -2781,8 +2740,8 @@ export const SearchPeopleDocument = gql`
phone
email
city
firstname
lastname
firstName
lastName
createdAt
}
}

View File

@ -109,14 +109,14 @@ export function CommentThreadRelationPicker({ commentThread }: OwnProps) {
const personsForMultiSelect = useFilteredSearchEntityQuery({
queryHook: useSearchPeopleQuery,
searchOnFields: ['firstname', 'lastname'],
orderByField: 'lastname',
searchOnFields: ['firstName', 'lastName'],
orderByField: 'lastName',
selectedIds: peopleIds,
mappingFunction: (entity) =>
({
id: entity.id,
entityType: CommentableType.Person,
name: `${entity.firstname} ${entity.lastname}`,
name: `${entity.firstName} ${entity.lastName}`,
avatarType: 'rounded',
} as CommentableEntityForSelect),
searchFilter,

View File

@ -9,8 +9,8 @@ import { CommentableType, Person } from '~/generated/graphql';
import { PersonChip } from './PersonChip';
type OwnProps = {
person: Pick<Person, 'id' | 'firstname' | 'lastname' | '_commentCount'>;
onChange: (firstname: string, lastname: string) => void;
person: Pick<Person, 'id' | 'firstName' | 'lastName' | '_commentCount'>;
onChange: (firstName: string, lastName: string) => void;
};
const NoEditModeContainer = styled.div`
@ -25,16 +25,16 @@ const RightContainer = styled.div`
`;
export function EditablePeopleFullName({ person, onChange }: OwnProps) {
const [firstnameValue, setFirstnameValue] = useState(person.firstname ?? '');
const [lastnameValue, setLastnameValue] = useState(person.lastname ?? '');
const [firstNameValue, setFirstNameValue] = useState(person.firstName ?? '');
const [lastNameValue, setLastNameValue] = useState(person.lastName ?? '');
const openCommentRightDrawer = useOpenCommentRightDrawer();
function handleDoubleTextChange(
firstValue: string,
secondValue: string,
): void {
setFirstnameValue(firstValue);
setLastnameValue(secondValue);
setFirstNameValue(firstValue);
setLastNameValue(secondValue);
onChange(firstValue, secondValue);
}
@ -53,14 +53,14 @@ export function EditablePeopleFullName({ person, onChange }: OwnProps) {
return (
<EditableDoubleText
firstValue={firstnameValue}
secondValue={lastnameValue}
firstValue={firstNameValue}
secondValue={lastNameValue}
firstValuePlaceholder="First name"
secondValuePlaceholder="Last name"
onChange={handleDoubleTextChange}
nonEditModeContent={
<NoEditModeContainer>
<PersonChip name={person.firstname + ' ' + person.lastname} />
<PersonChip name={person.firstName + ' ' + person.lastName} />
<RightContainer>
<CellCommentChip
count={person._commentCount ?? 0}

View File

@ -6,19 +6,19 @@ describe('reduceSortsToOrderBy', () => {
it('should return an array of objects with the id as key and the order as value', () => {
const sorts = [
{
key: 'firstname',
label: 'firstname',
key: 'firstName',
label: 'firstName',
order: 'asc',
_type: 'default_sort',
},
{
key: 'lastname',
label: 'lastname',
key: 'lastName',
label: 'lastName',
order: 'desc',
_type: 'default_sort',
},
] satisfies PeopleSelectedSortType[];
const result = reduceSortsToOrderBy(sorts);
expect(result).toEqual([{ firstname: 'asc' }, { lastname: 'desc' }]);
expect(result).toEqual([{ firstName: 'asc' }, { lastName: 'desc' }]);
});
});

View File

@ -21,8 +21,8 @@ export const GET_PEOPLE = gql`
phone
email
city
firstname
lastname
firstName
lastName
createdAt
_commentCount
company {

View File

@ -3,8 +3,8 @@ import { gql } from '@apollo/client';
export const UPDATE_PERSON = gql`
mutation UpdatePeople(
$id: String
$firstname: String
$lastname: String
$firstName: String
$lastName: String
$phone: String
$city: String
$companyId: String
@ -17,13 +17,14 @@ export const UPDATE_PERSON = gql`
city: { set: $city }
company: { connect: { id: $companyId } }
email: { set: $email }
firstname: { set: $firstname }
firstName: { set: $firstName }
id: { set: $id }
lastname: { set: $lastname }
lastName: { set: $lastName }
phone: { set: $phone }
createdAt: { set: $createdAt }
}
) {
id
city
company {
domainName
@ -31,9 +32,8 @@ export const UPDATE_PERSON = gql`
id
}
email
firstname
id
lastname
firstName
lastName
phone
createdAt
}
@ -43,8 +43,8 @@ export const UPDATE_PERSON = gql`
export const INSERT_PERSON = gql`
mutation InsertPerson(
$id: String!
$firstname: String!
$lastname: String!
$firstName: String!
$lastName: String!
$phone: String!
$city: String!
$email: String!
@ -53,14 +53,15 @@ export const INSERT_PERSON = gql`
createOnePerson(
data: {
id: $id
firstname: $firstname
lastname: $lastname
firstName: $firstName
lastName: $lastName
phone: $phone
city: $city
email: $email
createdAt: $createdAt
}
) {
id
city
company {
domainName
@ -68,9 +69,8 @@ export const INSERT_PERSON = gql`
id
}
email
firstname
id
lastname
firstName
lastName
phone
createdAt
}

View File

@ -20,8 +20,8 @@ export const SEARCH_PEOPLE_QUERY = gql`
phone
email
city
firstname
lastname
firstName
lastName
createdAt
}
}

View File

@ -63,8 +63,8 @@ export function People() {
await insertPersonMutation({
variables: {
id: uuidv4(),
firstname: '',
lastname: '',
firstName: '',
lastName: '',
email: '',
phone: '',
createdAt: new Date().toISOString(),

View File

@ -26,7 +26,7 @@ export const usePeopleColumns = () => {
return useMemo(() => {
return [
getCheckBoxColumn(),
columnHelper.accessor('firstname', {
columnHelper.accessor('firstName', {
header: () => (
<ColumnHead viewName="People" viewIcon={<IconUser size={16} />} />
),
@ -39,8 +39,8 @@ export const usePeopleColumns = () => {
await updatePerson({
variables: {
...person,
firstname: firstName,
lastname: lastName,
firstName,
lastName,
companyId: person.company?.id,
},
});

View File

@ -23,13 +23,13 @@ export const fullnameFilter = {
whereTemplate: (searchString: string) => ({
OR: [
{
firstname: {
firstName: {
contains: `%${searchString}%`,
mode: QueryMode.Insensitive,
},
},
{
lastname: {
lastName: {
contains: `%${searchString}%`,
mode: QueryMode.Insensitive,
},
@ -45,13 +45,13 @@ export const fullnameFilter = {
{
AND: [
{
firstname: {
firstName: {
contains: `%${searchString}%`,
mode: QueryMode.Insensitive,
},
},
{
lastname: {
lastName: {
contains: `%${searchString}%`,
mode: QueryMode.Insensitive,
},

View File

@ -20,10 +20,10 @@ export const availableSorts = [
_type: 'custom_sort',
orderByTemplates: [
(order: Order_By) => ({
firstname: order,
firstName: order,
}),
(order: Order_By) => ({
lastname: order,
lastName: order,
}),
],
},

View File

@ -12,8 +12,8 @@ function filterData<DataT>(
where: Record<string, any>,
): Array<DataT> {
return data.filter((item) => {
// { firstname: {contains: '%string%' }}
// { firstname: {equals: 'string' }}
// { firstName: {contains: '%string%' }}
// { lastName: {equals: 'string' }}
// { is: { company: { equals: 'string' }}}
let isMatch: boolean = (
Object.keys(where) as Array<keyof typeof where>
@ -57,7 +57,7 @@ function filterData<DataT>(
return false;
});
// { OR: [{ firstname: filter }, { lastname: filter }]
// { OR: [{ firstName: filter }, { lastName: filter }]
if (where.OR && Array.isArray(where.OR)) {
isMatch =
isMatch ||

View File

@ -3,8 +3,8 @@ import { Company, Person } from '~/generated/graphql';
type MockedPerson = Pick<
Person,
| 'id'
| 'firstname'
| 'lastname'
| 'firstName'
| 'lastName'
| 'email'
| '__typename'
| 'phone'
@ -19,8 +19,8 @@ export const mockedPeopleData: Array<MockedPerson> = [
{
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
__typename: 'Person',
firstname: 'Alexandre',
lastname: 'Prot',
firstName: 'Alexandre',
lastName: 'Prot',
email: 'alexandre@qonto.com',
company: {
id: '5c21e19e-e049-4393-8c09-3e3f8fb09ecb',
@ -37,8 +37,8 @@ export const mockedPeopleData: Array<MockedPerson> = [
{
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6d',
__typename: 'Person',
firstname: 'John',
lastname: 'Doe',
firstName: 'John',
lastName: 'Doe',
email: 'john@linkedin.com',
company: {
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6e',
@ -55,8 +55,8 @@ export const mockedPeopleData: Array<MockedPerson> = [
{
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6f',
__typename: 'Person',
firstname: 'Jane',
lastname: 'Doe',
firstName: 'Jane',
lastName: 'Doe',
email: 'jane@sequoiacap.com',
company: {
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6g',
@ -73,8 +73,8 @@ export const mockedPeopleData: Array<MockedPerson> = [
{
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6h',
__typename: 'Person',
firstname: 'Janice',
lastname: 'Dane',
firstName: 'Janice',
lastName: 'Dane',
email: 'janice@facebook.com',
company: {
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6i',