metis-desk/modules/companies/src/api/domain/intervention-revision.entity.ts

27 lines
818 B
TypeScript
Raw Normal View History

2026-10-08 14:43:34 +00:00
import type { UniqueID } from "@repo/rdx-ddd";
import { DomainEntity } from "@repo/rdx-ddd";
2026-10-07 11:03:01 +00:00
2026-10-09 08:38:19 +00:00
import type { InterventionValues } from "./value-objects/intervention-values.vo";
2026-10-07 11:03:01 +00:00
export type InterventionRevisionProps = Readonly<{
values: InterventionValues;
actorId: UniqueID;
recordedAt: string;
}>;
export class InterventionRevision extends DomainEntity<InterventionRevisionProps> {
static create(props: InterventionRevisionProps) {
return new InterventionRevision(Object.freeze({ ...props }));
}
static rehydrate(props: InterventionRevisionProps, id: UniqueID) {
return new InterventionRevision(Object.freeze({ ...props }), id);
}
get values() {
return this.props.values;
}
get actorId() {
return this.props.actorId;
}
get recordedAt() {
return this.props.recordedAt;
}
}