import { Entity } from '../../../../shared/domain/Entity'; import { UniqueId } from '../../../../shared/domain/UniqueId'; export interface TOTPSecretProps { userId: string; secret: string; verified: boolean; createdAt: Date; } export class TOTPSecret extends Entity { static create(props: TOTPSecretProps, id?: UniqueId): TOTPSecret { return new TOTPSecret(props, id ?? UniqueId.create()); } static reconstitute(props: TOTPSecretProps, id: UniqueId): TOTPSecret { return new TOTPSecret(props, id); } get userId(): string { return this.props.userId; } get secret(): string { return this.props.secret; } get verified(): boolean { return this.props.verified; } get createdAt(): Date { return this.props.createdAt; } verify(): void { this.props.verified = true; } }