@kerthin/domain
Version:
Kerthin Domain (based on DDD)
23 lines (16 loc) • 509 B
text/typescript
import { AggregateRoot, Aggregate, ValueObjectProp, OnAction } from '../../lib';
import { Actions } from '../../lib/utils';
import { Name } from './name.value-object';
('definitive')
export class DefinitiveAggregate extends AggregateRoot {
()
name: Name;
static create(data: any): DefinitiveAggregate {
return new DefinitiveAggregate(data);
}
(Actions.ON_CREATE)
create() {
const value = this.name.toValue();
console.log('value', value);
}
}