"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.outcomeTrendsQuerySchema = exports.volunteerCreateLocationSchema = exports.volunteerUpdateLocationSchema = exports.adminVisitsSchema = exports.adminActivitySchema = exports.listMyVisitsSchema = exports.walkingRouteSchema = exports.endSessionSchema = exports.startSessionSchema = exports.bulkRecordVisitSchema = exports.recordVisitSchema = void 0;
const zod_1 = require("zod");
const client_1 = require("@prisma/client");
exports.recordVisitSchema = zod_1.z.object({
    addressId: zod_1.z.string().min(1), // Changed from locationId
    outcome: zod_1.z.nativeEnum(client_1.VisitOutcome),
    supportLevel: zod_1.z.nativeEnum(client_1.SupportLevel).optional(),
    signRequested: zod_1.z.boolean().optional().default(false),
    signSize: zod_1.z.string().optional(),
    notes: zod_1.z.string().optional(),
    durationSeconds: zod_1.z.number().int().optional(),
    sessionId: zod_1.z.string().optional(),
    shiftId: zod_1.z.string().optional(),
    updateLocation: zod_1.z.boolean().optional().default(true),
});
exports.bulkRecordVisitSchema = zod_1.z.object({
    locationId: zod_1.z.string().min(1), // Building ID
    outcome: zod_1.z.enum(['NOT_HOME', 'REFUSED', 'MOVED']), // Only non-contact outcomes
    notes: zod_1.z.string().optional(),
    sessionId: zod_1.z.string().optional(),
    shiftId: zod_1.z.string().optional(),
});
exports.startSessionSchema = zod_1.z.object({
    cutId: zod_1.z.string().min(1),
    shiftId: zod_1.z.string().optional(),
    startLatitude: zod_1.z.number().optional(),
    startLongitude: zod_1.z.number().optional(),
});
exports.endSessionSchema = zod_1.z.object({
// no body required — session id from URL
});
exports.walkingRouteSchema = zod_1.z.object({
    excludeVisited: zod_1.z.coerce.boolean().optional().default(false),
    startLatitude: zod_1.z.coerce.number().optional(),
    startLongitude: zod_1.z.coerce.number().optional(),
});
exports.listMyVisitsSchema = 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),
});
exports.adminActivitySchema = 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),
    cutId: zod_1.z.string().optional(),
    userId: zod_1.z.string().optional(),
    outcome: zod_1.z.nativeEnum(client_1.VisitOutcome).optional(),
});
exports.adminVisitsSchema = 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(50),
    cutId: zod_1.z.string().optional(),
    userId: zod_1.z.string().optional(),
    shiftId: zod_1.z.string().optional(),
    outcome: zod_1.z.nativeEnum(client_1.VisitOutcome).optional(),
    sortBy: zod_1.z.enum(['visitedAt', 'outcome']).optional().default('visitedAt'),
    sortOrder: zod_1.z.enum(['asc', 'desc']).optional().default('desc'),
});
exports.volunteerUpdateLocationSchema = zod_1.z.object({
    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(),
    // Admin-only fields (stripped by service for non-admins)
    firstName: zod_1.z.string().nullable().optional(),
    lastName: zod_1.z.string().nullable().optional(),
    address: zod_1.z.string().nullable().optional(),
    unitNumber: zod_1.z.string().nullable().optional(),
    email: zod_1.z.string().email().nullable().optional().or(zod_1.z.literal('')),
    phone: zod_1.z.string().nullable().optional(),
});
exports.volunteerCreateLocationSchema = zod_1.z.object({
    address: zod_1.z.string().min(1, 'Address is required'),
    latitude: zod_1.z.number().min(-90).max(90),
    longitude: zod_1.z.number().min(-180).max(180),
    unitNumber: zod_1.z.string().optional(),
    // USER+ fields (stripped by route for TEMPs)
    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(),
    // Admin-only fields
    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(),
});
exports.outcomeTrendsQuerySchema = zod_1.z.object({
    granularity: zod_1.z.enum(['day', 'week']).default('day'),
    dateFrom: zod_1.z.string().optional(),
    dateTo: zod_1.z.string().optional(),
});
//# sourceMappingURL=canvass.schemas.js.map