1
0
forked from Yara724/api

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

@@ -18,22 +18,4 @@ export class CreateExpertInitiatedFileDto {
})
@IsEnum(CreationMethod)
creationMethod: CreationMethod;
// Phone numbers for LINK method - users will access files via normal login
@ApiPropertyOptional({
description: "First party phone number. Required for LINK method.",
example: "09123456789",
})
@IsOptional()
@IsString()
firstPartyPhoneNumber?: string;
@ApiPropertyOptional({
description: "Second party phone number. Required for LINK method when type is THIRD_PARTY.",
example: "09187654321",
})
@IsOptional()
@IsString()
secondPartyPhoneNumber?: string;
}

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";
}

View File

@@ -3,11 +3,10 @@ import { IsNotEmpty, IsString } from "class-validator";
export class SendExpertInitiatedLinkV2Dto {
@ApiProperty({
description:
"Frontend route path (same as add-second-party flow), e.g. requestManagement/firstParty",
example: "requestManagement/firstParty",
description: "First party phone number. The link SMS will be sent to this number.",
example: "09123456789",
})
@IsString()
@IsNotEmpty()
frontendRoute: string;
phoneNumber: string;
}