generator-codedesignplus
Version:
Yeoman generator for creating microservices based on the CodeDesignPlus.Net.Microservice archetype.
23 lines (17 loc) • 638 B
JavaScript
import { toPascalCase, BaseModel } from "./base.mjs";
export class DomainEventModel extends BaseModel {
constructor(domainEvent) {
super();
this.sufix = 'DomainEvent';
this.name = this._validate(domainEvent, this.sufix);
this.fullname = `${this.name}${this.sufix}`;
this.file = `${this.fullname}.cs`;
}
static from(value) {
if(!value)
return [];
if (typeof value === 'string' && value.includes(','))
return value.split(',').map(x => new DomainEventModel(toPascalCase(x)));
return [new DomainEventModel(toPascalCase(value))];
}
}