rename to core

This commit is contained in:
2025-12-15 13:46:07 +01:00
parent aedf58643d
commit 5c22f8820c
559 changed files with 415 additions and 767 deletions

View File

@@ -0,0 +1,37 @@
import type { IValueObject } from '@gridpilot/shared/domain';
export interface AnalyticsEntityIdProps {
value: string;
}
/**
* Value Object: AnalyticsEntityId
*
* Represents the ID of an entity (league, driver, team, race, sponsor)
* within the analytics bounded context.
*/
export class AnalyticsEntityId implements IValueObject<AnalyticsEntityIdProps> {
public readonly props: AnalyticsEntityIdProps;
private constructor(value: string) {
this.props = { value };
}
static create(raw: string): AnalyticsEntityId {
const value = raw.trim();
if (!value) {
throw new Error('AnalyticsEntityId must be a non-empty string');
}
return new AnalyticsEntityId(value);
}
get value(): string {
return this.props.value;
}
equals(other: IValueObject<AnalyticsEntityIdProps>): boolean {
return this.props.value === other.props.value;
}
}

View File

@@ -0,0 +1,36 @@
import type { IValueObject } from '@gridpilot/shared/domain';
export interface AnalyticsSessionIdProps {
value: string;
}
/**
* Value Object: AnalyticsSessionId
*
* Represents an analytics session identifier within the analytics bounded context.
*/
export class AnalyticsSessionId implements IValueObject<AnalyticsSessionIdProps> {
public readonly props: AnalyticsSessionIdProps;
private constructor(value: string) {
this.props = { value };
}
static create(raw: string): AnalyticsSessionId {
const value = raw.trim();
if (!value) {
throw new Error('AnalyticsSessionId must be a non-empty string');
}
return new AnalyticsSessionId(value);
}
get value(): string {
return this.props.value;
}
equals(other: IValueObject<AnalyticsSessionIdProps>): boolean {
return this.props.value === other.props.value;
}
}

View File

@@ -0,0 +1,36 @@
import type { IValueObject } from '@gridpilot/shared/domain';
export interface PageViewIdProps {
value: string;
}
/**
* Value Object: PageViewId
*
* Represents the identifier of a PageView within the analytics bounded context.
*/
export class PageViewId implements IValueObject<PageViewIdProps> {
public readonly props: PageViewIdProps;
private constructor(value: string) {
this.props = { value };
}
static create(raw: string): PageViewId {
const value = raw.trim();
if (!value) {
throw new Error('PageViewId must be a non-empty string');
}
return new PageViewId(value);
}
get value(): string {
return this.props.value;
}
equals(other: IValueObject<PageViewIdProps>): boolean {
return this.props.value === other.props.value;
}
}