import { z } from 'zod';

export const PublicStatsSchema = z.object({
  guildCount: z.number().int().nonnegative(),
  approximateUserCount: z.number().int().nonnegative(),
  updatedAt: z.string()
});

export type PublicStats = z.infer<typeof PublicStatsSchema>;

export const BotStatusShardSchema = z.object({
  id: z.number().int().nonnegative(),
  status: z.string(),
  guildCount: z.number().int().nonnegative(),
  ping: z.number()
});

export const BotStatusPayloadSchema = z.object({
  shards: z.array(BotStatusShardSchema),
  apiLatencyMs: z.number(),
  guildCount: z.number().int().nonnegative(),
  uptimeSeconds: z.number(),
  updatedAt: z.string()
});

export type BotStatusPayload = z.infer<typeof BotStatusPayloadSchema>;

export const BOT_STATUS_REDIS_KEY = 'bot:status';
