Say so when a configured file type matches nothing in a full folder

Melissa's date folders hold .tiff and .txt. A leftover
insurance_file_type of "tif" matches neither - -Filter is exact - so the
run reported "nothing to send" on a folder with six files in it, which
is indistinguishable from an empty folder and is the same blind spot
that hid the .pdf/.tif mismatch for weeks.

It now names what is actually in the folder and which setting to remove:

    Nothing matched .tif, but 20260826\ holds 6 file(s): 3x .tiff, 3x .txt
    -> insurance_file_type is set to 'tif' in entity.json. Remove that
       line to send everything, or correct it.
This commit is contained in:
2026-08-26 20:42:31 -05:00
parent 215db8ab19
commit 490c308830
2 changed files with 14 additions and 3 deletions
+13 -2
View File
@@ -419,8 +419,19 @@ foreach ($practice in $practices) {
Write-Host " $today\ NOT archived - $ignored file(s) were ignored (unconfigured path)." -ForegroundColor Yellow
Write-Info "NOARCHIVE entity=$entityName practice=$pracName reason=$ignored ignored files"
} elseif ($insFiles.Count + $ptStmts.Count -eq 0) {
Write-Host " Nothing to send in $today\ ($fileTypeLabel)." -ForegroundColor Gray
Write-Info "SKIP entity=$entityName practice=$pracName reason=no matching files in date folder"
# A configured file type that matches nothing looks identical to
# an empty folder, which is what "no pdf" hid for weeks. Say so.
$present = @(Get-ChildItem -Path $dateDir -File)
if ($insuranceExt -and $present.Count -gt 0) {
$what = ($present | Group-Object Extension |
ForEach-Object { "$($_.Count)x $($_.Name)" }) -join ", "
Write-Host " Nothing matched .$insuranceExt, but $today\ holds $($present.Count) file(s): $what" -ForegroundColor Yellow
Write-Host " -> insurance_file_type is set to '$insuranceExt' in entity.json. Remove that line to send everything, or correct it." -ForegroundColor Yellow
Write-Info "MISMATCH entity=$entityName practice=$pracName filter=$insuranceExt present=$what"
} else {
Write-Host " Nothing to send in $today\ ($fileTypeLabel)." -ForegroundColor Gray
Write-Info "SKIP entity=$entityName practice=$pracName reason=no matching files in date folder"
}
}
$totalOk += $insResult.Ok; $totalFail += $insResult.Fail