Uecko_ERP/apps/server/archive/contexts/customer-billing/domain/entities/tax.ts

33 lines
641 B
TypeScript
Raw Normal View History

2025-05-02 21:43:51 +00:00
import { DomainEntity, Percentage, Slug, UniqueID } from "@/core/common/domain";
2025-05-09 10:45:32 +00:00
import { Result } from "@repo/rdx-utils";
2025-02-25 15:25:30 +00:00
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;
}
}