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

33 lines
635 B
TypeScript
Raw Normal View History

2025-02-25 15:25:30 +00:00
import { DomainEntity, Percentage, Slug, UniqueID } from "@common/domain";
import { Result } from "@common/helpers";
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;
}
}