apps/recallassess/recallassess-api/src/api/client/profile/dto/profile.dto.ts
Properties |
|
| Optional company_country |
Type : string | null
|
Decorators :
@Expose()
|
|
From Company.country (DB). |
| company_id |
Type : number
|
Decorators :
@Expose()
|
| Optional company_name |
Type : string | null
|
Decorators :
@Expose()
|
|
Display name of the participant's company (for portal header, etc.). |
| created_at |
Type : Date
|
Decorators :
@Expose()
|
Type : string
|
Decorators :
@Expose()
|
| email_verified |
Type : boolean
|
Decorators :
@Expose()
|
| first_name |
Type : string
|
Decorators :
@Expose()
|
| id |
Type : number
|
Decorators :
@Expose()
|
| is_active |
Type : boolean
|
Decorators :
@Expose()
|
| is_dev |
Type : boolean
|
Decorators :
@Expose()
|
| last_name |
Type : string
|
Decorators :
@Expose()
|
| Optional phone |
Type : string | null
|
Decorators :
@Expose()
|
| Optional preferred_timezone |
Type : string | null
|
Decorators :
@Expose()
|
| role |
Type : string
|
Decorators :
@Expose()
|
| Optional updated_at |
Type : Date | null
|
Decorators :
@Expose()
|
| use_system_timezone |
Type : boolean
|
Decorators :
@Expose()
|
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
}