import { DomainEntity, Percentage, Slug, UniqueID } from "@/core/common/domain";
import { Result } from "@repo/rdx-utils";

interface ITaxProps {
  slug: Slug;
  name: string;
  taxValue: Percentage;
}

interface ITax {
  slug: Slug;
  name: string;
  taxValue: Percentage;
}

export class Tax extends DomainEntity<ITaxProps> implements ITax {
  static create(props: ITaxProps, id?: UniqueID): Result<Tax, Error> {
    return Result.ok(new Tax(props, id));
  }

  get slug(): Slug {
    return this.props.slug;
  }

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

  get taxValue(): Percentage {
    return this.props.taxValue;
  }
}
