// Package config provides service-specific configuration.
package config

import (
	"os"
	"strings"

	"git.threesix.ai/jordan/slack5-1770603014/pkg/config"
)

// Config extends the base config with preferences-api-specific settings.
type Config struct {
	config.AppConfig
	Server   config.ServerConfig
	Database config.DatabaseConfig
	Logging  config.LoggingConfig

	// Auth
	AuthEnabled bool
	JWTSecret   string
}

// Load reads configuration from environment variables.
func Load() *Config {
	return &Config{
		AppConfig: config.ReadAppConfig(),
		Server:    config.ReadServerConfig(),
		Database:  config.ReadDatabaseConfig(),
		Logging:   config.ReadLoggingConfig(),

		AuthEnabled: strings.EqualFold(os.Getenv("AUTH_ENABLED"), "true"),
		JWTSecret:   os.Getenv("JWT_SECRET"),
	}
}
