This commit is contained in:
2025-12-12 01:11:36 +01:00
parent ec3ddc3a5c
commit 6a88fe93ab
125 changed files with 1513 additions and 803 deletions

View File

@@ -87,7 +87,7 @@ export class League implements IEntity<string> {
readonly ownerId: string;
readonly settings: LeagueSettings;
readonly createdAt: Date;
readonly socialLinks?: LeagueSocialLinks;
readonly socialLinks: LeagueSocialLinks | undefined;
private constructor(props: {
id: string;
@@ -140,6 +140,8 @@ export class League implements IEntity<string> {
stewarding: defaultStewardingSettings,
};
const socialLinks = props.socialLinks;
return new League({
id: props.id,
name: props.name,
@@ -147,7 +149,7 @@ export class League implements IEntity<string> {
ownerId: props.ownerId,
settings: { ...defaultSettings, ...props.settings },
createdAt: props.createdAt ?? new Date(),
socialLinks: props.socialLinks,
...(socialLinks !== undefined ? { socialLinks } : {}),
});
}
@@ -189,7 +191,7 @@ export class League implements IEntity<string> {
description: string;
ownerId: string;
settings: LeagueSettings;
socialLinks: LeagueSocialLinks | undefined;
socialLinks?: LeagueSocialLinks;
}>): League {
return new League({
id: this.id,
@@ -198,7 +200,11 @@ export class League implements IEntity<string> {
ownerId: props.ownerId ?? this.ownerId,
settings: props.settings ?? this.settings,
createdAt: this.createdAt,
socialLinks: props.socialLinks ?? this.socialLinks,
...(props.socialLinks !== undefined
? { socialLinks: props.socialLinks }
: this.socialLinks !== undefined
? { socialLinks: this.socialLinks }
: {}),
});
}
}