Public/PaySchedules/Update-AspirePaySchedule.ps1

<#
.SYNOPSIS
    Updates an existing pay schedule in the Aspire API.
.DESCRIPTION
    Uses Invoke-AspireRequest to perform a PUT request to the /PaySchedules endpoint.
.PARAMETER PayScheduleID
    The ID of the pay schedule to update (required).
.PARAMETER PayScheduleName
    The name of the pay schedule (required).
.PARAMETER DailyHoursBeforeOT
    Daily hours before overtime (required, decimal).
.PARAMETER WeeklyHoursBeforeOT
    Weekly hours before overtime (required, decimal).
.PARAMETER Active
    Active status (required, boolean).
.PARAMETER DefaultOTPayCodeID
    Default OT pay code ID (required).
.PARAMETER DefaultPayCodeID
    Default pay code ID (required).
.OUTPUTS
    The response from the API containing the updated pay schedule details.
.EXAMPLE
    Update-AspirePaySchedule -PayScheduleID 1 -PayScheduleName "Updated Schedule" -DailyHoursBeforeOT 8.0 -WeeklyHoursBeforeOT 40.0 -Active $true -DefaultOTPayCodeID 1 -DefaultPayCodeID 2
#>

function Update-AspirePaySchedule {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [int]$PayScheduleID,
        [Parameter(Mandatory = $true)]
        [string]$PayScheduleName,
        [Parameter(Mandatory = $true)]
        [decimal]$DailyHoursBeforeOT,
        [Parameter(Mandatory = $true)]
        [decimal]$WeeklyHoursBeforeOT,
        [Parameter(Mandatory = $true)]
        [bool]$Active,
        [Parameter(Mandatory = $true)]
        [int]$DefaultOTPayCodeID,
        [Parameter(Mandatory = $true)]
        [int]$DefaultPayCodeID
    )

    $body = @{
        PayScheduleID = $PayScheduleID
        PayScheduleName = $PayScheduleName
        DailyHoursBeforeOT = $DailyHoursBeforeOT
        WeeklyHoursBeforeOT = $WeeklyHoursBeforeOT
        Active = $Active
        DefaultOTPayCodeID = $DefaultOTPayCodeID
        DefaultPayCodeID = $DefaultPayCodeID
    }

    return Invoke-AspireRequest -Method PUT -Path "/PaySchedules" -Body $body -ApiVersion $null
}