package com.ai.trackwalker.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "rail")
public class RailProperties {
    private Ai ai = new Ai();
    private Storage storage = new Storage();
    private ModelTest modelTest = new ModelTest();
    private ArtifactInstaller artifactInstaller = new ArtifactInstaller();
    private UavAccess uavAccess = new UavAccess();

    public Ai getAi() {
        return ai;
    }

    public void setAi(Ai ai) {
        this.ai = ai;
    }

    public Storage getStorage() {
        return storage;
    }

    public void setStorage(Storage storage) {
        this.storage = storage;
    }

    public ModelTest getModelTest() {
        return modelTest;
    }

    public void setModelTest(ModelTest modelTest) {
        this.modelTest = modelTest;
    }

    public ArtifactInstaller getArtifactInstaller() {
        return artifactInstaller;
    }

    public void setArtifactInstaller(ArtifactInstaller artifactInstaller) {
        this.artifactInstaller = artifactInstaller;
    }

    public UavAccess getUavAccess() {
        return uavAccess;
    }

    public void setUavAccess(UavAccess uavAccess) {
        this.uavAccess = uavAccess;
    }

    public static class Ai {
        private String visionUrl;
        private String pointcloudUrl;

        public String getVisionUrl() {
            return visionUrl;
        }

        public void setVisionUrl(String visionUrl) {
            this.visionUrl = visionUrl;
        }

        public String getPointcloudUrl() {
            return pointcloudUrl;
        }

        public void setPointcloudUrl(String pointcloudUrl) {
            this.pointcloudUrl = pointcloudUrl;
        }
    }

    public static class Storage {
        private String minioEndpoint;
        private String minioAccessKey;
        private String minioSecretKey;
        private String bucket;
        private String testBucket;
        private String artifactBucket;
        private String localFallbackPath;

        public String getMinioEndpoint() {
            return minioEndpoint;
        }

        public void setMinioEndpoint(String minioEndpoint) {
            this.minioEndpoint = minioEndpoint;
        }

        public String getMinioAccessKey() {
            return minioAccessKey;
        }

        public void setMinioAccessKey(String minioAccessKey) {
            this.minioAccessKey = minioAccessKey;
        }

        public String getMinioSecretKey() {
            return minioSecretKey;
        }

        public void setMinioSecretKey(String minioSecretKey) {
            this.minioSecretKey = minioSecretKey;
        }

        public String getBucket() {
            return bucket;
        }

        public void setBucket(String bucket) {
            this.bucket = bucket;
        }

        public String getTestBucket() {
            return testBucket;
        }

        public void setTestBucket(String testBucket) {
            this.testBucket = testBucket;
        }

        public String getArtifactBucket() {
            return artifactBucket;
        }

        public void setArtifactBucket(String artifactBucket) {
            this.artifactBucket = artifactBucket;
        }

        public String getLocalFallbackPath() {
            return localFallbackPath;
        }

        public void setLocalFallbackPath(String localFallbackPath) {
            this.localFallbackPath = localFallbackPath;
        }
    }

    public static class ArtifactInstaller {
        private String url = "http://artifact-installer:8103";
        private String token = "local-artifact-token";
        private int timeoutSeconds = 600;

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }

        public int getTimeoutSeconds() {
            return timeoutSeconds;
        }

        public void setTimeoutSeconds(int timeoutSeconds) {
            this.timeoutSeconds = timeoutSeconds;
        }
    }

    public static class ModelTest {
        private int corePoolSize = 2;
        private int maxPoolSize = 4;
        private int queueCapacity = 100;
        private String devicePool = "gpu-standard";
        private String runtime = "ONNX Runtime / TensorRT";

        public int getCorePoolSize() {
            return corePoolSize;
        }

        public void setCorePoolSize(int corePoolSize) {
            this.corePoolSize = corePoolSize;
        }

        public int getMaxPoolSize() {
            return maxPoolSize;
        }

        public void setMaxPoolSize(int maxPoolSize) {
            this.maxPoolSize = maxPoolSize;
        }

        public int getQueueCapacity() {
            return queueCapacity;
        }

        public void setQueueCapacity(int queueCapacity) {
            this.queueCapacity = queueCapacity;
        }

        public String getDevicePool() {
            return devicePool;
        }

        public void setDevicePool(String devicePool) {
            this.devicePool = devicePool;
        }

        public String getRuntime() {
            return runtime;
        }

        public void setRuntime(String runtime) {
            this.runtime = runtime;
        }
    }

    public static class UavAccess {
        private String url = "http://localhost:8091";
        private String token = "local-uav-access-token";
        private int timeoutSeconds = 60;
        private String eventTopic = "uav.access.events.v1";
        private String eventConsumerGroup = "rail-platform-uav-access-v1";

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }

        public int getTimeoutSeconds() {
            return timeoutSeconds;
        }

        public void setTimeoutSeconds(int timeoutSeconds) {
            this.timeoutSeconds = timeoutSeconds;
        }

        public String getEventTopic() {
            return eventTopic;
        }

        public void setEventTopic(String eventTopic) {
            this.eventTopic = eventTopic;
        }

        public String getEventConsumerGroup() {
            return eventConsumerGroup;
        }

        public void setEventConsumerGroup(String eventConsumerGroup) {
            this.eventConsumerGroup = eventConsumerGroup;
        }
    }
}
