UNPKG

hades-cli

Version:
17 lines (15 loc) 911 B
import { PasswordValueObject } from '@hades/shared/domain/value-objects/password.value-object'; import { DataValueObject, ValidationRules } from '@hades/shared/domain/lib/hades.types'; export class {{ toPascalCase schema.moduleName }}{{ toPascalCase currentProperty.name }} extends PasswordValueObject { public readonly type: '{{ toPascalCase schema.moduleName }}{{ toPascalCase currentProperty.name }}'; constructor(value: string, validationRules: ValidationRules = {}, data: DataValueObject = {}) { 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}}, maxLength: {{ currentProperty.maxLength }}, }, validationRules), data); } }