Lesson: ZodDiscriminatedUnion<
[
ZodObject<
{
kind: ZodLiteral<"reading">;
id: $ZodBranded<ZodUUID, "LessonId", "out">;
courseId: $ZodBranded<ZodUUID, "CourseId", "out">;
moduleId: $ZodBranded<ZodUUID, "ModuleId", "out">;
sequence: ZodNumber;
title: ZodString;
body: ZodString;
},
$strip,
>,
ZodObject<
{
kind: ZodLiteral<"video">;
id: $ZodBranded<ZodUUID, "LessonId", "out">;
courseId: $ZodBranded<ZodUUID, "CourseId", "out">;
moduleId: $ZodBranded<ZodUUID, "ModuleId", "out">;
sequence: ZodNumber;
title: ZodString;
description: ZodString;
source: ZodString;
durationSeconds: ZodNumber;
poster: ZodOptional<ZodString>;
uploadDate: ZodOptional<ZodISODate>;
},
$strip,
>,
],
"kind",
> = ...
The Lesson discriminated union. Adding new kinds (quiz, speaking, ...) is done by extending the union, not by introducing a parallel hierarchy.