const fs = require('fs');
const data = JSON.parse(fs.readFileSync('dist/data/admin@mikrobil.com.json', 'utf8'));

console.log("Vouchers count:", data.vouchers ? data.vouchers.length : 0);
if (data.vouchers && data.vouchers.length > 0) {
  console.log("First 5 vouchers:", data.vouchers.slice(0, 5));
  
  // Let's filter vouchers that have status = used and check their created_at dates
  const usedVouchers = data.vouchers.filter(v => v.status === 'used');
  console.log("Total used vouchers:", usedVouchers.length);
  
  // Group used vouchers by created_at date (Y-m-d)
  const grouped = {};
  usedVouchers.forEach(v => {
    if (v.created_at) {
      const date = v.created_at.substring(0, 10);
      grouped[date] = (grouped[date] || 0) + 1;
    }
  });
  console.log("Used vouchers grouped by date:", grouped);
}
