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

@@ -13,7 +13,7 @@ export class Driver implements IEntity<string> {
readonly iracingId: string;
readonly name: string;
readonly country: string;
readonly bio?: string;
readonly bio: string | undefined;
readonly joinedAt: Date;
private constructor(props: {
@@ -92,14 +92,18 @@ export class Driver implements IEntity<string> {
update(props: Partial<{
name: string;
country: string;
bio: string;
bio?: string;
}>): Driver {
const nextName = props.name ?? this.name;
const nextCountry = props.country ?? this.country;
const nextBio = props.bio ?? this.bio;
return new Driver({
id: this.id,
iracingId: this.iracingId,
name: props.name ?? this.name,
country: props.country ?? this.country,
bio: props.bio ?? this.bio,
name: nextName,
country: nextCountry,
...(nextBio !== undefined ? { bio: nextBio } : {}),
joinedAt: this.joinedAt,
});
}