Fix ID type being used in place of UUID in graphql and metadata queries (#4905)
We have recently discovered that we were using ID type in place of UUID type in many place in the code. We have merged #4895 but this introduced bugs as we forgot to replace it everywhere
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Field, ID, ObjectType } from '@nestjs/graphql';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import {
|
||||
Entity,
|
||||
@ -14,6 +14,7 @@ import { BeforeCreateOne, IDField } from '@ptc-org/nestjs-query-graphql';
|
||||
import { BeforeCreateOneAppToken } from 'src/engine/core-modules/app-token/hooks/before-create-one-app-token.hook';
|
||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
export enum AppTokenType {
|
||||
RefreshToken = 'REFRESH_TOKEN',
|
||||
CodeChallenge = 'CODE_CHALLENGE',
|
||||
@ -24,7 +25,7 @@ export enum AppTokenType {
|
||||
@ObjectType('AppToken')
|
||||
@BeforeCreateOne(BeforeCreateOneAppToken)
|
||||
export class AppToken {
|
||||
@IDField(() => ID)
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Field, ID, ObjectType } from '@nestjs/graphql';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import {
|
||||
Column,
|
||||
@ -15,11 +15,12 @@ import { IDField } from '@ptc-org/nestjs-query-graphql';
|
||||
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { BillingSubscriptionItem } from 'src/engine/core-modules/billing/entities/billing-subscription-item.entity';
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@Entity({ name: 'billingSubscription', schema: 'core' })
|
||||
@ObjectType('BillingSubscription')
|
||||
export class BillingSubscription {
|
||||
@IDField(() => ID)
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
import { ObjectType, Field, ID } from '@nestjs/graphql';
|
||||
import { ObjectType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType('TimelineCalendarEventParticipant')
|
||||
export class TimelineCalendarEventParticipant {
|
||||
@Field(() => ID, { nullable: true })
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
personId: string;
|
||||
|
||||
@Field(() => ID, { nullable: true })
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
workspaceMemberId: string;
|
||||
|
||||
@Field()
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { ObjectType, ID, Field, registerEnumType } from '@nestjs/graphql';
|
||||
import { ObjectType, Field, registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { TimelineCalendarEventParticipant } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event-participant.dto';
|
||||
|
||||
export enum TimelineCalendarEventVisibility {
|
||||
@ -23,7 +24,7 @@ export class LinkMetadata {
|
||||
|
||||
@ObjectType('TimelineCalendarEvent')
|
||||
export class TimelineCalendarEvent {
|
||||
@Field(() => ID)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field()
|
||||
|
||||
@ -1,13 +1,5 @@
|
||||
import { UseGuards } from '@nestjs/common';
|
||||
import {
|
||||
Query,
|
||||
Args,
|
||||
ArgsType,
|
||||
Field,
|
||||
ID,
|
||||
Int,
|
||||
Resolver,
|
||||
} from '@nestjs/graphql';
|
||||
import { Query, Args, ArgsType, Field, Int, Resolver } from '@nestjs/graphql';
|
||||
|
||||
import { Max } from 'class-validator';
|
||||
|
||||
@ -21,10 +13,11 @@ import { TimelineCalendarEventService } from 'src/engine/core-modules/calendar/t
|
||||
import { UserService } from 'src/engine/core-modules/user/services/user.service';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { NotFoundError } from 'src/engine/utils/graphql-errors.util';
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ArgsType()
|
||||
class GetTimelineCalendarEventsFromPersonIdArgs {
|
||||
@Field(() => ID)
|
||||
@Field(() => UUIDScalarType)
|
||||
personId: string;
|
||||
|
||||
@Field(() => Int)
|
||||
@ -37,7 +30,7 @@ class GetTimelineCalendarEventsFromPersonIdArgs {
|
||||
|
||||
@ArgsType()
|
||||
class GetTimelineCalendarEventsFromCompanyIdArgs {
|
||||
@Field(() => ID)
|
||||
@Field(() => UUIDScalarType)
|
||||
companyId: string;
|
||||
|
||||
@Field(() => Int)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Field, ID, ObjectType } from '@nestjs/graphql';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import {
|
||||
Entity,
|
||||
@ -12,6 +12,7 @@ import {
|
||||
import { IDField } from '@ptc-org/nestjs-query-graphql';
|
||||
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
export enum FeatureFlagKeys {
|
||||
IsBlocklistEnabled = 'IS_BLOCKLIST_ENABLED',
|
||||
@ -26,7 +27,7 @@ export enum FeatureFlagKeys {
|
||||
@ObjectType('FeatureFlag')
|
||||
@Unique('IndexOnKeyAndWorkspaceIdUnique', ['key', 'workspaceId'])
|
||||
export class FeatureFlagEntity {
|
||||
@IDField(() => ID)
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
import { ObjectType, Field, ID } from '@nestjs/graphql';
|
||||
import { ObjectType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType('TimelineThreadParticipant')
|
||||
export class TimelineThreadParticipant {
|
||||
@Field(() => ID, { nullable: true })
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
personId: string;
|
||||
|
||||
@Field(() => ID, { nullable: true })
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
workspaceMemberId: string;
|
||||
|
||||
@Field()
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
import { ObjectType, Field, ID } from '@nestjs/graphql';
|
||||
import { ObjectType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { TimelineThreadParticipant } from 'src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto';
|
||||
|
||||
@ObjectType('TimelineThread')
|
||||
export class TimelineThread {
|
||||
@Field(() => ID)
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field()
|
||||
|
||||
@ -1,12 +1,4 @@
|
||||
import {
|
||||
Args,
|
||||
Query,
|
||||
Resolver,
|
||||
Int,
|
||||
ArgsType,
|
||||
Field,
|
||||
ID,
|
||||
} from '@nestjs/graphql';
|
||||
import { Args, Query, Resolver, Int, ArgsType, Field } from '@nestjs/graphql';
|
||||
import { UseGuards } from '@nestjs/common';
|
||||
|
||||
import { Max } from 'class-validator';
|
||||
@ -20,10 +12,11 @@ import { TimelineThreadsWithTotal } from 'src/engine/core-modules/messaging/dtos
|
||||
import { AuthUser } from 'src/engine/decorators/auth/auth-user.decorator';
|
||||
import { UserService } from 'src/engine/core-modules/user/services/user.service';
|
||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ArgsType()
|
||||
class GetTimelineThreadsFromPersonIdArgs {
|
||||
@Field(() => ID)
|
||||
@Field(() => UUIDScalarType)
|
||||
personId: string;
|
||||
|
||||
@Field(() => Int)
|
||||
@ -36,7 +29,7 @@ class GetTimelineThreadsFromPersonIdArgs {
|
||||
|
||||
@ArgsType()
|
||||
class GetTimelineThreadsFromCompanyIdArgs {
|
||||
@Field(() => ID)
|
||||
@Field(() => UUIDScalarType)
|
||||
companyId: string;
|
||||
|
||||
@Field(() => Int)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Field, ID, ObjectType } from '@nestjs/graphql';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { IDField } from '@ptc-org/nestjs-query-graphql';
|
||||
import {
|
||||
@ -14,12 +14,13 @@ import {
|
||||
|
||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@Entity({ name: 'userWorkspace', schema: 'core' })
|
||||
@ObjectType('UserWorkspace')
|
||||
@Unique('IndexOnUserIdAndWorkspaceIdUnique', ['userId', 'workspaceId'])
|
||||
export class UserWorkspace {
|
||||
@IDField(() => ID)
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ID, Field, ObjectType } from '@nestjs/graphql';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import {
|
||||
Entity,
|
||||
@ -15,11 +15,12 @@ import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { WorkspaceMember } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
|
||||
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@Entity({ name: 'user', schema: 'core' })
|
||||
@ObjectType('User')
|
||||
export class User {
|
||||
@IDField(() => ID)
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Field, ID, ObjectType } from '@nestjs/graphql';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { IDField, UnPagedRelation } from '@ptc-org/nestjs-query-graphql';
|
||||
import {
|
||||
@ -16,6 +16,7 @@ import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-
|
||||
import { BillingSubscription } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';
|
||||
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
|
||||
import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity';
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@Entity({ name: 'workspace', schema: 'core' })
|
||||
@ObjectType('Workspace')
|
||||
@ -24,7 +25,7 @@ import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity';
|
||||
nullable: true,
|
||||
})
|
||||
export class Workspace {
|
||||
@IDField(() => ID)
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user