diff --git a/src/authors/author.entity.ts b/src/authors/author.entity.ts index a0ffa44d1..51732c6e8 100644 --- a/src/authors/author.entity.ts +++ b/src/authors/author.entity.ts @@ -54,4 +54,18 @@ export class Author { */ @OneToMany(() => Authorship, (authorship) => authorship.author) authorships: Authorship[]; + + // eslint-disable-next-line @typescript-eslint/no-empty-function + private constructor() {} + + public static create( + color: number, + ): Pick { + const newAuthor = new Author(); + newAuthor.color = color; + newAuthor.sessions = []; + newAuthor.user = null; + newAuthor.authorships = []; + return newAuthor; + } }