package queries

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

func GetStatementsHPDF(ctx context.Context, accountCode, startDate, endDate string, parislemler []string) ([]models.StatementHeader, []string, error) {
	headers, err := getStatementsForPDF(ctx, accountCode, startDate, endDate, 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
}
