File

apps/recallassess/recallassess-api/src/api/client/profile/dto/profile.dto.ts

Description

DTO for updating participant profile Note: Email cannot be updated through this endpoint for security reasons

Index

Properties

Properties

Optional first_name
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
@MaxLength(100)
Optional last_name
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
@MaxLength(100)
Optional phone
Type : string | null
Decorators :
@Expose()
@IsOptional()
@IsString()
@MaxLength(20)
@Matches(/^\+?[\d\s]+$/, {message: 'Phone number can only contain digits, spaces, and an optional plus (+) symbol for country code'})
Optional preferred_timezone
Type : string | null
Decorators :
@Expose()
@IsOptional()
@IsString()
@MaxLength(100)
Optional use_system_timezone
Type : boolean
Decorators :
@Expose()
@IsOptional()
@IsBoolean()
import { Exclude, Expose } from "class-transformer";
import { IsBoolean, IsOptional, IsString, Matches, MaxLength } from "class-validator";

@Exclude()
export class ProfileDto {
  @Expose()
  id!: number;
  @Expose()
  company_id!: number;
  /** Display name of the participant's company (for portal header, etc.). */
  @Expose()
  company_name?: string | null;
  @Expose()
  first_name!: string;
  @Expose()
  last_name!: string;
  @Expose()
  email!: string;
  @Expose()
  phone?: string | null;
  @Expose()
  email_verified!: boolean;
  @Expose()
  role!: string;
  @Expose()
  is_active!: boolean;
  @Expose()
  is_dev!: boolean; // Dev mode: shows correct answers and answer levels in assessments
  @Expose()
  use_system_timezone!: boolean;
  @Expose()
  preferred_timezone?: string | null;
  /** From Company.country (DB). */
  @Expose()
  company_country?: string | null;
  @Expose()
  created_at!: Date;
  @Expose()
  updated_at?: Date | null;
}

/**
 * DTO for updating participant profile
 * Note: Email cannot be updated through this endpoint for security reasons
 */
@Exclude()
export class UpdateProfileDto {
  @Expose()
  @IsOptional()
  @IsString()
  @MaxLength(100)
  first_name?: string;

  @Expose()
  @IsOptional()
  @IsString()
  @MaxLength(100)
  last_name?: string;

  @Expose()
  @IsOptional()
  @IsString()
  @MaxLength(20)
  @Matches(/^\+?[\d\s]+$/, {
    message: "Phone number can only contain digits, spaces, and an optional plus (+) symbol for country code",
  })
  phone?: string | null;

  @Expose()
  @IsOptional()
  @IsBoolean()
  use_system_timezone?: boolean;

  @Expose()
  @IsOptional()
  @IsString()
  @MaxLength(100)
  preferred_timezone?: string | null;

  // Email is intentionally excluded - it cannot be updated through profile endpoint
}

results matching ""

    No results matching ""