Added expert field mirror flow

This commit is contained in:
SepehrYahyaee
2026-06-15 11:24:41 +03:30
committed by Sepehr Yahyaee
parent 79905345e5
commit 19dc2a76f2
39 changed files with 2310 additions and 182 deletions

View File

@@ -0,0 +1,45 @@
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsIn, IsNotEmpty, IsOptional, IsString } from "class-validator";
/**
* One-at-a-time OTP send for the expert-initiated IN_PERSON flow.
* The expert sends an OTP to a single party's phone, collects the code, then
* verifies. Repeat for the second party (no invite link is used).
*/
export class SendPartyOtpDto {
@ApiProperty({
description: "Phone number of the party to send the OTP to.",
example: "09123456789",
})
@IsString()
@IsNotEmpty()
phoneNumber: string;
}
export class VerifyPartyOtpDto {
@ApiProperty({
description: "Phone number the OTP was sent to.",
example: "09123456789",
})
@IsString()
@IsNotEmpty()
phoneNumber: string;
@ApiProperty({
description: "OTP code collected from the party.",
example: "123456",
})
@IsString()
@IsNotEmpty()
otp: string;
@ApiPropertyOptional({
description:
"Which party this phone belongs to. Optional: when omitted, FIRST is bound if it has no user yet, otherwise SECOND (created if missing).",
enum: ["FIRST", "SECOND"],
example: "FIRST",
})
@IsOptional()
@IsIn(["FIRST", "SECOND"])
partyRole?: "FIRST" | "SECOND";
}