-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenerateSamples.ps1
More file actions
27 lines (21 loc) · 1.07 KB
/
GenerateSamples.ps1
File metadata and controls
27 lines (21 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Function Convert-Addendum {
Param(
[Parameter(mandatory = $true)][string] $Type,
[Parameter(mandatory = $true)][string] $OutFile
)
Write-Host "=========================================================================="
Write-Host "Building $Type -> $OutFile"
$date = Get-Date -Format "yyyy-MM"
$addendum = Get-ChildItem "*addendum*b*.xlsx"
java -jar target\com.softekpanther.cms-0.1.1-SNAPSHOT-standalone.jar $Type status-indicators.csv "$date=$addendum" | Out-File -FilePath $OutFile -Encoding oem
}
Write-Host "Building uberjar"
.\build.cmd
Convert-Addendum "CSV" "sample.csv"
Convert-Addendum "JSON" "sample.json"
Convert-Addendum "SQL" "sample.sql"
# replace empty strings with nulls in JSON, see panther-17125 for more info.
#(Get-Content sample.json) -replace '"PaymentRate":\s*""', '"PaymentRate":null' | Set-Content sample.json
#The latest version of the addendum did not have nulls, so this is not required anymore. Keeping incase it comes back.
$date = Get-Date -Format "yyyy-MM"
Copy-Item .\sample.json ".\PaymentSchedule.$date.json"