"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.boundsQuerySchema = exports.bulkImportSchema = exports.reverseGeocodeSchema = exports.bulkDeleteSchema = exports.geocodeAddressSchema = exports.locationIdSchema = exports.listLocationsSchema = exports.updateLocationSchema = exports.createLocationSchema = void 0;
const zod_1 = require("zod");
const client_1 = require("@prisma/client");
exports.createLocationSchema = zod_1.z.object({
    address: zod_1.z.string().min(1, 'Address is required'),
    firstName: zod_1.z.string().optional(),
    lastName: zod_1.z.string().optional(),
    email: zod_1.z.string().email().optional().or(zod_1.z.literal('')),
    phone: zod_1.z.string().optional(),
    unitNumber: zod_1.z.string().optional(),
    supportLevel: zod_1.z.nativeEnum(client_1.SupportLevel).optional(),
    sign: zod_1.z.boolean().optional().default(false),
    signSize: zod_1.z.string().optional(),
    notes: zod_1.z.string().optional(),
    buildingNotes: zod_1.z.string().max(2000, 'Building notes must be 2000 characters or less').optional(),
    latitude: zod_1.z.number().min(-90).max(90).optional(),
    longitude: zod_1.z.number().min(-180).max(180).optional(),
});
exports.updateLocationSchema = zod_1.z.object({
    // Location fields
    address: zod_1.z.string().min(1).optional(),
    latitude: zod_1.z.number().min(-90).max(90).nullable().optional(),
    longitude: zod_1.z.number().min(-180).max(180).nullable().optional(),
    postalCode: zod_1.z.string().nullable().optional(),
    province: zod_1.z.string().nullable().optional(),
    buildingType: zod_1.z.nativeEnum(client_1.BuildingType).nullable().optional(),
    buildingNotes: zod_1.z.string().max(2000, 'Building notes must be 2000 characters or less').nullable().optional(),
    // Address fields (will update first address)
    firstName: zod_1.z.string().nullable().optional(),
    lastName: zod_1.z.string().nullable().optional(),
    email: zod_1.z.string().email().optional().or(zod_1.z.literal('')).nullable().optional(),
    phone: zod_1.z.string().nullable().optional(),
    unitNumber: zod_1.z.string().nullable().optional(),
    supportLevel: zod_1.z.nativeEnum(client_1.SupportLevel).nullable().optional(),
    sign: zod_1.z.boolean().optional(),
    signSize: zod_1.z.string().nullable().optional(),
    notes: zod_1.z.string().nullable().optional(),
});
exports.listLocationsSchema = zod_1.z.object({
    page: zod_1.z.coerce.number().int().positive().default(1),
    limit: zod_1.z.coerce.number().int().positive().max(100).default(20),
    search: zod_1.z.string().optional(),
    supportLevel: zod_1.z.nativeEnum(client_1.SupportLevel).optional(),
    hasSign: zod_1.z.coerce.boolean().optional(),
    confidenceLevel: zod_1.z.enum(['high', 'medium', 'low', 'none']).optional(),
    sortBy: zod_1.z.enum(['createdAt', 'address', 'supportLevel']).optional().default('createdAt'),
    sortOrder: zod_1.z.enum(['asc', 'desc']).optional().default('desc'),
});
exports.locationIdSchema = zod_1.z.object({
    id: zod_1.z.string().min(1),
});
exports.geocodeAddressSchema = zod_1.z.object({
    address: zod_1.z.string().min(1, 'Address is required'),
});
exports.bulkDeleteSchema = zod_1.z.object({
    ids: zod_1.z.array(zod_1.z.string().min(1)).min(1, 'At least one ID is required'),
});
exports.reverseGeocodeSchema = zod_1.z.object({
    latitude: zod_1.z.number().min(-90).max(90),
    longitude: zod_1.z.number().min(-180).max(180),
});
exports.bulkImportSchema = zod_1.z.object({
    format: zod_1.z.enum(['standard', 'nar']).default('standard'),
    filterType: zod_1.z.enum(['none', 'cut', 'mapArea', 'city', 'province']).default('none'),
    cutId: zod_1.z.string().optional(),
    filterCity: zod_1.z.string().optional(),
    filterProvince: zod_1.z.string().optional(),
    residentialOnly: zod_1.z.coerce.boolean().default(false),
    deduplicateRadius: zod_1.z.coerce.number().min(0).max(100).default(5),
    skipGeocoding: zod_1.z.coerce.boolean().default(true),
    batchSize: zod_1.z.coerce.number().int().min(100).max(5000).default(1000),
});
exports.boundsQuerySchema = zod_1.z.object({
    minLat: zod_1.z.coerce.number().min(-90).max(90),
    maxLat: zod_1.z.coerce.number().min(-90).max(90),
    minLng: zod_1.z.coerce.number().min(-180).max(180),
    maxLng: zod_1.z.coerce.number().min(-180).max(180),
});
//# sourceMappingURL=locations.schemas.js.map