Added registrar mirrored

This commit is contained in:
SepehrYahyaee
2026-06-15 15:58:31 +03:30
parent 41f81a2f76
commit a7849f915a
13 changed files with 1089 additions and 61 deletions

View File

@@ -6536,6 +6536,28 @@ export class ClaimRequestManagementService {
},
{ lean: true },
);
} else if (actor?.role === RoleEnum.REGISTRAR) {
const registrarBlameIds = await this.blameRequestDbService
.find(
{
registrarInitiated: true,
creationMethod: "IN_PERSON",
initiatedByRegistrarId: new Types.ObjectId(currentUserId),
},
{ select: "_id", lean: true },
)
.then((docs) => docs.map((d) => (d as any)._id));
claims = await this.claimCaseDbService.find(
{
$or: [
{ "owner.userId": new Types.ObjectId(currentUserId) },
...(registrarBlameIds.length
? [{ blameRequestId: { $in: registrarBlameIds } }]
: []),
],
},
{ lean: true },
);
} else {
claims = await this.claimCaseDbService.find(
{ "owner.userId": new Types.ObjectId(currentUserId) },