import { AggregateRoot } from '@server/shared/src/core/domain/AggregateRoot' ; import { UniqueEntityID } from '@server/shared/src/core/domain/UniqueEntityID' ; import { Guard } from '@server/shared/src/core/logic/Guard' ; import { Result } from '@server/shared/src/core/logic/Result' ; interface ITeamProps { title : string ; } export class Team extends AggregateRoot < ITeamProps > { get title ( ) : string { return this . props . title ; } private constructor ( props , id ? ) { super ( props , id ) ; } public static create ( props , id ? ) { const guardResult = Guard . againstNullOrUndefined ( props . title , 'title' ) ; if ( ! guardResult . succeeded ) { return Result . fail ( guardResult . message ) ; } const team = new Team ( props , id ) ; return Result . ok ( team ) ; } }