Add staff types & db schema

This commit is contained in:
Zoe Roux
2025-03-09 19:08:10 +01:00
parent 06458adc31
commit bcec4c31d1
5 changed files with 117 additions and 15 deletions
+34
View File
@@ -0,0 +1,34 @@
import { t } from "elysia";
import { DbMetadata, ExternalId, Image, Resource } from "./utils";
export const Character = t.Object({
name: t.String(),
latinName: t.String(),
image: t.Nullable(Image),
});
export type Character = typeof Character.static;
export const Role = t.Object({
kind: t.UnionEnum([
"actor",
"director",
"writter",
"producer",
"music",
"other",
]),
character: t.Nullable(Character),
});
export type Role = typeof Role.static;
export const Staff = t.Intersect([
Resource(),
t.Object({
name: t.String(),
latinName: t.String(),
image: t.Nullable(Image),
externalId: ExternalId(),
}),
DbMetadata,
]);
export type Staff = typeof Staff.static;