website refactor

This commit is contained in:
2026-01-16 19:46:49 +01:00
parent 26fc726556
commit 77a923e6a3
563 changed files with 1643 additions and 2259 deletions

View File

@@ -1,5 +1,5 @@
import type { Logger } from '@core/shared/domain/Logger';
import type { UseCase } from '@core/shared/application/UseCase';
import type { Logger } from '@core/shared/domain/Logger';
import { Result } from '@core/shared/domain/Result';
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
import type { PageViewRepository } from '../repositories/PageViewRepository';

View File

@@ -1,5 +1,5 @@
import type { Logger } from '@core/shared/domain/Logger';
import type { UseCase } from '@core/shared/application/UseCase';
import type { Logger } from '@core/shared/domain/Logger';
import { Result } from '@core/shared/domain/Result';
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';

View File

@@ -1,9 +1,9 @@
import type { Logger } from '@core/shared/domain/Logger';
import { describe, expect, it, vi, type Mock, beforeEach } from 'vitest';
import type { EntityType } from '../../domain/types/PageView';
import { GetEntityAnalyticsQuery, type GetEntityAnalyticsInput } from './GetEntityAnalyticsQuery';
import type { PageViewRepository } from '../repositories/PageViewRepository';
import { beforeEach, describe, expect, it, vi, type Mock } from 'vitest';
import type { EngagementRepository } from '../../domain/repositories/EngagementRepository';
import type { EntityType } from '../../domain/types/PageView';
import type { PageViewRepository } from '../repositories/PageViewRepository';
import { GetEntityAnalyticsQuery, type GetEntityAnalyticsInput } from './GetEntityAnalyticsQuery';
describe('GetEntityAnalyticsQuery', () => {
let pageViewRepository: {

View File

@@ -5,14 +5,14 @@
* Returns metrics formatted for display to sponsors and admins.
*/
import type { EngagementRepository } from '@core/analytics/domain/repositories/EngagementRepository';
import type { AsyncUseCase } from '@core/shared/application/AsyncUseCase';
import type { Logger } from '@core/shared/domain/Logger';
import type { PageViewRepository } from '../repositories/PageViewRepository';
import type { EngagementRepository } from '@core/analytics/domain/repositories/EngagementRepository';
import type { EntityType } from '../../domain/types/PageView';
import type { SnapshotPeriod } from '../../domain/types/AnalyticsSnapshot';
import { Result } from '@core/shared/domain/Result';
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
import type { SnapshotPeriod } from '../../domain/types/AnalyticsSnapshot';
import type { EntityType } from '../../domain/types/PageView';
import type { PageViewRepository } from '../repositories/PageViewRepository';
export interface GetEntityAnalyticsInput {
entityType: EntityType;

View File

@@ -1,9 +1,9 @@
import type { Logger } from '@core/shared/domain/Logger';
import { describe, expect, it, vi, type Mock, beforeEach } from 'vitest';
import { beforeEach, describe, expect, it, vi, type Mock } from 'vitest';
import { EngagementEvent } from '../../domain/entities/EngagementEvent';
import type { EngagementRepository } from '../../domain/repositories/EngagementRepository';
import type { EngagementAction, EngagementEntityType } from '../../domain/types/EngagementEvent';
import { RecordEngagementUseCase, type RecordEngagementInput } from './RecordEngagementUseCase';
import type { EngagementRepository } from '../../domain/repositories/EngagementRepository';
describe('RecordEngagementUseCase', () => {
let engagementRepository: {

View File

@@ -1,5 +1,5 @@
import type { Logger } from '@core/shared/domain/Logger';
import type { UseCase } from '@core/shared/application/UseCase';
import type { Logger } from '@core/shared/domain/Logger';
import { Result } from '@core/shared/domain/Result';
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
import { EngagementEvent } from '../../domain/entities/EngagementEvent';

View File

@@ -1,10 +1,10 @@
import type { Logger } from '@core/shared/domain/Logger';
import type { UseCase } from '@core/shared/application/UseCase';
import type { PageViewRepository } from '../repositories/PageViewRepository';
import { PageView } from '../../domain/entities/PageView';
import type { EntityType, VisitorType } from '../../domain/types/PageView';
import type { Logger } from '@core/shared/domain/Logger';
import { Result } from '@core/shared/domain/Result';
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
import { PageView } from '../../domain/entities/PageView';
import type { EntityType, VisitorType } from '../../domain/types/PageView';
import type { PageViewRepository } from '../repositories/PageViewRepository';
export interface RecordPageViewInput {
entityType: EntityType;

View File

@@ -9,7 +9,6 @@ import { Entity } from '@core/shared/domain/Entity';
import type { EntityType, PageViewProps, VisitorType } from '../types/PageView';
import { AnalyticsEntityId } from '../value-objects/AnalyticsEntityId';
import { AnalyticsSessionId } from '../value-objects/AnalyticsSessionId';
import { PageViewId } from '../value-objects/PageViewId';
export type { EntityType, VisitorType } from '../types/PageView';
@@ -23,13 +22,11 @@ export class PageView extends Entity<string> {
readonly timestamp: Date;
readonly durationMs: number | undefined;
private readonly idVo: PageViewId;
private readonly entityIdVo: AnalyticsEntityId;
private readonly sessionIdVo: AnalyticsSessionId;
private constructor(props: PageViewProps) {
super(props.id);
this.idVo = PageViewId.create(props.id);
this.entityType = props.entityType;
this.entityIdVo = AnalyticsEntityId.create(props.entityId);
this.visitorId = props.visitorId;

View File

@@ -4,7 +4,7 @@
* Defines persistence operations for AnalyticsSnapshot entities.
*/
import type { AnalyticsSnapshot, SnapshotPeriod, SnapshotEntityType } from '../entities/AnalyticsSnapshot';
import type { AnalyticsSnapshot, SnapshotEntityType, SnapshotPeriod } from '../entities/AnalyticsSnapshot';
export interface AnalyticsSnapshotRepository {
save(snapshot: AnalyticsSnapshot): Promise<void>;

View File

@@ -1,4 +1,4 @@
import type { EngagementEvent, EngagementAction, EngagementEntityType } from '../entities/EngagementEvent';
import type { EngagementAction, EngagementEntityType, EngagementEvent } from '../entities/EngagementEvent';
export interface EngagementRepository {
save(event: EngagementEvent): Promise<void>;