diff --git a/README.md b/README.md index deca28b7..127a56ee 100644 --- a/README.md +++ b/README.md @@ -670,6 +670,7 @@ In this section, we describe all data related to educational videos to be shown |title|LocalizedText|e.g. "Beta Blockers for Heart Failure"|May be localized.| |youtubeId|LocalizedText|e.g. "XfgcXkq61k0"|Contains the video id from YouTube.| |orderIndex|integer|e.g. 1|Since Firestore collections aren't necessarily ordered, we have this property to order the elements by on the clients. The list is supposed to be ordered ascending by `orderIndex`.| +|description|LocalizedText|-|Describes the content of the video; to be shown underneath the video.| Embed links for YouTube: `https://youtube.com/embed/${youtubeId}`. Short links for YouTube: `https://youtu.be/${youtubeId}`. diff --git a/functions/models/src/types/video.ts b/functions/models/src/types/video.ts index b9e8aee1..eeb859b9 100644 --- a/functions/models/src/types/video.ts +++ b/functions/models/src/types/video.ts @@ -19,14 +19,14 @@ export const videoConverter = new Lazy( title: localizedTextConverter.schema, youtubeId: localizedTextConverter.schema, orderIndex: z.number(), - description: z.string(), + description: localizedTextConverter.schema, }) .transform((content) => new Video(content)), encode: (object) => ({ title: localizedTextConverter.encode(object.title), youtubeId: localizedTextConverter.encode(object.youtubeId), orderIndex: object.orderIndex, - description: object.description, + description: localizedTextConverter.encode(object.description), }), }), ) @@ -37,7 +37,7 @@ export class Video { readonly title: LocalizedText readonly youtubeId: LocalizedText readonly orderIndex: number - readonly description: string + readonly description: LocalizedText // Constructor @@ -45,7 +45,7 @@ export class Video { title: LocalizedText youtubeId: LocalizedText orderIndex: number - description: string + description: LocalizedText }) { this.title = input.title this.youtubeId = input.youtubeId diff --git a/functions/src/services/seeding/staticData/staticDataService.ts b/functions/src/services/seeding/staticData/staticDataService.ts index b65a3c9d..cadef968 100644 --- a/functions/src/services/seeding/staticData/staticDataService.ts +++ b/functions/src/services/seeding/staticData/staticDataService.ts @@ -127,7 +127,7 @@ export class StaticDataService extends SeedingService { title: localizedTextConverter.schema, youtubeId: localizedTextConverter.schema, orderIndex: z.number(), - description: z.string(), + description: localizedTextConverter.schema, }) .array(), }),