import { z } from 'zod';
import { checkpointTypeSchema } from '../checkpoint/Checkpoint.schema';
import { flagStatusSchema } from './flag/Flag.schema';
import { rgbStatusSchema } from './rgb/RGB.schema';
import { screenStatusSchema } from './screen/Screen.schema';
import { speedStatusSchema } from './speed/Speed.schema';

export const kartHardwareStateSchema = z.object({
  speed: z
    .object({
      status: speedStatusSchema,
      current: z.number(),
      configured: z.number(),
    })
    .nullable(),
  rgb: rgbStatusSchema.nullable(),
  flag: z
    .object({
      status: flagStatusSchema,
      checkpointType: checkpointTypeSchema.nullable(),
      checkpointAddress: z.number().nullable(),
    })
    .nullable(),
  screen: screenStatusSchema.nullable(),
  isConnectedToServer: z.boolean(),
  isSteeringWheelPressed: z.boolean(),
});
