package main

import (
	"log"

	"customer-support-system/internal/database"
	"customer-support-system/pkg/config"
	"customer-support-system/pkg/logger"
)

func main() {
	// Load configuration
	if err := config.LoadConfig(); err != nil {
		log.Fatalf("Failed to load configuration: %v", err)
	}

	// Initialize logger
	logger.InitLogger()

	// Connect to database
	if err := database.Connect(); err != nil {
		logger.WithError(err).Fatal("Failed to connect to database")
	}

	// Seed database with initial data
	if err := database.SeedDatabase(); err != nil {
		logger.WithError(err).Fatal("Failed to seed database")
	}

	logger.Info("Database seeded successfully")

	// Close database connection
	if err := database.Close(); err != nil {
		logger.WithError(err).Error("Failed to close database connection")
	}
}
