@thisisagile/easy
Version:
Straightforward library for building domain-driven microservice architectures
13 lines (10 loc) • 369 B
text/typescript
import { Struct } from './Struct';
import { required } from '../validation/Contraints';
import { Id, toId } from '../types/Id';
import { json, Json } from '../types/Json';
export abstract class Child extends Struct {
() readonly id: Id = this.state.id ?? toId();
protected merge(a: unknown): Json {
return json.merge(this, a, { id: this.id });
}
}