forked from Yara724/api
YARA-1073
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user