bigbuffet-rw/packages/pl-api/lib/entities/location.ts
marcin mikołajczak 036fa32cd3 Add pl-api to workspace
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:43:23 +02:00

23 lines
691 B
TypeScript

import { z } from 'zod';
const locationSchema = z.object({
url: z.string().url().catch(''),
description: z.string().catch(''),
country: z.string().catch(''),
locality: z.string().catch(''),
region: z.string().catch(''),
postal_code: z.string().catch(''),
street: z.string().catch(''),
origin_id: z.string().catch(''),
origin_provider: z.string().catch(''),
type: z.string().catch(''),
timezone: z.string().catch(''),
geom: z.object({
coordinates: z.tuple([z.number(), z.number()]).nullable().catch(null),
srid: z.string().catch(''),
}).nullable().catch(null),
});
type Location = z.infer<typeof locationSchema>;
export { locationSchema, type Location };