This commit is contained in:
2025-12-11 13:50:38 +01:00
parent e4c1be628d
commit c7e5de40d6
212 changed files with 2965 additions and 763 deletions

View File

@@ -1,10 +1,12 @@
/**
* Domain Entity: Achievement
*
*
* Represents an achievement that can be earned by users.
* Achievements are categorized by role (driver, steward, admin) and type.
*/
import type { IEntity } from '@gridpilot/shared/domain';
export type AchievementCategory = 'driver' | 'steward' | 'admin' | 'community';
export type AchievementRarity = 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary';
@@ -30,7 +32,7 @@ export interface AchievementRequirement {
operator: '>=' | '>' | '=' | '<' | '<=';
}
export class Achievement {
export class Achievement implements IEntity<string> {
readonly id: string;
readonly name: string;
readonly description: string;

View File

@@ -6,8 +6,8 @@
*/
import { UserId } from '../value-objects/UserId';
import type { EmailValidationResult } from '../value-objects/EmailAddress';
import { validateEmail } from '../value-objects/EmailAddress';
import type { EmailValidationResult } from '../types/EmailAddress';
import { validateEmail } from '../types/EmailAddress';
export interface SponsorAccountProps {
id: UserId;

View File

@@ -1,5 +1,5 @@
import type { EmailValidationResult } from '../value-objects/EmailAddress';
import { validateEmail } from '../value-objects/EmailAddress';
import type { EmailValidationResult } from '../types/EmailAddress';
import { validateEmail } from '../types/EmailAddress';
import { UserId } from '../value-objects/UserId';
export interface UserProps {

View File

@@ -1,9 +1,11 @@
/**
* Domain Entity: UserAchievement
*
*
* Represents an achievement earned by a specific user.
*/
import type { IEntity } from '@gridpilot/shared/domain';
export interface UserAchievementProps {
id: string;
userId: string;
@@ -13,7 +15,7 @@ export interface UserAchievementProps {
progress?: number; // For partial progress tracking (0-100)
}
export class UserAchievement {
export class UserAchievement implements IEntity<string> {
readonly id: string;
readonly userId: string;
readonly achievementId: string;