inmemory to postgres

This commit is contained in:
2025-12-29 18:34:12 +01:00
parent 9e17d0752a
commit f5639a367f
176 changed files with 10175 additions and 468 deletions

View File

@@ -62,6 +62,31 @@ export class Sponsor implements IEntity<SponsorId> {
});
}
static rehydrate(props: {
id: string;
name: string;
contactEmail: string;
logoUrl?: string;
websiteUrl?: string;
createdAt: Date;
}): Sponsor {
const id = SponsorId.create(props.id);
const name = SponsorName.create(props.name);
const contactEmail = SponsorEmail.create(props.contactEmail);
const logoUrl = props.logoUrl ? Url.create(props.logoUrl) : undefined;
const websiteUrl = props.websiteUrl ? Url.create(props.websiteUrl) : undefined;
const createdAt = SponsorCreatedAt.create(props.createdAt);
return new Sponsor({
id,
name,
contactEmail,
createdAt,
...(logoUrl !== undefined ? { logoUrl } : {}),
...(websiteUrl !== undefined ? { websiteUrl } : {}),
});
}
/**
* Update sponsor information
*/