metis-desk/modules/companies/src/api/domain/value-objects/site-address.vo.ts
2026-10-10 12:01:58 +02:00

13 lines
404 B
TypeScript

import { ValueObject } from "@repo/rdx-ddd";
import { Result } from "@repo/rdx-utils";
export class SiteAddress extends ValueObject<string> {
static create(value: string): Result<SiteAddress, Error> {
const normalized = value.trim();
return normalized && normalized.length <= 10000
? Result.ok(new SiteAddress(normalized))
: Result.fail(new Error("Dirección inválida."));
}
}