File

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

Index

Properties

Properties

Optional admin_address
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
Optional admin_city
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
Optional admin_country
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
admin_email
Type : string
Decorators :
@Expose()
@IsEmail()
admin_first_name
Type : string
Decorators :
@Expose()
@IsString()
admin_last_name
Type : string
Decorators :
@Expose()
@IsString()
Optional admin_password
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
@MinLength(8, {message: 'Password must be at least 8 characters long'})
@Matches(/[A-Z]/, {message: 'Password must contain at least one uppercase letter'})
@Matches(/\d/, {message: 'Password must contain at least one number'})
@Matches(/[\W_]/, {message: 'Password must contain at least one special character'})
Optional admin_phone
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
@Matches(/^\+?[\d\s]+$/, {message: 'Phone number can only contain digits, spaces, and an optional plus (+) symbol for country code'})
Optional billing_cycle
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
company_email
Type : string
Decorators :
@Expose()
@IsEmail()
company_name
Type : string
Decorators :
@Expose()
@IsString()
Optional company_phone
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
@Matches(/^\+?[\d\s]+$/, {message: 'Phone number can only contain digits, spaces, and an optional plus (+) symbol for country code'})
license_count
Type : number
Decorators :
@Expose()
@IsNumber()
@Min(1)
package_id
Type : number
Decorators :
@Expose()
@IsNumber()
Optional payment_intent_id
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
Optional promo_code
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
Optional setup_intent_id
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
Optional stripe_customer_id
Type : string
Decorators :
@Expose()
@IsOptional()
@IsString()
total_amount
Type : number
Decorators :
@Expose()
@Type(undefined)
@IsNumber()
unit_price
Type : number
Decorators :
@Expose()
@Type(undefined)
@IsNumber()
import { Exclude, Expose, Type } from "class-transformer";
import { IsEmail, IsNumber, IsOptional, IsString, Matches, Min, MinLength } from "class-validator";

@Exclude()
export class CreateAccountFromSignupDto {
  // Company infos
  @Expose()
  @IsString()
  company_name!: string;

  @Expose()
  @IsEmail()
  company_email!: string;

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

  // Admin user info
  @Expose()
  @IsString()
  admin_first_name!: string;

  @Expose()
  @IsString()
  admin_last_name!: string;

  @Expose()
  @IsEmail()
  admin_email!: string;

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

  @Expose()
  @IsOptional()
  @IsString()
  admin_address?: string;

  @Expose()
  @IsOptional()
  @IsString()
  admin_city?: string;

  @Expose()
  @IsOptional()
  @IsString()
  admin_country?: string;

  @Expose()
  @IsOptional()
  @IsString()
  @MinLength(8, { message: "Password must be at least 8 characters long" })
  @Matches(/[A-Z]/, {
    message: "Password must contain at least one uppercase letter",
  })
  @Matches(/\d/, { message: "Password must contain at least one number" })
  @Matches(/[\W_]/, {
    message: "Password must contain at least one special character",
  })
  admin_password?: string;

  // Package info
  @Expose()
  @IsNumber()
  package_id!: number;

  @Expose()
  @IsNumber()
  @Min(1)
  license_count!: number;

  @Expose()
  @Type(() => Number)
  @IsNumber()
  unit_price!: number;

  @Expose()
  @Type(() => Number)
  @IsNumber()
  total_amount!: number;

  // VAT (for regions like UAE)
  // Note: Currently calculated server-side based on admin_country (e.g. 5% for AE)

  // Billing cycle
  @Expose()
  @IsOptional()
  @IsString()
  billing_cycle?: string; // QUARTERLY, HALF_YEARLY, ANNUAL

  // Promo code
  @Expose()
  @IsOptional()
  @IsString()
  promo_code?: string;

  // Payment info (for paid plans)
  @Expose()
  @IsOptional()
  @IsString()
  payment_intent_id?: string;

  // Setup info (for trial packages - $0 amounts)
  @Expose()
  @IsOptional()
  @IsString()
  setup_intent_id?: string;

  @Expose()
  @IsOptional()
  @IsString()
  stripe_customer_id?: string;
}

@Exclude()
export class AccountCreationResponseDto {
  @Expose()
  success!: boolean;
  @Expose()
  company_id?: number;
  @Expose()
  participant_id?: number;
  @Expose()
  message!: string;

  // Send temporary credentials via email, don't return in response
  // temporary_password will be sent via email
}

results matching ""

    No results matching ""