More models organization
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user