Skip to content

Commit

Permalink
feat(alias): support specification of plural vs singular alias
Browse files Browse the repository at this point in the history
  • Loading branch information
uladkasach committed May 16, 2024
1 parent 3d58f37 commit 55f3bc7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/instantiation/DomainObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ export class DomainObject<T extends Record<string, any>> {
*
* 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
Expand Down

0 comments on commit 55f3bc7

Please sign in to comment.