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

import (
	"os"
	"strings"

	"{{GO_MODULE}}/pkg/config"
)

// Config extends the base config with {{COMPONENT_NAME}}-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"),
	}
}
