import { Type, type Static } from "@sinclair/typebox";

export const ReverseGeocodeRequestSchema = Type.Object({
  latitude: Type.Number({ maximum: 90, minimum: -90 }),
  longitude: Type.Number({ maximum: 180, minimum: -180 }),
}, { additionalProperties: false, $id: "ReverseGeocodeRequest" });

export const ReverseGeocodeResponseSchema = Type.Object({
  formatted_value: Type.String({ maxLength: 200, minLength: 1 }),
  service_mode: Type.Union([Type.Literal("mock"), Type.Literal("real")]),
  status: Type.Literal("resolved"),
}, { additionalProperties: false, $id: "ReverseGeocodeResponse" });

export type ReverseGeocodeRequest = Static<typeof ReverseGeocodeRequestSchema>;
export type ReverseGeocodeResponse = Static<typeof ReverseGeocodeResponseSchema>;
