1
0
forked from Yara724/api

YARA-1073

This commit is contained in:
SepehrYahyaee
2026-06-28 15:53:34 +03:30
parent f7f7f4548d
commit 4552450fbc
2 changed files with 21 additions and 2 deletions

View File

@@ -4367,6 +4367,17 @@ export class RequestManagementService {
// For IN_PERSON files the phone + userId are stored when verify-party-otp is called.
const parties: any[] = [{ role: PartyRole.FIRST, person: {} }];
// Before creating, clean up any orphaned IN_PERSON shell from this expert
// that never had its first party OTP verified.
if (dto.creationMethod === CreationMethod.IN_PERSON) {
await this.blameRequestDbService.deleteMany({
initiatedByFieldExpertId: expertId,
creationMethod: CreationMethod.IN_PERSON,
"workflow.currentStep": firstStep.stepKey, // still at CREATED
"parties.0.person.userId": { $exists: false }, // no verified party yet
});
}
const created = await this.blameRequestDbService.create({
publicId,
requestNo: publicId,