Public/PayRates/New-AspirePayRate.ps1
|
<#
.SYNOPSIS Creates a new pay rate in the Aspire API. .DESCRIPTION Uses Invoke-AspireRequest to perform a POST request to the /PayRates endpoint. .PARAMETER ContactID The contact ID (required). .PARAMETER EffectiveDate The effective date (required, date-time). .PARAMETER BurdenPercent The burden percent (required, decimal). .PARAMETER HourlyBasePay Optional hourly base pay (decimal). .OUTPUTS The response from the API containing the pay rate details. .EXAMPLE New-AspirePayRate -ContactID 1 -EffectiveDate "2023-01-01T00:00:00" -BurdenPercent 10.0 #> function New-AspirePayRate { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [int]$ContactID, [Parameter(Mandatory = $true)] [string]$EffectiveDate, [Parameter(Mandatory = $true)] [decimal]$BurdenPercent, [decimal]$HourlyBasePay = $null ) $body = @{ ContactID = $ContactID EffectiveDate = $EffectiveDate BurdenPercent = $BurdenPercent } if ($HourlyBasePay) { $body.HourlyBasePay = $HourlyBasePay } return Invoke-AspireRequest -Method POST -Path "/PayRates" -Body $body -ApiVersion $null } |