Uecko_ERP/apps/server/archive/contexts/customer-billing/domain/entities/tax.ts
2025-05-09 12:45:32 +02:00

33 lines
641 B
TypeScript

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;
}
}