This commit is contained in:
2026-04-29 20:22:43 +03:30
parent 993d809de2
commit ebf8a9a624
10 changed files with 487 additions and 20 deletions

View File

@@ -70,4 +70,22 @@ export class ExpertFileActivityDbService {
.sort({ occurredAt: 1, _id: 1 })
.lean();
}
/** All file-activity rows for an insurer tenant (blame + claim experts). */
async findByTenant(tenantId: string | Types.ObjectId): Promise<
Array<{
expertId: Types.ObjectId;
fileId: Types.ObjectId;
eventType: ExpertFileActivityType;
occurredAt: Date;
}>
> {
return this.activityModel
.find(
{ tenantId: new Types.ObjectId(String(tenantId)) },
{ expertId: 1, fileId: 1, eventType: 1, occurredAt: 1 },
)
.sort({ occurredAt: 1, _id: 1 })
.lean();
}
}