1
0
forked from Yara724/api
This commit is contained in:
SepehrYahyaee
2026-05-18 11:00:53 +03:30
parent 7ff3e9fd10
commit e1954cdb37
8 changed files with 327 additions and 34 deletions

View File

@@ -71,6 +71,29 @@ export class ExpertFileActivityDbService {
.lean();
}
/** Activity rows for one expert and file kind (claim or blame panel). */
async findByExpert(
expertId: string | Types.ObjectId,
fileType: ExpertFileKind,
): Promise<
Array<{
fileId: Types.ObjectId;
eventType: ExpertFileActivityType;
occurredAt: Date;
}>
> {
return this.activityModel
.find(
{
expertId: new Types.ObjectId(String(expertId)),
fileType,
},
{ fileId: 1, eventType: 1, occurredAt: 1 },
)
.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<{