fix issues in core
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import type { Logger, UseCase, UseCaseOutputPort } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import type { IPageViewRepository } from '../../domain/repositories/IPageViewRepository';
|
||||
|
||||
export interface GetAnalyticsMetricsInput {
|
||||
startDate?: Date;
|
||||
@@ -19,7 +18,7 @@ export type GetAnalyticsMetricsErrorCode = 'REPOSITORY_ERROR';
|
||||
|
||||
export class GetAnalyticsMetricsUseCase implements UseCase<GetAnalyticsMetricsInput, void, GetAnalyticsMetricsErrorCode> {
|
||||
constructor(
|
||||
private readonly pageViewRepository: IPageViewRepository,
|
||||
// private readonly pageViewRepository: IPageViewRepository, // TODO: Use when implementation is ready
|
||||
private readonly logger: Logger,
|
||||
private readonly output: UseCaseOutputPort<GetAnalyticsMetricsOutput>,
|
||||
) {}
|
||||
@@ -29,7 +28,8 @@ export class GetAnalyticsMetricsUseCase implements UseCase<GetAnalyticsMetricsIn
|
||||
const startDate = input.startDate ?? new Date(Date.now() - 30 * 24 * 60 * 60 * 1000); // 30 days ago
|
||||
const endDate = input.endDate ?? new Date();
|
||||
|
||||
// TODO static data
|
||||
// TODO: Use pageViewRepository when implemented
|
||||
// const pageViews = await this.pageViewRepository.countByDateRange(startDate, endDate);
|
||||
const pageViews = 0;
|
||||
const uniqueVisitors = 0;
|
||||
const averageSessionDuration = 0;
|
||||
|
||||
Reference in New Issue
Block a user