From 55f3bc79d944a596839e584c86b8364044b1abc7 Mon Sep 17 00:00:00 2001 From: Ulad Kasach Date: Thu, 16 May 2024 07:38:50 -0400 Subject: [PATCH] feat(alias): support specification of plural vs singular alias --- src/instantiation/DomainObject.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/instantiation/DomainObject.ts b/src/instantiation/DomainObject.ts index e98485f..01771d1 100644 --- a/src/instantiation/DomainObject.ts +++ b/src/instantiation/DomainObject.ts @@ -33,11 +33,15 @@ export class DomainObject> { * * When set, declares the alias via which domain objects of this class are known to be referred to. * + * For example + * - PlantPot.alias = 'pot' + * - Bird.alias = { singular: 'bird', plural: 'flock' } + * * Relevance * - formalizes that we can expect to see the dobj referred to by this alias * - enables code generators to use this colloquial alias in contracts for better devex */ - public static alias?: string; + public static alias?: string | { plural?: string; singular?: string }; /** * DomainObject.schema