This commit is contained in:
2025-12-21 19:53:22 +01:00
parent f2d8a23583
commit 3c64f328e2
105 changed files with 3191 additions and 1706 deletions

View File

@@ -52,7 +52,6 @@ export class GetEntityAnalyticsQuery
private readonly pageViewRepository: IPageViewRepository,
private readonly engagementRepository: IEngagementRepository,
private readonly snapshotRepository: IAnalyticsSnapshotRepository,
private readonly output: UseCaseOutputPort<Result<EntityAnalyticsOutput, ApplicationErrorCode<GetEntityAnalyticsErrorCode, { message: string }>>>,
private readonly logger: Logger
) {}
@@ -145,10 +144,8 @@ export class GetEntityAnalyticsQuery
label: this.formatPeriodLabel(since, now),
},
};
const result = Result.ok<EntityAnalyticsOutput, ApplicationErrorCode<GetEntityAnalyticsErrorCode, { message: string }>>(resultData);
this.output.present(result);
this.logger.info(`Successfully retrieved analytics for entity ${input.entityId}.`);
return result;
return Result.ok(resultData);
} catch (error) {
const err = error as Error;
this.logger.error(`Failed to get entity analytics for ${input.entityId}: ${err.message}`, err);
@@ -156,7 +153,6 @@ export class GetEntityAnalyticsQuery
code: 'REPOSITORY_ERROR',
details: { message: err.message ?? 'Failed to get entity analytics' },
});
this.output.present(result);
return result;
}
}