package queries

import (
	"bssapp-backend/models"
	"context"
	"log"
)

func GetStatementsHPDF(ctx context.Context, accountCode, startDate, endDate, langCode string, parislemler []string) ([]models.StatementHeader, []string, error) {
	headers, err := getStatementsForPDF(ctx, accountCode, startDate, endDate, langCode, parislemler)
	if err != nil {
		log.Printf("Header query error: %v", err)
		return nil, nil, err
	}

	belgeNos := collectBelgeNos(headers)
	log.Printf("Header rows fetched: %d, belge no count: %d", len(headers), len(belgeNos))
	return headers, belgeNos, nil
}
