import { AggregateRoot, UniqueID } from "@repo/rdx-ddd";
import { Result } from "@repo/rdx-utils";

export interface I{{pascalCase name}}Props {
  name: string;
}

export class {{pascalCase name}} extends AggregateRoot<I{{pascalCase name}}Props> {
  static create(props: I{{pascalCase name}}Props, id?: UniqueID): Result<{{pascalCase name}}, Error> {
    const entity = new {{pascalCase name}}(props, id);
    return Result.ok(entity);
  }

  get name(): string {
    return this.props.name;
  }
}
