package kz.konturai.parser.config;

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

@Configuration
@ConfigurationProperties(prefix = "targeting")
@Data
public class TargetingApiConfig {
    private FacebookConfig facebook = new FacebookConfig();
    private TiktokConfig tiktok = new TiktokConfig();
    private Double kztUsdRate = 460.0;
    private int insightsSyncIntervalHours = 6;
    private AiConfig ai = new AiConfig();

    @Data
    public static class FacebookConfig {
        private String appId;
        private String appSecret;
        private String graphApiVersion = "v19.0";
        private String oauthRedirectUri;
        private long rateLimitRetryMs = 60000;
        private int maxRetries = 3;
    }

    @Data
    public static class TiktokConfig {
        private String appId;
        private String appSecret;
        private String oauthRedirectUri;
        private String baseUrl = "https://business-api.tiktok.com/open_api/v1.3";
    }

    @Data
    public static class AiConfig {
        private String audienceModel = "gpt-4o";
        private String creativesModel = "gpt-4o";
        private String budgetModel = "gpt-4o-mini";
        private int maxAudienceTokens = 3000;
        private int maxCreativesTokens = 8000;
        private int maxBudgetTokens = 2000;
    }
}
