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