param(
  [string]$Config = "D:\projects\skills\vip-report\config.yaml",
  [string]$DownloadDir = "C:\vipdata",
  [string]$ReportMonth = "",
  [int]$ReportYear = 0,
  [string]$Session = "vip-report-monthly-sales"
)

$ErrorActionPreference = "Stop"
$root = Split-Path -Parent $PSScriptRoot

$args = @(
  "$root\scripts\sync_vis_live_session_downloads.py",
  "--config", $Config,
  "--download-dir", $DownloadDir,
  "--session", $Session
)

if ($ReportMonth -ne "") {
  $args += @("--report-month", $ReportMonth)
}
if ($ReportYear -gt 0) {
  $args += @("--report-year", [string]$ReportYear)
}

python @args

