Public/Companies/New-AspireCompany.ps1

<#
.SYNOPSIS
    Creates a new company in the Aspire API.
.DESCRIPTION
    Uses Invoke-AspireRequest to perform a POST request to the /Companies endpoint.
.PARAMETER CompanyName
    The name of the company (required).
.PARAMETER DeniedTimeEmail
    Optional email for denied time notifications.
.PARAMETER Active
    Optional boolean indicating if the company is active (default: true).
.OUTPUTS
    The response from the API containing the company details.
.EXAMPLE
    New-AspireCompany -CompanyName "Example Company" -Active $true
#>

function New-AspireCompany {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [string]$CompanyName,
        [string]$DeniedTimeEmail = $null,
        [bool]$Active = $true
    )

    $body = @{
        CompanyName = $CompanyName
        Active = $Active
    }

    if ($DeniedTimeEmail) {
        $body.DeniedTimeEmail = $DeniedTimeEmail
    }

    return Invoke-AspireRequest -Method POST -Path "/Companies" -Body $body -ApiVersion $null
}