Trendsic Platform Service

<back to all web services

KpiV2BranchRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/dashboard/kpiv2/branch
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class SvcNamedTime implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var int */
        public int $SignedSec=0,
        /** @var int */
        public int $Served=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['SignedSec'])) $this->SignedSec = $o['SignedSec'];
        if (isset($o['Served'])) $this->Served = $o['Served'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->SignedSec)) $o['SignedSec'] = $this->SignedSec;
        if (isset($this->Served)) $o['Served'] = $this->Served;
        return empty($o) ? new class(){} : $o;
    }
}

class SvcTint implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Field=null,
        /** @var string|null */
        public ?string $Tone=null,
        /** @var string|null */
        public ?string $Reason=null,
        /** @var float|null */
        public ?float $Value=null,
        /** @var float|null */
        public ?float $Reference=null,
        /** @var float|null */
        public ?float $BranchValue=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Field'])) $this->Field = $o['Field'];
        if (isset($o['Tone'])) $this->Tone = $o['Tone'];
        if (isset($o['Reason'])) $this->Reason = $o['Reason'];
        if (isset($o['Value'])) $this->Value = $o['Value'];
        if (isset($o['Reference'])) $this->Reference = $o['Reference'];
        if (isset($o['BranchValue'])) $this->BranchValue = $o['BranchValue'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Field)) $o['Field'] = $this->Field;
        if (isset($this->Tone)) $o['Tone'] = $this->Tone;
        if (isset($this->Reason)) $o['Reason'] = $this->Reason;
        if (isset($this->Value)) $o['Value'] = $this->Value;
        if (isset($this->Reference)) $o['Reference'] = $this->Reference;
        if (isset($this->BranchValue)) $o['BranchValue'] = $this->BranchValue;
        return empty($o) ? new class(){} : $o;
    }
}

class SvcMetrics implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Checkins=0,
        /** @var int */
        public int $Walkins=0,
        /** @var int */
        public int $Appts=0,
        /** @var int */
        public int $Served=0,
        /** @var int */
        public int $NoShows=0,
        /** @var int */
        public int $ApptNoShows=0,
        /** @var int */
        public int $CancelledAtWindow=0,
        /** @var int */
        public int $Abandoned=0,
        /** @var int */
        public int $Called=0,
        /** @var int */
        public int $CalledUp=0,
        /** @var float|null */
        public ?float $AbandonRate=null,
        /** @var float|null */
        public ?float $NoShowRate=null,
        /** @var float|null */
        public ?float $AvgServiceSec=null,
        /** @var float|null */
        public ?float $MedianServiceSec=null,
        /** @var float|null */
        public ?float $AvgWaitSec=null,
        /** @var int */
        public int $MaxWaitSec=0,
        /** @var float|null */
        public ?float $AvgWalkUpSec=null,
        /** @var float|null */
        public ?float $ExpectedServiceSec=null,
        /** @var int */
        public int $SignedSec=0,
        /** @var int */
        public int $ServingSec=0,
        /** @var int */
        public int $PausedSec=0,
        /** @var int */
        public int $IdleSec=0,
        /** @var int */
        public int $UnstaffedSec=0,
        /** @var float|null */
        public ?float $Utilization=null,
        /** @var float|null */
        public ?float $IdleShare=null,
        /** @var float|null */
        public ?float $PausedShare=null,
        /** @var int */
        public int $Sessions=0,
        /** @var int */
        public int $OpenDays=0,
        /** @var float|null */
        public ?float $FeesEarned=null,
        /** @var float|null */
        public ?float $AvgFee=null,
        /** @var float|null */
        public ?float $FeesPerStaffedHour=null,
        /** @var float|null */
        public ?float $ExpectedFeesPerStaffedHour=null,
        /** @var float|null */
        public ?float $LaborCost=null,
        /** @var bool|null */
        public ?bool $LaborPartial=null,
        /** @var array<string>|null */
        public ?array $MissingCostEmployeeIds=null,
        /** @var array<SvcNamedTime>|null */
        public ?array $MissingCost=null,
        /** @var bool|null */
        public ?bool $LaborLocked=null,
        /** @var float|null */
        public ?float $Contribution=null,
        /** @var float|null */
        public ?float $LostFees=null,
        /** @var float|null */
        public ?float $LostNoShowFees=null,
        /** @var array<string,int>|null */
        public ?array $Mix=null,
        /** @var int[]|null */
        public ?array $HourlyServed=null,
        /** @var float[]|null */
        public ?array $HourlyFees=null,
        /** @var float[]|null */
        public ?array $HourlyCost=null,
        /** @var array<SvcTint>|null */
        public ?array $Tints=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Checkins'])) $this->Checkins = $o['Checkins'];
        if (isset($o['Walkins'])) $this->Walkins = $o['Walkins'];
        if (isset($o['Appts'])) $this->Appts = $o['Appts'];
        if (isset($o['Served'])) $this->Served = $o['Served'];
        if (isset($o['NoShows'])) $this->NoShows = $o['NoShows'];
        if (isset($o['ApptNoShows'])) $this->ApptNoShows = $o['ApptNoShows'];
        if (isset($o['CancelledAtWindow'])) $this->CancelledAtWindow = $o['CancelledAtWindow'];
        if (isset($o['Abandoned'])) $this->Abandoned = $o['Abandoned'];
        if (isset($o['Called'])) $this->Called = $o['Called'];
        if (isset($o['CalledUp'])) $this->CalledUp = $o['CalledUp'];
        if (isset($o['AbandonRate'])) $this->AbandonRate = $o['AbandonRate'];
        if (isset($o['NoShowRate'])) $this->NoShowRate = $o['NoShowRate'];
        if (isset($o['AvgServiceSec'])) $this->AvgServiceSec = $o['AvgServiceSec'];
        if (isset($o['MedianServiceSec'])) $this->MedianServiceSec = $o['MedianServiceSec'];
        if (isset($o['AvgWaitSec'])) $this->AvgWaitSec = $o['AvgWaitSec'];
        if (isset($o['MaxWaitSec'])) $this->MaxWaitSec = $o['MaxWaitSec'];
        if (isset($o['AvgWalkUpSec'])) $this->AvgWalkUpSec = $o['AvgWalkUpSec'];
        if (isset($o['ExpectedServiceSec'])) $this->ExpectedServiceSec = $o['ExpectedServiceSec'];
        if (isset($o['SignedSec'])) $this->SignedSec = $o['SignedSec'];
        if (isset($o['ServingSec'])) $this->ServingSec = $o['ServingSec'];
        if (isset($o['PausedSec'])) $this->PausedSec = $o['PausedSec'];
        if (isset($o['IdleSec'])) $this->IdleSec = $o['IdleSec'];
        if (isset($o['UnstaffedSec'])) $this->UnstaffedSec = $o['UnstaffedSec'];
        if (isset($o['Utilization'])) $this->Utilization = $o['Utilization'];
        if (isset($o['IdleShare'])) $this->IdleShare = $o['IdleShare'];
        if (isset($o['PausedShare'])) $this->PausedShare = $o['PausedShare'];
        if (isset($o['Sessions'])) $this->Sessions = $o['Sessions'];
        if (isset($o['OpenDays'])) $this->OpenDays = $o['OpenDays'];
        if (isset($o['FeesEarned'])) $this->FeesEarned = $o['FeesEarned'];
        if (isset($o['AvgFee'])) $this->AvgFee = $o['AvgFee'];
        if (isset($o['FeesPerStaffedHour'])) $this->FeesPerStaffedHour = $o['FeesPerStaffedHour'];
        if (isset($o['ExpectedFeesPerStaffedHour'])) $this->ExpectedFeesPerStaffedHour = $o['ExpectedFeesPerStaffedHour'];
        if (isset($o['LaborCost'])) $this->LaborCost = $o['LaborCost'];
        if (isset($o['LaborPartial'])) $this->LaborPartial = $o['LaborPartial'];
        if (isset($o['MissingCostEmployeeIds'])) $this->MissingCostEmployeeIds = JsonConverters::fromArray('Guid', $o['MissingCostEmployeeIds']);
        if (isset($o['MissingCost'])) $this->MissingCost = JsonConverters::fromArray('SvcNamedTime', $o['MissingCost']);
        if (isset($o['LaborLocked'])) $this->LaborLocked = $o['LaborLocked'];
        if (isset($o['Contribution'])) $this->Contribution = $o['Contribution'];
        if (isset($o['LostFees'])) $this->LostFees = $o['LostFees'];
        if (isset($o['LostNoShowFees'])) $this->LostNoShowFees = $o['LostNoShowFees'];
        if (isset($o['Mix'])) $this->Mix = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['Guid','int']), $o['Mix']);
        if (isset($o['HourlyServed'])) $this->HourlyServed = JsonConverters::fromArray('int', $o['HourlyServed']);
        if (isset($o['HourlyFees'])) $this->HourlyFees = JsonConverters::fromArray('float', $o['HourlyFees']);
        if (isset($o['HourlyCost'])) $this->HourlyCost = JsonConverters::fromArray('float', $o['HourlyCost']);
        if (isset($o['Tints'])) $this->Tints = JsonConverters::fromArray('SvcTint', $o['Tints']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Checkins)) $o['Checkins'] = $this->Checkins;
        if (isset($this->Walkins)) $o['Walkins'] = $this->Walkins;
        if (isset($this->Appts)) $o['Appts'] = $this->Appts;
        if (isset($this->Served)) $o['Served'] = $this->Served;
        if (isset($this->NoShows)) $o['NoShows'] = $this->NoShows;
        if (isset($this->ApptNoShows)) $o['ApptNoShows'] = $this->ApptNoShows;
        if (isset($this->CancelledAtWindow)) $o['CancelledAtWindow'] = $this->CancelledAtWindow;
        if (isset($this->Abandoned)) $o['Abandoned'] = $this->Abandoned;
        if (isset($this->Called)) $o['Called'] = $this->Called;
        if (isset($this->CalledUp)) $o['CalledUp'] = $this->CalledUp;
        if (isset($this->AbandonRate)) $o['AbandonRate'] = $this->AbandonRate;
        if (isset($this->NoShowRate)) $o['NoShowRate'] = $this->NoShowRate;
        if (isset($this->AvgServiceSec)) $o['AvgServiceSec'] = $this->AvgServiceSec;
        if (isset($this->MedianServiceSec)) $o['MedianServiceSec'] = $this->MedianServiceSec;
        if (isset($this->AvgWaitSec)) $o['AvgWaitSec'] = $this->AvgWaitSec;
        if (isset($this->MaxWaitSec)) $o['MaxWaitSec'] = $this->MaxWaitSec;
        if (isset($this->AvgWalkUpSec)) $o['AvgWalkUpSec'] = $this->AvgWalkUpSec;
        if (isset($this->ExpectedServiceSec)) $o['ExpectedServiceSec'] = $this->ExpectedServiceSec;
        if (isset($this->SignedSec)) $o['SignedSec'] = $this->SignedSec;
        if (isset($this->ServingSec)) $o['ServingSec'] = $this->ServingSec;
        if (isset($this->PausedSec)) $o['PausedSec'] = $this->PausedSec;
        if (isset($this->IdleSec)) $o['IdleSec'] = $this->IdleSec;
        if (isset($this->UnstaffedSec)) $o['UnstaffedSec'] = $this->UnstaffedSec;
        if (isset($this->Utilization)) $o['Utilization'] = $this->Utilization;
        if (isset($this->IdleShare)) $o['IdleShare'] = $this->IdleShare;
        if (isset($this->PausedShare)) $o['PausedShare'] = $this->PausedShare;
        if (isset($this->Sessions)) $o['Sessions'] = $this->Sessions;
        if (isset($this->OpenDays)) $o['OpenDays'] = $this->OpenDays;
        if (isset($this->FeesEarned)) $o['FeesEarned'] = $this->FeesEarned;
        if (isset($this->AvgFee)) $o['AvgFee'] = $this->AvgFee;
        if (isset($this->FeesPerStaffedHour)) $o['FeesPerStaffedHour'] = $this->FeesPerStaffedHour;
        if (isset($this->ExpectedFeesPerStaffedHour)) $o['ExpectedFeesPerStaffedHour'] = $this->ExpectedFeesPerStaffedHour;
        if (isset($this->LaborCost)) $o['LaborCost'] = $this->LaborCost;
        if (isset($this->LaborPartial)) $o['LaborPartial'] = $this->LaborPartial;
        if (isset($this->MissingCostEmployeeIds)) $o['MissingCostEmployeeIds'] = JsonConverters::toArray('Guid', $this->MissingCostEmployeeIds);
        if (isset($this->MissingCost)) $o['MissingCost'] = JsonConverters::toArray('SvcNamedTime', $this->MissingCost);
        if (isset($this->LaborLocked)) $o['LaborLocked'] = $this->LaborLocked;
        if (isset($this->Contribution)) $o['Contribution'] = $this->Contribution;
        if (isset($this->LostFees)) $o['LostFees'] = $this->LostFees;
        if (isset($this->LostNoShowFees)) $o['LostNoShowFees'] = $this->LostNoShowFees;
        if (isset($this->Mix)) $o['Mix'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['Guid','int']), $this->Mix);
        if (isset($this->HourlyServed)) $o['HourlyServed'] = JsonConverters::toArray('int', $this->HourlyServed);
        if (isset($this->HourlyFees)) $o['HourlyFees'] = JsonConverters::toArray('float', $this->HourlyFees);
        if (isset($this->HourlyCost)) $o['HourlyCost'] = JsonConverters::toArray('float', $this->HourlyCost);
        if (isset($this->Tints)) $o['Tints'] = JsonConverters::toArray('SvcTint', $this->Tints);
        return empty($o) ? new class(){} : $o;
    }
}

class SvcBranchRow implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $BranchId='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $StateCode=null,
        /** @var string|null */
        public ?string $ZoneCode=null,
        /** @var string|null */
        public ?string $TimeZone=null,
        /** @var int */
        public int $Windows=0,
        /** @var DateTime|null */
        public ?DateTime $RecordingSinceUtc=null,
        /** @var DateTime|null */
        public ?DateTime $SessionsSinceUtc=null,
        /** @var SvcMetrics|null */
        public ?SvcMetrics $Metrics=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['StateCode'])) $this->StateCode = $o['StateCode'];
        if (isset($o['ZoneCode'])) $this->ZoneCode = $o['ZoneCode'];
        if (isset($o['TimeZone'])) $this->TimeZone = $o['TimeZone'];
        if (isset($o['Windows'])) $this->Windows = $o['Windows'];
        if (isset($o['RecordingSinceUtc'])) $this->RecordingSinceUtc = JsonConverters::from('DateTime', $o['RecordingSinceUtc']);
        if (isset($o['SessionsSinceUtc'])) $this->SessionsSinceUtc = JsonConverters::from('DateTime', $o['SessionsSinceUtc']);
        if (isset($o['Metrics'])) $this->Metrics = JsonConverters::from('SvcMetrics', $o['Metrics']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->StateCode)) $o['StateCode'] = $this->StateCode;
        if (isset($this->ZoneCode)) $o['ZoneCode'] = $this->ZoneCode;
        if (isset($this->TimeZone)) $o['TimeZone'] = $this->TimeZone;
        if (isset($this->Windows)) $o['Windows'] = $this->Windows;
        if (isset($this->RecordingSinceUtc)) $o['RecordingSinceUtc'] = JsonConverters::to('DateTime', $this->RecordingSinceUtc);
        if (isset($this->SessionsSinceUtc)) $o['SessionsSinceUtc'] = JsonConverters::to('DateTime', $this->SessionsSinceUtc);
        if (isset($this->Metrics)) $o['Metrics'] = JsonConverters::to('SvcMetrics', $this->Metrics);
        return empty($o) ? new class(){} : $o;
    }
}

class SvcWindowRow implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $StationId='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var array<SvcNamedTime>|null */
        public ?array $Clerks=null,
        /** @var bool|null */
        public ?bool $NeverStaffed=null,
        /** @var DateTime|null */
        public ?DateTime $LastStaffedUtc=null,
        /** @var string|null */
        public ?string $LastStaffedBy=null,
        /** @var SvcMetrics|null */
        public ?SvcMetrics $Metrics=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['StationId'])) $this->StationId = $o['StationId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Clerks'])) $this->Clerks = JsonConverters::fromArray('SvcNamedTime', $o['Clerks']);
        if (isset($o['NeverStaffed'])) $this->NeverStaffed = $o['NeverStaffed'];
        if (isset($o['LastStaffedUtc'])) $this->LastStaffedUtc = JsonConverters::from('DateTime', $o['LastStaffedUtc']);
        if (isset($o['LastStaffedBy'])) $this->LastStaffedBy = $o['LastStaffedBy'];
        if (isset($o['Metrics'])) $this->Metrics = JsonConverters::from('SvcMetrics', $o['Metrics']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->StationId)) $o['StationId'] = $this->StationId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Clerks)) $o['Clerks'] = JsonConverters::toArray('SvcNamedTime', $this->Clerks);
        if (isset($this->NeverStaffed)) $o['NeverStaffed'] = $this->NeverStaffed;
        if (isset($this->LastStaffedUtc)) $o['LastStaffedUtc'] = JsonConverters::to('DateTime', $this->LastStaffedUtc);
        if (isset($this->LastStaffedBy)) $o['LastStaffedBy'] = $this->LastStaffedBy;
        if (isset($this->Metrics)) $o['Metrics'] = JsonConverters::to('SvcMetrics', $this->Metrics);
        return empty($o) ? new class(){} : $o;
    }
}

class SvcClerkRow implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $EmployeeId='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var array<SvcNamedTime>|null */
        public ?array $Windows=null,
        /** @var float|null */
        public ?float $LoadedRate=null,
        /** @var bool|null */
        public ?bool $RateSet=null,
        /** @var bool|null */
        public ?bool $RateLocked=null,
        /** @var SvcMetrics|null */
        public ?SvcMetrics $Metrics=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['EmployeeId'])) $this->EmployeeId = $o['EmployeeId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Windows'])) $this->Windows = JsonConverters::fromArray('SvcNamedTime', $o['Windows']);
        if (isset($o['LoadedRate'])) $this->LoadedRate = $o['LoadedRate'];
        if (isset($o['RateSet'])) $this->RateSet = $o['RateSet'];
        if (isset($o['RateLocked'])) $this->RateLocked = $o['RateLocked'];
        if (isset($o['Metrics'])) $this->Metrics = JsonConverters::from('SvcMetrics', $o['Metrics']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->EmployeeId)) $o['EmployeeId'] = $this->EmployeeId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Windows)) $o['Windows'] = JsonConverters::toArray('SvcNamedTime', $this->Windows);
        if (isset($this->LoadedRate)) $o['LoadedRate'] = $this->LoadedRate;
        if (isset($this->RateSet)) $o['RateSet'] = $this->RateSet;
        if (isset($this->RateLocked)) $o['RateLocked'] = $this->RateLocked;
        if (isset($this->Metrics)) $o['Metrics'] = JsonConverters::to('SvcMetrics', $this->Metrics);
        return empty($o) ? new class(){} : $o;
    }
}

class SvcAverage implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Count=0,
        /** @var float */
        public float $Served=0.0,
        /** @var float|null */
        public ?float $AvgServiceSec=null,
        /** @var float|null */
        public ?float $MedianServiceSec=null,
        /** @var float|null */
        public ?float $AvgWaitSec=null,
        /** @var float|null */
        public ?float $Utilization=null,
        /** @var float */
        public float $IdleSec=0.0,
        /** @var float */
        public float $PausedSec=0.0,
        /** @var float */
        public float $NoShows=0.0,
        /** @var float */
        public float $SignedSec=0.0,
        /** @var float|null */
        public ?float $FeesEarned=null,
        /** @var float|null */
        public ?float $FeesPerStaffedHour=null,
        /** @var float|null */
        public ?float $LaborCost=null,
        /** @var float|null */
        public ?float $Contribution=null,
        /** @var float|null */
        public ?float $LostNoShowFees=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Count'])) $this->Count = $o['Count'];
        if (isset($o['Served'])) $this->Served = $o['Served'];
        if (isset($o['AvgServiceSec'])) $this->AvgServiceSec = $o['AvgServiceSec'];
        if (isset($o['MedianServiceSec'])) $this->MedianServiceSec = $o['MedianServiceSec'];
        if (isset($o['AvgWaitSec'])) $this->AvgWaitSec = $o['AvgWaitSec'];
        if (isset($o['Utilization'])) $this->Utilization = $o['Utilization'];
        if (isset($o['IdleSec'])) $this->IdleSec = $o['IdleSec'];
        if (isset($o['PausedSec'])) $this->PausedSec = $o['PausedSec'];
        if (isset($o['NoShows'])) $this->NoShows = $o['NoShows'];
        if (isset($o['SignedSec'])) $this->SignedSec = $o['SignedSec'];
        if (isset($o['FeesEarned'])) $this->FeesEarned = $o['FeesEarned'];
        if (isset($o['FeesPerStaffedHour'])) $this->FeesPerStaffedHour = $o['FeesPerStaffedHour'];
        if (isset($o['LaborCost'])) $this->LaborCost = $o['LaborCost'];
        if (isset($o['Contribution'])) $this->Contribution = $o['Contribution'];
        if (isset($o['LostNoShowFees'])) $this->LostNoShowFees = $o['LostNoShowFees'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Count)) $o['Count'] = $this->Count;
        if (isset($this->Served)) $o['Served'] = $this->Served;
        if (isset($this->AvgServiceSec)) $o['AvgServiceSec'] = $this->AvgServiceSec;
        if (isset($this->MedianServiceSec)) $o['MedianServiceSec'] = $this->MedianServiceSec;
        if (isset($this->AvgWaitSec)) $o['AvgWaitSec'] = $this->AvgWaitSec;
        if (isset($this->Utilization)) $o['Utilization'] = $this->Utilization;
        if (isset($this->IdleSec)) $o['IdleSec'] = $this->IdleSec;
        if (isset($this->PausedSec)) $o['PausedSec'] = $this->PausedSec;
        if (isset($this->NoShows)) $o['NoShows'] = $this->NoShows;
        if (isset($this->SignedSec)) $o['SignedSec'] = $this->SignedSec;
        if (isset($this->FeesEarned)) $o['FeesEarned'] = $this->FeesEarned;
        if (isset($this->FeesPerStaffedHour)) $o['FeesPerStaffedHour'] = $this->FeesPerStaffedHour;
        if (isset($this->LaborCost)) $o['LaborCost'] = $this->LaborCost;
        if (isset($this->Contribution)) $o['Contribution'] = $this->Contribution;
        if (isset($this->LostNoShowFees)) $o['LostNoShowFees'] = $this->LostNoShowFees;
        return empty($o) ? new class(){} : $o;
    }
}

class SvcComparison implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Mode=null,
        /** @var DateTime|null */
        public ?DateTime $FromDate=null,
        /** @var DateTime|null */
        public ?DateTime $ToDate=null,
        /** @var int|null */
        public ?int $CutoffMinute=null,
        /** @var bool|null */
        public ?bool $HasData=null,
        /** @var SvcMetrics|null */
        public ?SvcMetrics $Metrics=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Mode'])) $this->Mode = $o['Mode'];
        if (isset($o['FromDate'])) $this->FromDate = JsonConverters::from('DateTime', $o['FromDate']);
        if (isset($o['ToDate'])) $this->ToDate = JsonConverters::from('DateTime', $o['ToDate']);
        if (isset($o['CutoffMinute'])) $this->CutoffMinute = $o['CutoffMinute'];
        if (isset($o['HasData'])) $this->HasData = $o['HasData'];
        if (isset($o['Metrics'])) $this->Metrics = JsonConverters::from('SvcMetrics', $o['Metrics']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Mode)) $o['Mode'] = $this->Mode;
        if (isset($this->FromDate)) $o['FromDate'] = JsonConverters::to('DateTime', $this->FromDate);
        if (isset($this->ToDate)) $o['ToDate'] = JsonConverters::to('DateTime', $this->ToDate);
        if (isset($this->CutoffMinute)) $o['CutoffMinute'] = $this->CutoffMinute;
        if (isset($this->HasData)) $o['HasData'] = $this->HasData;
        if (isset($this->Metrics)) $o['Metrics'] = JsonConverters::to('SvcMetrics', $this->Metrics);
        return empty($o) ? new class(){} : $o;
    }
}

class SvcCoverageBucket implements JsonSerializable
{
    public function __construct(
        /** @var float */
        public float $ServingPct=0.0,
        /** @var float */
        public float $IdlePct=0.0,
        /** @var float */
        public float $PausedPct=0.0,
        /** @var float */
        public float $UnstaffedPct=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ServingPct'])) $this->ServingPct = $o['ServingPct'];
        if (isset($o['IdlePct'])) $this->IdlePct = $o['IdlePct'];
        if (isset($o['PausedPct'])) $this->PausedPct = $o['PausedPct'];
        if (isset($o['UnstaffedPct'])) $this->UnstaffedPct = $o['UnstaffedPct'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ServingPct)) $o['ServingPct'] = $this->ServingPct;
        if (isset($this->IdlePct)) $o['IdlePct'] = $this->IdlePct;
        if (isset($this->PausedPct)) $o['PausedPct'] = $this->PausedPct;
        if (isset($this->UnstaffedPct)) $o['UnstaffedPct'] = $this->UnstaffedPct;
        return empty($o) ? new class(){} : $o;
    }
}

class SvcCoverageRow implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $StationId='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var array<SvcCoverageBucket>|null */
        public ?array $Buckets=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['StationId'])) $this->StationId = $o['StationId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Buckets'])) $this->Buckets = JsonConverters::fromArray('SvcCoverageBucket', $o['Buckets']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->StationId)) $o['StationId'] = $this->StationId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Buckets)) $o['Buckets'] = JsonConverters::toArray('SvcCoverageBucket', $this->Buckets);
        return empty($o) ? new class(){} : $o;
    }
}

class SvcCoverage implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $StartLocalMinute=0,
        /** @var int */
        public int $BucketMinutes=0,
        /** @var array<SvcCoverageRow>|null */
        public ?array $Rows=null,
        /** @var array<float>|null */
        public ?array $InLine=null,
        /** @var array<int[]>|null */
        public ?array $GapBands=null,
        /** @var int */
        public int $Days=0,
        /** @var bool|null */
        public ?bool $NotRecorded=null,
        /** @var int|null */
        public ?int $FutureFromIndex=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['StartLocalMinute'])) $this->StartLocalMinute = $o['StartLocalMinute'];
        if (isset($o['BucketMinutes'])) $this->BucketMinutes = $o['BucketMinutes'];
        if (isset($o['Rows'])) $this->Rows = JsonConverters::fromArray('SvcCoverageRow', $o['Rows']);
        if (isset($o['InLine'])) $this->InLine = JsonConverters::fromArray('float', $o['InLine']);
        if (isset($o['GapBands'])) $this->GapBands = JsonConverters::fromArray('Int32[]', $o['GapBands']);
        if (isset($o['Days'])) $this->Days = $o['Days'];
        if (isset($o['NotRecorded'])) $this->NotRecorded = $o['NotRecorded'];
        if (isset($o['FutureFromIndex'])) $this->FutureFromIndex = $o['FutureFromIndex'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->StartLocalMinute)) $o['StartLocalMinute'] = $this->StartLocalMinute;
        if (isset($this->BucketMinutes)) $o['BucketMinutes'] = $this->BucketMinutes;
        if (isset($this->Rows)) $o['Rows'] = JsonConverters::toArray('SvcCoverageRow', $this->Rows);
        if (isset($this->InLine)) $o['InLine'] = JsonConverters::toArray('float', $this->InLine);
        if (isset($this->GapBands)) $o['GapBands'] = JsonConverters::toArray('Int32[]', $this->GapBands);
        if (isset($this->Days)) $o['Days'] = $this->Days;
        if (isset($this->NotRecorded)) $o['NotRecorded'] = $this->NotRecorded;
        if (isset($this->FutureFromIndex)) $o['FutureFromIndex'] = $this->FutureFromIndex;
        return empty($o) ? new class(){} : $o;
    }
}

class SvcFeeChange implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $LocationId='',
        /** @var DateTime */
        public DateTime $OnDate=new DateTime(),
        /** @var float */
        public float $FromFee=0.0,
        /** @var float */
        public float $ToFee=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
        if (isset($o['OnDate'])) $this->OnDate = JsonConverters::from('DateTime', $o['OnDate']);
        if (isset($o['FromFee'])) $this->FromFee = $o['FromFee'];
        if (isset($o['ToFee'])) $this->ToFee = $o['ToFee'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
        if (isset($this->OnDate)) $o['OnDate'] = JsonConverters::to('DateTime', $this->OnDate);
        if (isset($this->FromFee)) $o['FromFee'] = $this->FromFee;
        if (isset($this->ToFee)) $o['ToFee'] = $this->ToFee;
        return empty($o) ? new class(){} : $o;
    }
}

class SvcServiceRow implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $LineId='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var int */
        public int $Completed=0,
        /** @var float|null */
        public ?float $AvgServiceSec=null,
        /** @var float|null */
        public ?float $BranchAvgServiceSec=null,
        /** @var float|null */
        public ?float $FeesEarned=null,
        /** @var float|null */
        public ?float $FeeCurrent=null,
        /** @var float|null */
        public ?float $FeeMin=null,
        /** @var float|null */
        public ?float $FeeMax=null,
        /** @var float|null */
        public ?float $FeePerMinute=null,
        /** @var float|null */
        public ?float $BranchFeePerMinute=null,
        /** @var array<SvcFeeChange>|null */
        public ?array $FeeChanges=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['LineId'])) $this->LineId = $o['LineId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Completed'])) $this->Completed = $o['Completed'];
        if (isset($o['AvgServiceSec'])) $this->AvgServiceSec = $o['AvgServiceSec'];
        if (isset($o['BranchAvgServiceSec'])) $this->BranchAvgServiceSec = $o['BranchAvgServiceSec'];
        if (isset($o['FeesEarned'])) $this->FeesEarned = $o['FeesEarned'];
        if (isset($o['FeeCurrent'])) $this->FeeCurrent = $o['FeeCurrent'];
        if (isset($o['FeeMin'])) $this->FeeMin = $o['FeeMin'];
        if (isset($o['FeeMax'])) $this->FeeMax = $o['FeeMax'];
        if (isset($o['FeePerMinute'])) $this->FeePerMinute = $o['FeePerMinute'];
        if (isset($o['BranchFeePerMinute'])) $this->BranchFeePerMinute = $o['BranchFeePerMinute'];
        if (isset($o['FeeChanges'])) $this->FeeChanges = JsonConverters::fromArray('SvcFeeChange', $o['FeeChanges']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->LineId)) $o['LineId'] = $this->LineId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Completed)) $o['Completed'] = $this->Completed;
        if (isset($this->AvgServiceSec)) $o['AvgServiceSec'] = $this->AvgServiceSec;
        if (isset($this->BranchAvgServiceSec)) $o['BranchAvgServiceSec'] = $this->BranchAvgServiceSec;
        if (isset($this->FeesEarned)) $o['FeesEarned'] = $this->FeesEarned;
        if (isset($this->FeeCurrent)) $o['FeeCurrent'] = $this->FeeCurrent;
        if (isset($this->FeeMin)) $o['FeeMin'] = $this->FeeMin;
        if (isset($this->FeeMax)) $o['FeeMax'] = $this->FeeMax;
        if (isset($this->FeePerMinute)) $o['FeePerMinute'] = $this->FeePerMinute;
        if (isset($this->BranchFeePerMinute)) $o['BranchFeePerMinute'] = $this->BranchFeePerMinute;
        if (isset($this->FeeChanges)) $o['FeeChanges'] = JsonConverters::toArray('SvcFeeChange', $this->FeeChanges);
        return empty($o) ? new class(){} : $o;
    }
}

class SvcHourRow implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $LocalHour=0,
        /** @var int */
        public int $Served=0,
        /** @var float|null */
        public ?float $FeesEarned=null,
        /** @var float|null */
        public ?float $CostToStaff=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['LocalHour'])) $this->LocalHour = $o['LocalHour'];
        if (isset($o['Served'])) $this->Served = $o['Served'];
        if (isset($o['FeesEarned'])) $this->FeesEarned = $o['FeesEarned'];
        if (isset($o['CostToStaff'])) $this->CostToStaff = $o['CostToStaff'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->LocalHour)) $o['LocalHour'] = $this->LocalHour;
        if (isset($this->Served)) $o['Served'] = $this->Served;
        if (isset($this->FeesEarned)) $o['FeesEarned'] = $this->FeesEarned;
        if (isset($this->CostToStaff)) $o['CostToStaff'] = $this->CostToStaff;
        return empty($o) ? new class(){} : $o;
    }
}

class SvcAlert implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Level=null,
        /** @var string|null */
        public ?string $View=null,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $StationId=null,
        /** @var string|null */
        public ?string $EmployeeId=null,
        /** @var string|null */
        public ?string $BranchId=null,
        /** @var string|null */
        public ?string $LineId=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $OtherLineId=null,
        /** @var string|null */
        public ?string $OtherName=null,
        /** @var array<string>|null */
        public ?array $StationIds=null,
        /** @var array<string,float>|null */
        public ?array $Values=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Level'])) $this->Level = $o['Level'];
        if (isset($o['View'])) $this->View = $o['View'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['StationId'])) $this->StationId = $o['StationId'];
        if (isset($o['EmployeeId'])) $this->EmployeeId = $o['EmployeeId'];
        if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
        if (isset($o['LineId'])) $this->LineId = $o['LineId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['OtherLineId'])) $this->OtherLineId = $o['OtherLineId'];
        if (isset($o['OtherName'])) $this->OtherName = $o['OtherName'];
        if (isset($o['StationIds'])) $this->StationIds = JsonConverters::fromArray('Guid', $o['StationIds']);
        if (isset($o['Values'])) $this->Values = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','float']), $o['Values']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Level)) $o['Level'] = $this->Level;
        if (isset($this->View)) $o['View'] = $this->View;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->StationId)) $o['StationId'] = $this->StationId;
        if (isset($this->EmployeeId)) $o['EmployeeId'] = $this->EmployeeId;
        if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
        if (isset($this->LineId)) $o['LineId'] = $this->LineId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->OtherLineId)) $o['OtherLineId'] = $this->OtherLineId;
        if (isset($this->OtherName)) $o['OtherName'] = $this->OtherName;
        if (isset($this->StationIds)) $o['StationIds'] = JsonConverters::toArray('Guid', $this->StationIds);
        if (isset($this->Values)) $o['Values'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','float']), $this->Values);
        return empty($o) ? new class(){} : $o;
    }
}

class SvcBranchDetail implements JsonSerializable
{
    public function __construct(
        /** @var SvcBranchRow|null */
        public ?SvcBranchRow $Branch=null,
        /** @var array<SvcWindowRow>|null */
        public ?array $Windows=null,
        /** @var array<SvcClerkRow>|null */
        public ?array $Clerks=null,
        /** @var SvcMetrics|null */
        public ?SvcMetrics $Unassigned=null,
        /** @var SvcMetrics|null */
        public ?SvcMetrics $NoClerk=null,
        /** @var SvcAverage|null */
        public ?SvcAverage $PerWindowAverage=null,
        /** @var SvcAverage|null */
        public ?SvcAverage $PerClerkAverage=null,
        /** @var int */
        public int $OpenDays=0,
        /** @var bool|null */
        public ?bool $IsLive=null,
        /** @var SvcComparison|null */
        public ?SvcComparison $Comparison=null,
        /** @var SvcCoverage|null */
        public ?SvcCoverage $Coverage=null,
        /** @var array<SvcServiceRow>|null */
        public ?array $Services=null,
        /** @var array<SvcHourRow>|null */
        public ?array $ByHour=null,
        /** @var array<SvcAlert>|null */
        public ?array $Alerts=null,
        /** @var bool|null */
        public ?bool $TotalsAgree=null,
        /** @var bool|null */
        public ?bool $CanSeeStaff=null,
        /** @var bool|null */
        public ?bool $CanSeeFinancial=null,
        /** @var bool|null */
        public ?bool $CanSeePay=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Branch'])) $this->Branch = JsonConverters::from('SvcBranchRow', $o['Branch']);
        if (isset($o['Windows'])) $this->Windows = JsonConverters::fromArray('SvcWindowRow', $o['Windows']);
        if (isset($o['Clerks'])) $this->Clerks = JsonConverters::fromArray('SvcClerkRow', $o['Clerks']);
        if (isset($o['Unassigned'])) $this->Unassigned = JsonConverters::from('SvcMetrics', $o['Unassigned']);
        if (isset($o['NoClerk'])) $this->NoClerk = JsonConverters::from('SvcMetrics', $o['NoClerk']);
        if (isset($o['PerWindowAverage'])) $this->PerWindowAverage = JsonConverters::from('SvcAverage', $o['PerWindowAverage']);
        if (isset($o['PerClerkAverage'])) $this->PerClerkAverage = JsonConverters::from('SvcAverage', $o['PerClerkAverage']);
        if (isset($o['OpenDays'])) $this->OpenDays = $o['OpenDays'];
        if (isset($o['IsLive'])) $this->IsLive = $o['IsLive'];
        if (isset($o['Comparison'])) $this->Comparison = JsonConverters::from('SvcComparison', $o['Comparison']);
        if (isset($o['Coverage'])) $this->Coverage = JsonConverters::from('SvcCoverage', $o['Coverage']);
        if (isset($o['Services'])) $this->Services = JsonConverters::fromArray('SvcServiceRow', $o['Services']);
        if (isset($o['ByHour'])) $this->ByHour = JsonConverters::fromArray('SvcHourRow', $o['ByHour']);
        if (isset($o['Alerts'])) $this->Alerts = JsonConverters::fromArray('SvcAlert', $o['Alerts']);
        if (isset($o['TotalsAgree'])) $this->TotalsAgree = $o['TotalsAgree'];
        if (isset($o['CanSeeStaff'])) $this->CanSeeStaff = $o['CanSeeStaff'];
        if (isset($o['CanSeeFinancial'])) $this->CanSeeFinancial = $o['CanSeeFinancial'];
        if (isset($o['CanSeePay'])) $this->CanSeePay = $o['CanSeePay'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Branch)) $o['Branch'] = JsonConverters::to('SvcBranchRow', $this->Branch);
        if (isset($this->Windows)) $o['Windows'] = JsonConverters::toArray('SvcWindowRow', $this->Windows);
        if (isset($this->Clerks)) $o['Clerks'] = JsonConverters::toArray('SvcClerkRow', $this->Clerks);
        if (isset($this->Unassigned)) $o['Unassigned'] = JsonConverters::to('SvcMetrics', $this->Unassigned);
        if (isset($this->NoClerk)) $o['NoClerk'] = JsonConverters::to('SvcMetrics', $this->NoClerk);
        if (isset($this->PerWindowAverage)) $o['PerWindowAverage'] = JsonConverters::to('SvcAverage', $this->PerWindowAverage);
        if (isset($this->PerClerkAverage)) $o['PerClerkAverage'] = JsonConverters::to('SvcAverage', $this->PerClerkAverage);
        if (isset($this->OpenDays)) $o['OpenDays'] = $this->OpenDays;
        if (isset($this->IsLive)) $o['IsLive'] = $this->IsLive;
        if (isset($this->Comparison)) $o['Comparison'] = JsonConverters::to('SvcComparison', $this->Comparison);
        if (isset($this->Coverage)) $o['Coverage'] = JsonConverters::to('SvcCoverage', $this->Coverage);
        if (isset($this->Services)) $o['Services'] = JsonConverters::toArray('SvcServiceRow', $this->Services);
        if (isset($this->ByHour)) $o['ByHour'] = JsonConverters::toArray('SvcHourRow', $this->ByHour);
        if (isset($this->Alerts)) $o['Alerts'] = JsonConverters::toArray('SvcAlert', $this->Alerts);
        if (isset($this->TotalsAgree)) $o['TotalsAgree'] = $this->TotalsAgree;
        if (isset($this->CanSeeStaff)) $o['CanSeeStaff'] = $this->CanSeeStaff;
        if (isset($this->CanSeeFinancial)) $o['CanSeeFinancial'] = $this->CanSeeFinancial;
        if (isset($this->CanSeePay)) $o['CanSeePay'] = $this->CanSeePay;
        return empty($o) ? new class(){} : $o;
    }
}

class KpiV2BranchResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var SvcBranchDetail|null */
        public ?SvcBranchDetail $Branch=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['Branch'])) $this->Branch = JsonConverters::from('SvcBranchDetail', $o['Branch']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->Branch)) $o['Branch'] = JsonConverters::to('SvcBranchDetail', $this->Branch);
        return empty($o) ? new class(){} : $o;
    }
}

class KpiV2BranchRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $BranchId='',
        /** @var DateTime */
        public DateTime $FromDate=new DateTime(),
        /** @var DateTime */
        public DateTime $ToDate=new DateTime(),
        /** @var string|null */
        public ?string $Compare=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
        if (isset($o['FromDate'])) $this->FromDate = JsonConverters::from('DateTime', $o['FromDate']);
        if (isset($o['ToDate'])) $this->ToDate = JsonConverters::from('DateTime', $o['ToDate']);
        if (isset($o['Compare'])) $this->Compare = $o['Compare'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
        if (isset($this->FromDate)) $o['FromDate'] = JsonConverters::to('DateTime', $this->FromDate);
        if (isset($this->ToDate)) $o['ToDate'] = JsonConverters::to('DateTime', $this->ToDate);
        if (isset($this->Compare)) $o['Compare'] = $this->Compare;
        return empty($o) ? new class(){} : $o;
    }
}

PHP KpiV2BranchRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/dashboard/kpiv2/branch HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"BranchId":"00000000000000000000000000000000","FromDate":"0001-01-01T00:00:00.0000000","ToDate":"0001-01-01T00:00:00.0000000","Compare":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Branch":{"Branch":{"BranchId":"00000000000000000000000000000000","Name":"String","StateCode":"String","ZoneCode":"String","TimeZone":"String","Windows":0,"RecordingSinceUtc":"0001-01-01T00:00:00.0000000","SessionsSinceUtc":"0001-01-01T00:00:00.0000000","Metrics":{"Checkins":0,"Walkins":0,"Appts":0,"Served":0,"NoShows":0,"ApptNoShows":0,"CancelledAtWindow":0,"Abandoned":0,"Called":0,"CalledUp":0,"AbandonRate":0,"NoShowRate":0,"AvgServiceSec":0,"MedianServiceSec":0,"AvgWaitSec":0,"MaxWaitSec":0,"AvgWalkUpSec":0,"ExpectedServiceSec":0,"SignedSec":0,"ServingSec":0,"PausedSec":0,"IdleSec":0,"UnstaffedSec":0,"Utilization":0,"IdleShare":0,"PausedShare":0,"Sessions":0,"OpenDays":0,"FeesEarned":0,"AvgFee":0,"FeesPerStaffedHour":0,"ExpectedFeesPerStaffedHour":0,"LaborCost":0,"LaborPartial":false,"MissingCostEmployeeIds":["00000000000000000000000000000000"],"MissingCost":[{"Id":"00000000000000000000000000000000","Name":"String","SignedSec":0,"Served":0}],"LaborLocked":false,"Contribution":0,"LostFees":0,"LostNoShowFees":0,"Mix":{"00000000000000000000000000000000":0},"HourlyServed":[0],"HourlyFees":[0],"HourlyCost":[0],"Tints":[{"Field":"String","Tone":"String","Reason":"String","Value":0,"Reference":0,"BranchValue":0}]}},"Windows":[{"StationId":"00000000000000000000000000000000","Name":"String","Clerks":[{"Id":"00000000000000000000000000000000","Name":"String","SignedSec":0,"Served":0}],"NeverStaffed":false,"LastStaffedUtc":"0001-01-01T00:00:00.0000000","LastStaffedBy":"String","Metrics":{"Checkins":0,"Walkins":0,"Appts":0,"Served":0,"NoShows":0,"ApptNoShows":0,"CancelledAtWindow":0,"Abandoned":0,"Called":0,"CalledUp":0,"AbandonRate":0,"NoShowRate":0,"AvgServiceSec":0,"MedianServiceSec":0,"AvgWaitSec":0,"MaxWaitSec":0,"AvgWalkUpSec":0,"ExpectedServiceSec":0,"SignedSec":0,"ServingSec":0,"PausedSec":0,"IdleSec":0,"UnstaffedSec":0,"Utilization":0,"IdleShare":0,"PausedShare":0,"Sessions":0,"OpenDays":0,"FeesEarned":0,"AvgFee":0,"FeesPerStaffedHour":0,"ExpectedFeesPerStaffedHour":0,"LaborCost":0,"LaborPartial":false,"MissingCostEmployeeIds":["00000000000000000000000000000000"],"MissingCost":[{"Id":"00000000000000000000000000000000","Name":"String","SignedSec":0,"Served":0}],"LaborLocked":false,"Contribution":0,"LostFees":0,"LostNoShowFees":0,"Mix":{"00000000000000000000000000000000":0},"HourlyServed":[0],"HourlyFees":[0],"HourlyCost":[0],"Tints":[{"Field":"String","Tone":"String","Reason":"String","Value":0,"Reference":0,"BranchValue":0}]}}],"Clerks":[{"EmployeeId":"00000000000000000000000000000000","Name":"String","Windows":[{"Id":"00000000000000000000000000000000","Name":"String","SignedSec":0,"Served":0}],"LoadedRate":0,"RateSet":false,"RateLocked":false,"Metrics":{"Checkins":0,"Walkins":0,"Appts":0,"Served":0,"NoShows":0,"ApptNoShows":0,"CancelledAtWindow":0,"Abandoned":0,"Called":0,"CalledUp":0,"AbandonRate":0,"NoShowRate":0,"AvgServiceSec":0,"MedianServiceSec":0,"AvgWaitSec":0,"MaxWaitSec":0,"AvgWalkUpSec":0,"ExpectedServiceSec":0,"SignedSec":0,"ServingSec":0,"PausedSec":0,"IdleSec":0,"UnstaffedSec":0,"Utilization":0,"IdleShare":0,"PausedShare":0,"Sessions":0,"OpenDays":0,"FeesEarned":0,"AvgFee":0,"FeesPerStaffedHour":0,"ExpectedFeesPerStaffedHour":0,"LaborCost":0,"LaborPartial":false,"MissingCostEmployeeIds":["00000000000000000000000000000000"],"MissingCost":[{"Id":"00000000000000000000000000000000","Name":"String","SignedSec":0,"Served":0}],"LaborLocked":false,"Contribution":0,"LostFees":0,"LostNoShowFees":0,"Mix":{"00000000000000000000000000000000":0},"HourlyServed":[0],"HourlyFees":[0],"HourlyCost":[0],"Tints":[{"Field":"String","Tone":"String","Reason":"String","Value":0,"Reference":0,"BranchValue":0}]}}],"Unassigned":{"Checkins":0,"Walkins":0,"Appts":0,"Served":0,"NoShows":0,"ApptNoShows":0,"CancelledAtWindow":0,"Abandoned":0,"Called":0,"CalledUp":0,"AbandonRate":0,"NoShowRate":0,"AvgServiceSec":0,"MedianServiceSec":0,"AvgWaitSec":0,"MaxWaitSec":0,"AvgWalkUpSec":0,"ExpectedServiceSec":0,"SignedSec":0,"ServingSec":0,"PausedSec":0,"IdleSec":0,"UnstaffedSec":0,"Utilization":0,"IdleShare":0,"PausedShare":0,"Sessions":0,"OpenDays":0,"FeesEarned":0,"AvgFee":0,"FeesPerStaffedHour":0,"ExpectedFeesPerStaffedHour":0,"LaborCost":0,"LaborPartial":false,"MissingCostEmployeeIds":["00000000000000000000000000000000"],"MissingCost":[{"Id":"00000000000000000000000000000000","Name":"String","SignedSec":0,"Served":0}],"LaborLocked":false,"Contribution":0,"LostFees":0,"LostNoShowFees":0,"Mix":{"00000000000000000000000000000000":0},"HourlyServed":[0],"HourlyFees":[0],"HourlyCost":[0],"Tints":[{"Field":"String","Tone":"String","Reason":"String","Value":0,"Reference":0,"BranchValue":0}]},"NoClerk":{"Checkins":0,"Walkins":0,"Appts":0,"Served":0,"NoShows":0,"ApptNoShows":0,"CancelledAtWindow":0,"Abandoned":0,"Called":0,"CalledUp":0,"AbandonRate":0,"NoShowRate":0,"AvgServiceSec":0,"MedianServiceSec":0,"AvgWaitSec":0,"MaxWaitSec":0,"AvgWalkUpSec":0,"ExpectedServiceSec":0,"SignedSec":0,"ServingSec":0,"PausedSec":0,"IdleSec":0,"UnstaffedSec":0,"Utilization":0,"IdleShare":0,"PausedShare":0,"Sessions":0,"OpenDays":0,"FeesEarned":0,"AvgFee":0,"FeesPerStaffedHour":0,"ExpectedFeesPerStaffedHour":0,"LaborCost":0,"LaborPartial":false,"MissingCostEmployeeIds":["00000000000000000000000000000000"],"MissingCost":[{"Id":"00000000000000000000000000000000","Name":"String","SignedSec":0,"Served":0}],"LaborLocked":false,"Contribution":0,"LostFees":0,"LostNoShowFees":0,"Mix":{"00000000000000000000000000000000":0},"HourlyServed":[0],"HourlyFees":[0],"HourlyCost":[0],"Tints":[{"Field":"String","Tone":"String","Reason":"String","Value":0,"Reference":0,"BranchValue":0}]},"PerWindowAverage":{"Count":0,"Served":0,"AvgServiceSec":0,"MedianServiceSec":0,"AvgWaitSec":0,"Utilization":0,"IdleSec":0,"PausedSec":0,"NoShows":0,"SignedSec":0,"FeesEarned":0,"FeesPerStaffedHour":0,"LaborCost":0,"Contribution":0,"LostNoShowFees":0},"PerClerkAverage":{"Count":0,"Served":0,"AvgServiceSec":0,"MedianServiceSec":0,"AvgWaitSec":0,"Utilization":0,"IdleSec":0,"PausedSec":0,"NoShows":0,"SignedSec":0,"FeesEarned":0,"FeesPerStaffedHour":0,"LaborCost":0,"Contribution":0,"LostNoShowFees":0},"OpenDays":0,"IsLive":false,"Comparison":{"Mode":"String","FromDate":"0001-01-01T00:00:00.0000000","ToDate":"0001-01-01T00:00:00.0000000","CutoffMinute":0,"HasData":false,"Metrics":{"Checkins":0,"Walkins":0,"Appts":0,"Served":0,"NoShows":0,"ApptNoShows":0,"CancelledAtWindow":0,"Abandoned":0,"Called":0,"CalledUp":0,"AbandonRate":0,"NoShowRate":0,"AvgServiceSec":0,"MedianServiceSec":0,"AvgWaitSec":0,"MaxWaitSec":0,"AvgWalkUpSec":0,"ExpectedServiceSec":0,"SignedSec":0,"ServingSec":0,"PausedSec":0,"IdleSec":0,"UnstaffedSec":0,"Utilization":0,"IdleShare":0,"PausedShare":0,"Sessions":0,"OpenDays":0,"FeesEarned":0,"AvgFee":0,"FeesPerStaffedHour":0,"ExpectedFeesPerStaffedHour":0,"LaborCost":0,"LaborPartial":false,"MissingCostEmployeeIds":["00000000000000000000000000000000"],"MissingCost":[{"Id":"00000000000000000000000000000000","Name":"String","SignedSec":0,"Served":0}],"LaborLocked":false,"Contribution":0,"LostFees":0,"LostNoShowFees":0,"Mix":{"00000000000000000000000000000000":0},"HourlyServed":[0],"HourlyFees":[0],"HourlyCost":[0],"Tints":[{"Field":"String","Tone":"String","Reason":"String","Value":0,"Reference":0,"BranchValue":0}]}},"Coverage":{"StartLocalMinute":0,"BucketMinutes":0,"Rows":[{"StationId":"00000000000000000000000000000000","Name":"String","Buckets":[{"ServingPct":0,"IdlePct":0,"PausedPct":0,"UnstaffedPct":0}]}],"InLine":[0],"GapBands":[[0]],"Days":0,"NotRecorded":false,"FutureFromIndex":0},"Services":[{"LineId":"00000000000000000000000000000000","Name":"String","Completed":0,"AvgServiceSec":0,"BranchAvgServiceSec":0,"FeesEarned":0,"FeeCurrent":0,"FeeMin":0,"FeeMax":0,"FeePerMinute":0,"BranchFeePerMinute":0,"FeeChanges":[{"LocationId":"00000000000000000000000000000000","OnDate":"0001-01-01T00:00:00.0000000","FromFee":0,"ToFee":0}]}],"ByHour":[{"LocalHour":0,"Served":0,"FeesEarned":0,"CostToStaff":0}],"Alerts":[{"Level":"String","View":"String","Code":"String","StationId":"00000000000000000000000000000000","EmployeeId":"00000000000000000000000000000000","BranchId":"00000000000000000000000000000000","LineId":"00000000000000000000000000000000","Name":"String","OtherLineId":"00000000000000000000000000000000","OtherName":"String","StationIds":["00000000000000000000000000000000"],"Values":{"String":0}}],"TotalsAgree":false,"CanSeeStaff":false,"CanSeeFinancial":false,"CanSeePay":false}}