import { IValueObject } from '@core/shared/domain'; import { AdminDomainValidationError } from '../errors/AdminDomainError'; export type UserStatusValue = string; export interface UserStatusProps { value: UserStatusValue; } export class UserStatus implements IValueObject { readonly value: UserStatusValue; private constructor(value: UserStatusValue) { this.value = value; } static create(value: UserStatusValue): UserStatus { // Handle null/undefined if (value === null || value === undefined) { throw new AdminDomainValidationError('Status cannot be empty'); } const trimmed = value.trim(); if (!trimmed) { throw new AdminDomainValidationError('Status cannot be empty'); } return new UserStatus(trimmed); } static fromString(value: string): UserStatus { return this.create(value); } get props(): UserStatusProps { return { value: this.value }; } toString(): UserStatusValue { return this.value; } equals(other: IValueObject): boolean { return this.value === other.props.value; } isActive(): boolean { return this.value === 'active'; } isSuspended(): boolean { return this.value === 'suspended'; } isDeleted(): boolean { return this.value === 'deleted'; } }