package bootstrap

import (
	"time"
	"tm/pkg/config"
)

// Config defines the scraper application configuration
type Config struct {
	Database     config.DatabaseConfig
	Logging      config.LoggingConfig
	TED          ScraperConfig
	Notification config.NotificationConfig
	AlertMail    string `env:"ALERT_MAIL" envDefault:"alerts@opplens.com"`
}

type ScraperConfig struct {
	BaseURL          string        `env:"TED_BASE_URL" envDefault:"https://ted.europa.eu"`
	Timeout          time.Duration `env:"TED_TIMEOUT" envDefault:"30s"`
	MaxRetries       int           `env:"TED_MAX_RETRIES" envDefault:"3"`
	RetryDelay       time.Duration `env:"TED_RETRY_DELAY" envDefault:"5s"`
	UserAgent        string        `env:"TED_USER_AGENT" envDefault:"TM-TED-Scraper/1.0"`
	MaxConcurrency   int           `env:"TED_MAX_CONCURRENCY" envDefault:"5"`
	DownloadDir      string        `env:"TED_DOWNLOAD_DIR" envDefault:"./downloads"`
	CleanupAfter     time.Duration `env:"TED_CLEANUP_AFTER" envDefault:"24h"`
	ScrapingInterval string        `env:"TED_SCRAPING_INTERVAL" envDefault:"* * 10 * * *"`
	OneTime          bool          `env:"TED_ONE_TIME" envDefault:"false"`
	FromDate         string        `env:"TED_FROM_DATE" envDefault:"02/01/2025"`
	ToDate           string        `env:"TED_TO_DATE" envDefault:"13/09/2025"`
	MaxNoticesPerDay int           `env:"TED_MAX_NOTICES_PER_DAY" envDefault:"0"`
}
