apps/recallassess/recallassess-api/src/api/client/account/dto/account.dto.ts
Properties |
|
| Optional admin_address |
Type : string
|
Decorators :
@Expose()
|
| Optional admin_city |
Type : string
|
Decorators :
@Expose()
|
| Optional admin_country |
Type : string
|
Decorators :
@Expose()
|
| admin_email |
Type : string
|
Decorators :
@Expose()
|
| admin_first_name |
Type : string
|
Decorators :
@Expose()
|
| admin_last_name |
Type : string
|
Decorators :
@Expose()
|
| Optional admin_password |
Type : string
|
Decorators :
@Expose()
|
| Optional admin_phone |
Type : string
|
Decorators :
@Expose()
|
| Optional billing_cycle |
Type : string
|
Decorators :
@Expose()
|
| company_email |
Type : string
|
Decorators :
@Expose()
|
| company_name |
Type : string
|
Decorators :
@Expose()
|
| Optional company_phone |
Type : string
|
Decorators :
@Expose()
|
| license_count |
Type : number
|
Decorators :
@Expose()
|
| package_id |
Type : number
|
Decorators :
@Expose()
|
| Optional payment_intent_id |
Type : string
|
Decorators :
@Expose()
|
| Optional promo_code |
Type : string
|
Decorators :
@Expose()
|
| Optional setup_intent_id |
Type : string
|
Decorators :
@Expose()
|
| Optional stripe_customer_id |
Type : string
|
Decorators :
@Expose()
|
| total_amount |
Type : number
|
Decorators :
@Expose()
|
| unit_price |
Type : number
|
Decorators :
@Expose()
|
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
}