hades-cli
Version:
Hades CLI developer tool
18 lines (15 loc) • 886 B
text/typescript
import { StringValueObject } from '@hades/shared/domain/value-objects/string.value-object';
import { ValidationRules } from '@hades/shared/domain/lib/hades.types';
export class {{ toPascalCase schema.moduleName }}{{ toPascalCase currentProperty.name }} extends StringValueObject
{
public readonly type: '{{ toPascalCase schema.moduleName }}{{ toPascalCase currentProperty.name }}';
constructor(value: string, validationRules: ValidationRules = {})
{
super(value, Object.assign({
name: '{{ toPascalCase schema.moduleName }}{{ toPascalCase currentProperty.name }}',
nullable: {{#if currentProperty.nullable}}true{{else}}false{{/if}},
undefinable: {{#if currentProperty.nullable}}true{{else}}false{{/if}},
{{#if currentProperty.length}}length: {{ currentProperty.length }},{{/if}}
}, validationRules));
}
}