Skip to content

The open alternative to Salesforce, designed for AI.

1.2 KB
Raw Blame
import { Field, InputType } from '@nestjs/graphql';

import { Type } from 'class-transformer';
import {
  IsBoolean,
  IsNotEmpty,
  IsNumber,
  IsOptional,
  IsString,
  IsUUID,
  ValidateNested,
} from 'class-validator';

import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';

@InputType()
class UpdateViewFieldGroupInputUpdates {
  @IsOptional()
  @IsString()
  @Field({ nullable: true })
  name?: string;

  @IsOptional()
  @IsNumber()
  @Field({ nullable: true })
  position?: number;

  @IsOptional()
  @IsBoolean()
  @Field({ nullable: true })
  isVisible?: boolean;

  @IsOptional()
  @IsString()
  @Field({
    nullable: true,
    deprecationReason:
      'Ignored: view field groups are no longer soft-deleted. Use destroyViewFieldGroup instead.',
  })
  deletedAt?: string;
}

@InputType()
export class UpdateViewFieldGroupInput {
  @IsUUID()
  @IsNotEmpty()
  @Field(() => UUIDScalarType, {
    description: 'The id of the view field group to update',
  })
  id: string;

  @Type(() => UpdateViewFieldGroupInputUpdates)
  @ValidateNested()
  @Field(() => UpdateViewFieldGroupInputUpdates, {
    description: 'The view field group to update',
  })
  update: UpdateViewFieldGroupInputUpdates;
}