Files
platform/packages/domain/src/models.ts
T

45 lines
1.0 KiB
TypeScript

import { Type as t } from "@sinclair/typebox";
import type { Static } from "@sinclair/typebox";
export enum Attribute {
Strength = "Strength",
Power = "Power",
Endurance = "Endurance",
Agility = "Agility",
}
export enum Activity {
BackSquat = "BackSquat",
Deadlift = "Deadlift",
BenchPress = "BenchPress",
Run = "Run",
BroadJump = "BroadJump",
ConeDrill = "ConeDrill",
}
export enum Gender {
Male = "Male",
Female = "Female",
}
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>;