package gc.mda.kcg.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Getter
@Setter
@Configuration
@ConfigurationProperties(prefix = "app")
public class AppProperties {

    private Jwt jwt = new Jwt();
    private Google google = new Google();
    private Auth auth = new Auth();
    private Collector collector = new Collector();

    @Getter
    @Setter
    public static class Jwt {
        private String secret;
        private long expirationMs;
    }

    @Getter
    @Setter
    public static class Google {
        private String clientId;
    }

    @Getter
    @Setter
    public static class Auth {
        private String allowedDomain;
    }

    @Getter
    @Setter
    public static class Collector {
        private String airplanesLiveBaseUrl = "https://api.airplanes.live/v2";
        private String openSkyBaseUrl = "https://opensky-network.org/api";
        private String openSkyAuthUrl = "https://auth.opensky-network.org/auth/realms/opensky-network/protocol/openid-connect/token";
        private String openSkyClientId;
        private String openSkyClientSecret;
        private String gdeltBaseUrl = "https://api.gdeltproject.org/api/v2/doc/doc";
        private String googleNewsBaseUrl = "https://news.google.com/rss/search";
        private String celestrakBaseUrl = "https://celestrak.org/NORAD/elements/gp.php";
        private String predictionBaseUrl = "http://localhost:8001";
        private int requestDelayMs = 1500;
        private int backoffMs = 5000;
    }
}
