package com.ai.trackwalker.capability.api;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;

import java.util.List;
import java.util.Map;

public final class CapabilityRequests {
    private CapabilityRequests() {
    }

    public record CreatePlanRequest(
            @NotBlank String name,
            @NotBlank String planType,
            String triggerType,
            String scheduleRule,
            Map<String, Object> scheduleConfig,
            @NotEmpty List<String> objectIds,
            @NotEmpty List<String> sceneSet,
            String priority,
            String nextRunAt,
            String ownerOrgId,
            String createdBy
    ) {
    }

    public record CreateObjectRequest(
            @NotBlank String objectType,
            @NotBlank String name,
            @NotBlank String lineId,
            String mileageStart,
            String mileageEnd,
            @NotNull Map<String, Object> geometry,
            Map<String, Object> attributes,
            String ownerOrgId,
            String riskLevel,
            Integer inspectionCycleDays,
            String sourceCrs
    ) {
    }

    public record CreateRouteRequest(
            @NotBlank String name,
            String objectId,
            String templateId,
            @NotEmpty List<Map<String, Object>> waypoints,
            Map<String, Object> flightParameters,
            List<Map<String, Object>> payloadActions,
            String createdBy
    ) {
    }

    public record CreateConnectionRequest(
            @NotBlank String name,
            @NotBlank String vendorCode,
            @NotBlank String connectionMode,
            @NotBlank String environment,
            String endpointUrl,
            String workspaceId,
            String secretRef,
            Boolean enabled
    ) {
    }

    public record DispatchMissionRequest(
            @NotBlank String taskId,
            String routeId,
            @NotBlank String connectionId,
            @NotBlank String deviceId,
            String dockId,
            String plannedStartAt,
            String idempotencyKey,
            String requestedBy
    ) {
    }

    public record MissionCommandRequest(
            @NotBlank String command,
            String reason,
            String idempotencyKey,
            String requestedBy,
            Long expectedMissionVersion,
            Map<String, Object> parameters
    ) {
    }

    public record CreateUploadSessionRequest(
            String taskId,
            String missionId,
            @NotBlank String resourceType,
            @NotBlank String fileName,
            String contentType,
            long totalSizeBytes,
            Long partSizeBytes,
            String expectedSha256,
            String createdBy
    ) {
    }

    public record WorkOrderActionRequest(
            @NotBlank String action,
            String operatorId,
            String operatorName,
            String result,
            String comment,
            Map<String, Object> metadata
    ) {
    }

    public record CreateReinspectionRequest(
            String requestedBy,
            String routeId,
            List<String> requiredMethods
    ) {
    }

    public record CreateArchiveRequest(
            @NotBlank String businessType,
            @NotBlank String businessId,
            String createdBy
    ) {
    }
}
