More models organization

This commit is contained in:
Dominic Ferrando
2026-07-04 15:57:20 -04:00
parent a7b8dd0bea
commit 28c5b3df18
9 changed files with 148 additions and 134 deletions
+16 -17
View File
@@ -1,4 +1,4 @@
import { Type } from "@sinclair/typebox";
import { Type as t } from "@sinclair/typebox";
import type { Static } from "@sinclair/typebox";
export enum Attribute {
@@ -22,24 +22,23 @@ export enum Gender {
Female = "Female",
}
export const MetricsSchema = Type.Object({
age: Type.Number(),
weight: Type.Number(),
gender: Type.Enum(Gender),
});
export const PlayerSchema = Type.Object({
name: Type.Optional(Type.String()),
metrics: MetricsSchema,
});
export const ActivityPerformanceSchema = Type.Object({
activity: Type.Enum(Activity),
performance: Type.Number(),
});
export type StandardUnit = "ms" | "cm" | "kg";
export const MetricsSchema = t.Object({
age: t.Number(),
weight: t.Number(),
gender: t.Enum(Gender),
});
export type Metrics = Static<typeof MetricsSchema>;
export const PlayerSchema = t.Object({
name: t.Optional(t.String()),
metrics: MetricsSchema,
});
export type Player = Static<typeof PlayerSchema>;
export const ActivityPerformanceSchema = t.Object({
activity: t.Enum(Activity),
performance: t.Number(),
});
export type ActivityPerformance = Static<typeof ActivityPerformanceSchema>;