website refactor
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* Achievements are categorized by role (driver, steward, admin) and type.
|
||||
*/
|
||||
|
||||
import type { IEntity } from '@core/shared/domain';
|
||||
import type { Entity } from '@core/shared/domain';
|
||||
|
||||
export type AchievementCategory = 'driver' | 'steward' | 'admin' | 'community';
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface AchievementRequirement {
|
||||
operator: '>=' | '>' | '=' | '<' | '<=';
|
||||
}
|
||||
|
||||
export class Achievement implements IEntity<string> {
|
||||
export class Achievement implements Entity<string> {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly description: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IEntity } from '@core/shared/domain';
|
||||
import type { Entity } from '@core/shared/domain';
|
||||
import { IdentityDomainValidationError, IdentityDomainInvariantError } from '../errors/IdentityDomainError';
|
||||
|
||||
export interface AdminVote {
|
||||
@@ -42,7 +42,7 @@ export interface AdminVoteSessionProps {
|
||||
*
|
||||
* Based on ratings-architecture-concept.md sections 5.2.1 and 7.1.1
|
||||
*/
|
||||
export class AdminVoteSession implements IEntity<string> {
|
||||
export class AdminVoteSession implements Entity<string> {
|
||||
readonly id: string;
|
||||
readonly leagueId: string;
|
||||
readonly adminId: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IEntity } from '@core/shared/domain';
|
||||
import type { Entity } from '@core/shared/domain';
|
||||
import { RatingEventId } from '../value-objects/RatingEventId';
|
||||
import { RatingDimensionKey } from '../value-objects/RatingDimensionKey';
|
||||
import { RatingDelta } from '../value-objects/RatingDelta';
|
||||
@@ -34,7 +34,7 @@ export interface RatingEventProps {
|
||||
version: number;
|
||||
}
|
||||
|
||||
export class RatingEvent implements IEntity<RatingEventId> {
|
||||
export class RatingEvent implements Entity<RatingEventId> {
|
||||
readonly id: RatingEventId;
|
||||
readonly userId: string;
|
||||
readonly dimension: RatingDimensionKey;
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { EmailValidationResult } from '../types/EmailAddress';
|
||||
import { validateEmail } from '../types/EmailAddress';
|
||||
import { UserId } from '../value-objects/UserId';
|
||||
import { PasswordHash } from '../value-objects/PasswordHash';
|
||||
import { StoredUser } from '../repositories/IUserRepository';
|
||||
import { StoredUser } from '../repositories/UserRepository';
|
||||
|
||||
export interface UserProps {
|
||||
id: UserId;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Represents an achievement earned by a specific user.
|
||||
*/
|
||||
|
||||
import type { IEntity } from '@core/shared/domain';
|
||||
import type { Entity } from '@core/shared/domain';
|
||||
|
||||
export interface UserAchievementProps {
|
||||
id: string;
|
||||
@@ -15,7 +15,7 @@ export interface UserAchievementProps {
|
||||
progress?: number; // For partial progress tracking (0-100)
|
||||
}
|
||||
|
||||
export class UserAchievement implements IEntity<string> {
|
||||
export class UserAchievement implements Entity<string> {
|
||||
readonly id: string;
|
||||
readonly userId: string;
|
||||
readonly achievementId: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { IDomainError, CommonDomainErrorKind } from '@core/shared/errors';
|
||||
import type { DomainError, CommonDomainErrorKind } from '@core/shared/errors';
|
||||
|
||||
export abstract class IdentityDomainError extends Error implements IDomainError<CommonDomainErrorKind> {
|
||||
export abstract class IdentityDomainError extends Error implements DomainError<CommonDomainErrorKind> {
|
||||
readonly type = 'domain' as const;
|
||||
readonly context = 'identity-domain';
|
||||
abstract readonly kind: CommonDomainErrorKind;
|
||||
@@ -13,7 +13,7 @@ export abstract class IdentityDomainError extends Error implements IDomainError<
|
||||
|
||||
export class IdentityDomainValidationError
|
||||
extends IdentityDomainError
|
||||
implements IDomainError<'validation'>
|
||||
implements DomainError<'validation'>
|
||||
{
|
||||
readonly kind = 'validation' as const;
|
||||
|
||||
@@ -24,7 +24,7 @@ export class IdentityDomainValidationError
|
||||
|
||||
export class IdentityDomainInvariantError
|
||||
extends IdentityDomainError
|
||||
implements IDomainError<'invariant'>
|
||||
implements DomainError<'invariant'>
|
||||
{
|
||||
readonly kind = 'invariant' as const;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ export interface MagicLinkNotificationInput {
|
||||
expiresAt: Date;
|
||||
}
|
||||
|
||||
export interface IMagicLinkNotificationPort {
|
||||
export interface MagicLinkNotificationPort {
|
||||
/**
|
||||
* Send a magic link notification to the user
|
||||
* @param input - The notification data
|
||||
@@ -7,7 +7,7 @@
|
||||
import type { Achievement, AchievementCategory } from '../entities/Achievement';
|
||||
import type { UserAchievement } from '../entities/UserAchievement';
|
||||
|
||||
export interface IAchievementRepository {
|
||||
export interface AchievementRepository {
|
||||
// Achievement operations
|
||||
findAchievementById(id: string): Promise<Achievement | null>;
|
||||
findAllAchievements(): Promise<Achievement[]>;
|
||||
@@ -7,7 +7,7 @@ import type { AdminVoteSession } from '../entities/AdminVoteSession';
|
||||
* Sessions are scoped to leagues and control voting windows.
|
||||
*/
|
||||
|
||||
export interface IAdminVoteSessionRepository {
|
||||
export interface AdminVoteSessionRepository {
|
||||
/**
|
||||
* Save a vote session
|
||||
*/
|
||||
@@ -6,7 +6,7 @@ import { User } from '../entities/User';
|
||||
*
|
||||
* Repository interface for authentication operations.
|
||||
*/
|
||||
export interface IAuthRepository {
|
||||
export interface AuthRepository {
|
||||
/**
|
||||
* Find user by email
|
||||
*/
|
||||
@@ -5,7 +5,7 @@ import { Company } from '../entities/Company';
|
||||
*
|
||||
* Repository interface for Company entity operations.
|
||||
*/
|
||||
export interface ICompanyRepository {
|
||||
export interface CompanyRepository {
|
||||
/**
|
||||
* Create a new company (returns unsaved entity)
|
||||
*/
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IExternalGameRatingRepository } from './IExternalGameRatingRepository';
|
||||
import { ExternalGameRatingRepository } from './ExternalGameRatingRepository';
|
||||
import { ExternalGameRatingProfile } from '../entities/ExternalGameRatingProfile';
|
||||
import { UserId } from '../value-objects/UserId';
|
||||
import { GameKey } from '../value-objects/GameKey';
|
||||
@@ -11,7 +11,7 @@ import { ExternalRatingProvenance } from '../value-objects/ExternalRatingProvena
|
||||
*/
|
||||
describe('IExternalGameRatingRepository', () => {
|
||||
// Mock implementation for testing
|
||||
class MockExternalGameRatingRepository implements IExternalGameRatingRepository {
|
||||
class MockExternalGameRatingRepository implements ExternalGameRatingRepository {
|
||||
private profiles: Map<string, ExternalGameRatingProfile> = new Map();
|
||||
|
||||
private getKey(userId: string, gameKey: string): string {
|
||||
@@ -61,7 +61,7 @@ describe('IExternalGameRatingRepository', () => {
|
||||
return this.profiles.has(key);
|
||||
}
|
||||
|
||||
async findProfilesPaginated(userId: string, options?: import('./IExternalGameRatingRepository').PaginatedQueryOptions): Promise<import('./IExternalGameRatingRepository').PaginatedResult<ExternalGameRatingProfile>> {
|
||||
async findProfilesPaginated(userId: string, options?: import('./ExternalGameRatingRepository').PaginatedQueryOptions): Promise<import('./ExternalGameRatingRepository').PaginatedResult<ExternalGameRatingProfile>> {
|
||||
const allProfiles = await this.findByUserId(userId);
|
||||
|
||||
// Apply filters
|
||||
@@ -89,7 +89,7 @@ describe('IExternalGameRatingRepository', () => {
|
||||
const hasMore = offset + limit < total;
|
||||
const nextOffset = hasMore ? offset + limit : undefined;
|
||||
|
||||
const result: import('./IExternalGameRatingRepository').PaginatedResult<ExternalGameRatingProfile> = {
|
||||
const result: import('./ExternalGameRatingRepository').PaginatedResult<ExternalGameRatingProfile> = {
|
||||
items,
|
||||
total,
|
||||
limit,
|
||||
@@ -33,7 +33,7 @@ export interface PaginatedResult<T> {
|
||||
nextOffset?: number;
|
||||
}
|
||||
|
||||
export interface IExternalGameRatingRepository {
|
||||
export interface ExternalGameRatingRepository {
|
||||
/**
|
||||
* Find profile by user ID and game key
|
||||
*/
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
|
||||
export interface PasswordResetRequest {
|
||||
email: string;
|
||||
@@ -8,7 +8,7 @@ export interface PasswordResetRequest {
|
||||
used?: boolean;
|
||||
}
|
||||
|
||||
export interface IMagicLinkRepository {
|
||||
export interface MagicLinkRepository {
|
||||
/**
|
||||
* Create a password reset request
|
||||
*/
|
||||
@@ -6,10 +6,10 @@ import { RatingEvent } from '../entities/RatingEvent';
|
||||
import { RatingEventId } from '../value-objects/RatingEventId';
|
||||
import { RatingDimensionKey } from '../value-objects/RatingDimensionKey';
|
||||
import { RatingDelta } from '../value-objects/RatingDelta';
|
||||
import { IRatingEventRepository, FindByUserIdOptions, PaginatedQueryOptions, PaginatedResult } from './IRatingEventRepository';
|
||||
import { RatingEventRepository, FindByUserIdOptions, PaginatedQueryOptions, PaginatedResult } from './RatingEventRepository';
|
||||
|
||||
// In-memory test implementation
|
||||
class InMemoryRatingEventRepository implements IRatingEventRepository {
|
||||
class InMemoryRatingEventRepository implements RatingEventRepository {
|
||||
private events: RatingEvent[] = [];
|
||||
|
||||
async save(event: RatingEvent): Promise<RatingEvent> {
|
||||
@@ -44,7 +44,7 @@ export interface PaginatedResult<T> {
|
||||
nextOffset?: number;
|
||||
}
|
||||
|
||||
export interface IRatingEventRepository {
|
||||
export interface RatingEventRepository {
|
||||
/**
|
||||
* Save a rating event to the ledger
|
||||
*/
|
||||
@@ -7,7 +7,7 @@
|
||||
import type { SponsorAccount } from '../entities/SponsorAccount';
|
||||
import type { UserId } from '../value-objects/UserId';
|
||||
|
||||
export interface ISponsorAccountRepository {
|
||||
export interface SponsorAccountRepository {
|
||||
save(account: SponsorAccount): Promise<void>;
|
||||
findById(id: UserId): Promise<SponsorAccount | null>;
|
||||
findBySponsorId(sponsorId: string): Promise<SponsorAccount | null>;
|
||||
@@ -3,10 +3,10 @@
|
||||
*/
|
||||
|
||||
import { UserRating } from '../value-objects/UserRating';
|
||||
import { IUserRatingRepository } from './IUserRatingRepository';
|
||||
import { UserRatingRepository } from './UserRatingRepository';
|
||||
|
||||
// In-memory test implementation
|
||||
class InMemoryUserRatingRepository implements IUserRatingRepository {
|
||||
class InMemoryUserRatingRepository implements UserRatingRepository {
|
||||
private ratings: Map<string, UserRating> = new Map();
|
||||
|
||||
async findByUserId(userId: string): Promise<UserRating | null> {
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import type { UserRating } from '../value-objects/UserRating';
|
||||
|
||||
export interface IUserRatingRepository {
|
||||
export interface UserRatingRepository {
|
||||
/**
|
||||
* Find rating snapshot by user ID
|
||||
*/
|
||||
@@ -20,7 +20,7 @@ export interface StoredUser {
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export interface IUserRepository {
|
||||
export interface UserRepository {
|
||||
/**
|
||||
* Find user by email
|
||||
*/
|
||||
@@ -5,7 +5,7 @@ import { PasswordHash } from '../value-objects/PasswordHash';
|
||||
*
|
||||
* Service for password hashing and verification.
|
||||
*/
|
||||
export interface IPasswordHashingService {
|
||||
export interface PasswordHashingService {
|
||||
hash(plain: string): Promise<string>;
|
||||
verify(plain: string, hash: string): Promise<boolean>;
|
||||
}
|
||||
@@ -13,7 +13,7 @@ export interface IPasswordHashingService {
|
||||
/**
|
||||
* Implementation using bcrypt via PasswordHash VO.
|
||||
*/
|
||||
export class PasswordHashingService implements IPasswordHashingService {
|
||||
export class PasswordHashingService implements PasswordHashingService {
|
||||
async hash(plain: string): Promise<string> {
|
||||
const passwordHash = await PasswordHash.create(plain);
|
||||
return passwordHash.value;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
||||
import { RatingUpdateService } from './RatingUpdateService';
|
||||
import type { IUserRatingRepository } from '../repositories/IUserRatingRepository';
|
||||
import type { IRatingEventRepository } from '../repositories/IRatingEventRepository';
|
||||
import type { UserRatingRepository } from '../repositories/UserRatingRepository';
|
||||
import type { RatingEventRepository } from '../repositories/RatingEventRepository';
|
||||
import { UserRating } from '../value-objects/UserRating';
|
||||
import { RatingEvent } from '../entities/RatingEvent';
|
||||
import { RatingEventId } from '../value-objects/RatingEventId';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { IDomainService } from '@core/shared/domain';
|
||||
import type { IUserRatingRepository } from '../repositories/IUserRatingRepository';
|
||||
import type { IRatingEventRepository } from '../repositories/IRatingEventRepository';
|
||||
import type { DomainService } from '@core/shared/domain';
|
||||
import type { UserRatingRepository } from '../repositories/UserRatingRepository';
|
||||
import type { RatingEventRepository } from '../repositories/RatingEventRepository';
|
||||
import { RatingEventFactory } from './RatingEventFactory';
|
||||
import { RatingSnapshotCalculator } from './RatingSnapshotCalculator';
|
||||
import { RatingEvent } from '../entities/RatingEvent';
|
||||
@@ -17,7 +17,7 @@ import { RatingDelta } from '../value-objects/RatingDelta';
|
||||
* EVOLVED (Slice 7): Now uses event-driven approach with ledger pattern.
|
||||
* Records rating events and recomputes snapshots for transparency and auditability.
|
||||
*/
|
||||
export class RatingUpdateService implements IDomainService {
|
||||
export class RatingUpdateService implements DomainService {
|
||||
readonly serviceName = 'RatingUpdateService';
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import { IdentityDomainValidationError } from '../errors/IdentityDomainError';
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ const VALID_REASON_CODES: AdminTrustReasonCodeValue[] = [
|
||||
'ADMIN_ACTION_ABUSE_REPORT_PENALTY',
|
||||
];
|
||||
|
||||
export class AdminTrustReasonCode implements IValueObject<AdminTrustReasonCodeProps> {
|
||||
export class AdminTrustReasonCode implements ValueObject<AdminTrustReasonCodeProps> {
|
||||
readonly value: AdminTrustReasonCodeValue;
|
||||
|
||||
private constructor(value: AdminTrustReasonCodeValue) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import { IdentityDomainValidationError } from '../errors/IdentityDomainError';
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,7 @@ const VALID_REASON_CODES: DrivingReasonCodeValue[] = [
|
||||
'DRIVING_SEASON_ATTENDANCE_BONUS',
|
||||
];
|
||||
|
||||
export class DrivingReasonCode implements IValueObject<DrivingReasonCodeProps> {
|
||||
export class DrivingReasonCode implements ValueObject<DrivingReasonCodeProps> {
|
||||
readonly value: DrivingReasonCodeValue;
|
||||
|
||||
private constructor(value: DrivingReasonCodeValue) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { EmailValidationResult } from '../types/EmailAddress';
|
||||
import { validateEmail, isDisposableEmail } from '../types/EmailAddress';
|
||||
|
||||
@@ -12,7 +12,7 @@ export interface EmailAddressProps {
|
||||
* Wraps a validated, normalized email string and provides equality semantics.
|
||||
* Validation and helper utilities live in domain/types/EmailAddress.
|
||||
*/
|
||||
export class EmailAddress implements IValueObject<EmailAddressProps> {
|
||||
export class EmailAddress implements ValueObject<EmailAddressProps> {
|
||||
public readonly props: EmailAddressProps;
|
||||
|
||||
private constructor(value: string) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import { IdentityDomainValidationError } from '../errors/IdentityDomainError';
|
||||
import { GameKey } from './GameKey';
|
||||
|
||||
@@ -8,7 +8,7 @@ export interface ExternalRatingProps {
|
||||
value: number;
|
||||
}
|
||||
|
||||
export class ExternalRating implements IValueObject<ExternalRatingProps> {
|
||||
export class ExternalRating implements ValueObject<ExternalRatingProps> {
|
||||
readonly gameKey: GameKey;
|
||||
readonly type: string;
|
||||
readonly value: number;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import { IdentityDomainValidationError } from '../errors/IdentityDomainError';
|
||||
|
||||
export interface ExternalRatingProvenanceProps {
|
||||
@@ -7,7 +7,7 @@ export interface ExternalRatingProvenanceProps {
|
||||
verified?: boolean;
|
||||
}
|
||||
|
||||
export class ExternalRatingProvenance implements IValueObject<ExternalRatingProvenanceProps> {
|
||||
export class ExternalRatingProvenance implements ValueObject<ExternalRatingProvenanceProps> {
|
||||
readonly source: string;
|
||||
readonly lastSyncedAt: Date;
|
||||
readonly verified: boolean;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import { IdentityDomainValidationError } from '../errors/IdentityDomainError';
|
||||
|
||||
export interface GameKeyProps {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export class GameKey implements IValueObject<GameKeyProps> {
|
||||
export class GameKey implements ValueObject<GameKeyProps> {
|
||||
readonly value: string;
|
||||
|
||||
private constructor(value: string) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import bcrypt from 'bcrypt';
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
|
||||
export interface PasswordHashProps {
|
||||
value: string;
|
||||
@@ -10,7 +10,7 @@ export interface PasswordHashProps {
|
||||
*
|
||||
* Wraps a bcrypt-hashed password string and provides verification.
|
||||
*/
|
||||
export class PasswordHash implements IValueObject<PasswordHashProps> {
|
||||
export class PasswordHash implements ValueObject<PasswordHashProps> {
|
||||
public readonly props: PasswordHashProps;
|
||||
|
||||
private constructor(value: string) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import { IdentityDomainValidationError } from '../errors/IdentityDomainError';
|
||||
|
||||
export interface RatingDeltaProps {
|
||||
value: number;
|
||||
}
|
||||
|
||||
export class RatingDelta implements IValueObject<RatingDeltaProps> {
|
||||
export class RatingDelta implements ValueObject<RatingDeltaProps> {
|
||||
readonly value: number;
|
||||
|
||||
private constructor(value: number) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import { IdentityDomainValidationError } from '../errors/IdentityDomainError';
|
||||
|
||||
export interface RatingDimensionKeyProps {
|
||||
@@ -7,7 +7,7 @@ export interface RatingDimensionKeyProps {
|
||||
|
||||
const VALID_DIMENSIONS = ['driving', 'adminTrust', 'stewardTrust', 'broadcasterTrust'] as const;
|
||||
|
||||
export class RatingDimensionKey implements IValueObject<RatingDimensionKeyProps> {
|
||||
export class RatingDimensionKey implements ValueObject<RatingDimensionKeyProps> {
|
||||
readonly value: RatingDimensionKeyProps['value'];
|
||||
|
||||
private constructor(value: RatingDimensionKeyProps['value']) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import { IdentityDomainValidationError } from '../errors/IdentityDomainError';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
@@ -6,7 +6,7 @@ export interface RatingEventIdProps {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export class RatingEventId implements IValueObject<RatingEventIdProps> {
|
||||
export class RatingEventId implements ValueObject<RatingEventIdProps> {
|
||||
readonly value: string;
|
||||
|
||||
private constructor(value: string) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import { IdentityDomainValidationError } from '../errors/IdentityDomainError';
|
||||
|
||||
export type RatingReferenceType = 'race' | 'penalty' | 'vote' | 'adminAction';
|
||||
@@ -10,7 +10,7 @@ export interface RatingReferenceProps {
|
||||
|
||||
const VALID_TYPES: RatingReferenceType[] = ['race', 'penalty', 'vote', 'adminAction'];
|
||||
|
||||
export class RatingReference implements IValueObject<RatingReferenceProps> {
|
||||
export class RatingReference implements ValueObject<RatingReferenceProps> {
|
||||
readonly type: RatingReferenceType;
|
||||
readonly id: string;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import { IdentityDomainValidationError } from '../errors/IdentityDomainError';
|
||||
|
||||
export interface RatingValueProps {
|
||||
value: number;
|
||||
}
|
||||
|
||||
export class RatingValue implements IValueObject<RatingValueProps> {
|
||||
export class RatingValue implements ValueObject<RatingValueProps> {
|
||||
readonly value: number;
|
||||
|
||||
private constructor(value: number) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
|
||||
export interface UserIdProps {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export class UserId implements IValueObject<UserIdProps> {
|
||||
export class UserId implements ValueObject<UserIdProps> {
|
||||
public readonly props: UserIdProps;
|
||||
|
||||
private constructor(value: string) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
|
||||
/**
|
||||
* Value Object: UserRating
|
||||
@@ -40,7 +40,7 @@ const DEFAULT_DIMENSION: RatingDimension = {
|
||||
lastUpdated: new Date(),
|
||||
};
|
||||
|
||||
export class UserRating implements IValueObject<UserRatingProps> {
|
||||
export class UserRating implements ValueObject<UserRatingProps> {
|
||||
readonly props: UserRatingProps;
|
||||
|
||||
private constructor(props: UserRatingProps) {
|
||||
|
||||
Reference in New Issue
Block a user