package main

import (
	"fmt"
	"log"

	"verification-platform-backend/internal/database"
	"verification-platform-backend/internal/model"
)

func main() {
	database.Init()
	db := database.DB

	var packages []model.Package
	if err := db.Find(&packages).Error; err != nil {
		log.Fatal("Failed to get packages:", err)
	}

	fmt.Println("=== Packages ===")
	for _, pkg := range packages {
		fmt.Printf("ID: %d, Name: %s, NameEn: %s, DescriptionEn: %s\n", pkg.ID, pkg.Name, pkg.NameEn, pkg.DescriptionEn)
	}

	var categories []model.DocCategory
	if err := db.Find(&categories).Error; err != nil {
		log.Fatal("Failed to get categories:", err)
	}

	fmt.Println("\n=== Doc Categories ===")
	for _, cat := range categories {
		fmt.Printf("ID: %d, Name: %s, NameEn: %s, DescriptionEn: %s\n", cat.ID, cat.Name, cat.NameEn, cat.DescriptionEn)
	}

	var docs []model.Doc
	if err := db.Find(&docs).Error; err != nil {
		log.Fatal("Failed to get docs:", err)
	}

	fmt.Println("\n=== Docs ===")
	for _, doc := range docs {
		fmt.Printf("ID: %d, Title: %s, TitleEn: %s, ContentEn: %d chars\n", doc.ID, doc.Title, doc.TitleEn, len(doc.ContentEn))
	}
}
