The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import { Field, InputType } from '@nestjs/graphql';
import {
IsEnum,
IsNotEmpty,
IsObject,
IsOptional,
IsString,
IsUUID,
} from 'class-validator';
import { GraphQLJSON } from 'graphql-type-json';
import { PageLayoutWidgetPosition, WidgetType } from 'twenty-shared/types';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { AllPageLayoutWidgetConfiguration } from 'src/engine/metadata-modules/page-layout-widget/types/all-page-layout-widget-configuration.type';
@InputType()
export class CreatePageLayoutWidgetInput {
@Field(() => UUIDScalarType, { nullable: false })
@IsUUID()
@IsNotEmpty()
pageLayoutTabId: string;
@Field({ nullable: false })
@IsString()
@IsNotEmpty()
title: string;
@Field(() => WidgetType, { nullable: false })
@IsEnum(WidgetType)
type: WidgetType;
@Field(() => UUIDScalarType, { nullable: true })
@IsUUID()
@IsOptional()
objectMetadataId?: string | null;
@Field(() => GraphQLJSON, { nullable: true })
@IsObject()
@IsOptional()
position?: PageLayoutWidgetPosition;
@Field(() => GraphQLJSON, { nullable: false })
@IsObject()
@IsOptional()
configuration: AllPageLayoutWidgetConfiguration;
}