fix issues in core

This commit is contained in:
2025-12-23 16:16:12 +01:00
parent 120d3bb1a1
commit d04a21fe02
40 changed files with 280 additions and 841 deletions

View File

@@ -0,0 +1,31 @@
import type { IValueObject } from '@core/shared/domain';
export interface AvatarIdProps {
value: string;
}
export class AvatarId implements IValueObject<AvatarIdProps> {
public readonly props: AvatarIdProps;
private constructor(value: string) {
this.props = { value };
}
static create(raw: string): AvatarId {
const value = raw?.trim();
if (!value) {
throw new Error('Avatar ID cannot be empty');
}
return new AvatarId(value);
}
toString(): string {
return this.props.value;
}
equals(other: IValueObject<AvatarIdProps>): boolean {
return this.props.value === other.props.value;
}
}