Trendsic Platform Service

<back to all web services

KpiV2Request

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/dashboard/kpiv2
<?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 DashboardStatTile implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Key=null,
        /** @var string|null */
        public ?string $Label=null,
        /** @var float */
        public float $Value=0.0,
        /** @var float|null */
        public ?float $PreviousValue=null,
        /** @var string|null */
        public ?string $Unit=null,
        /** @var float|null */
        public ?float $DeltaPct=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Key'])) $this->Key = $o['Key'];
        if (isset($o['Label'])) $this->Label = $o['Label'];
        if (isset($o['Value'])) $this->Value = $o['Value'];
        if (isset($o['PreviousValue'])) $this->PreviousValue = $o['PreviousValue'];
        if (isset($o['Unit'])) $this->Unit = $o['Unit'];
        if (isset($o['DeltaPct'])) $this->DeltaPct = $o['DeltaPct'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Key)) $o['Key'] = $this->Key;
        if (isset($this->Label)) $o['Label'] = $this->Label;
        if (isset($this->Value)) $o['Value'] = $this->Value;
        if (isset($this->PreviousValue)) $o['PreviousValue'] = $this->PreviousValue;
        if (isset($this->Unit)) $o['Unit'] = $this->Unit;
        if (isset($this->DeltaPct)) $o['DeltaPct'] = $this->DeltaPct;
        return empty($o) ? new class(){} : $o;
    }
}

class DashboardSeriesPoint implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Label=null,
        /** @var float */
        public float $Value=0.0
    ) {
    }

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

class DashboardSeries implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=null,
        /** @var array<DashboardSeriesPoint>|null */
        public ?array $Points=null
    ) {
    }

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

class KpiV2LocationRow implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $LocationName=null,
        /** @var int */
        public int $Walkins=0,
        /** @var int */
        public int $Completed=0,
        /** @var float */
        public float $AvgServiceMinutes=0.0,
        /** @var float */
        public float $AbandonmentPct=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['LocationName'])) $this->LocationName = $o['LocationName'];
        if (isset($o['Walkins'])) $this->Walkins = $o['Walkins'];
        if (isset($o['Completed'])) $this->Completed = $o['Completed'];
        if (isset($o['AvgServiceMinutes'])) $this->AvgServiceMinutes = $o['AvgServiceMinutes'];
        if (isset($o['AbandonmentPct'])) $this->AbandonmentPct = $o['AbandonmentPct'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->LocationName)) $o['LocationName'] = $this->LocationName;
        if (isset($this->Walkins)) $o['Walkins'] = $this->Walkins;
        if (isset($this->Completed)) $o['Completed'] = $this->Completed;
        if (isset($this->AvgServiceMinutes)) $o['AvgServiceMinutes'] = $this->AvgServiceMinutes;
        if (isset($this->AbandonmentPct)) $o['AbandonmentPct'] = $this->AbandonmentPct;
        return empty($o) ? new class(){} : $o;
    }
}

class KpiV2WorkerRow implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $WorkerName=null,
        /** @var int */
        public int $Completed=0,
        /** @var float */
        public float $AvgServiceMinutes=0.0
    ) {
    }

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

class KpiV2HeatPoint implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Dow=0,
        /** @var int */
        public int $Hr=0,
        /** @var int */
        public int $Cnt=0
    ) {
    }

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

class KpiV2LiveRow implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $LocationName=null,
        /** @var int */
        public int $Waiting=0,
        /** @var int */
        public int $InProgress=0
    ) {
    }

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

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 SvcStateRow implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $StateCode=null,
        /** @var string|null */
        public ?string $StateName=null,
        /** @var int */
        public int $Branches=0,
        /** @var SvcMetrics|null */
        public ?SvcMetrics $Metrics=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['StateCode'])) $this->StateCode = $o['StateCode'];
        if (isset($o['StateName'])) $this->StateName = $o['StateName'];
        if (isset($o['Branches'])) $this->Branches = $o['Branches'];
        if (isset($o['Metrics'])) $this->Metrics = JsonConverters::from('SvcMetrics', $o['Metrics']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->StateCode)) $o['StateCode'] = $this->StateCode;
        if (isset($this->StateName)) $o['StateName'] = $this->StateName;
        if (isset($this->Branches)) $o['Branches'] = $this->Branches;
        if (isset($this->Metrics)) $o['Metrics'] = JsonConverters::to('SvcMetrics', $this->Metrics);
        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 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 SvcWorkerRow implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $EmployeeId='',
        /** @var string */
        public string $BranchId='',
        /** @var string|null */
        public ?string $BranchName=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var int */
        public int $Served=0,
        /** @var float|null */
        public ?float $AvgServiceSec=null,
        /** @var float|null */
        public ?float $Utilization=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['EmployeeId'])) $this->EmployeeId = $o['EmployeeId'];
        if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
        if (isset($o['BranchName'])) $this->BranchName = $o['BranchName'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Served'])) $this->Served = $o['Served'];
        if (isset($o['AvgServiceSec'])) $this->AvgServiceSec = $o['AvgServiceSec'];
        if (isset($o['Utilization'])) $this->Utilization = $o['Utilization'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->EmployeeId)) $o['EmployeeId'] = $this->EmployeeId;
        if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
        if (isset($this->BranchName)) $o['BranchName'] = $this->BranchName;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Served)) $o['Served'] = $this->Served;
        if (isset($this->AvgServiceSec)) $o['AvgServiceSec'] = $this->AvgServiceSec;
        if (isset($this->Utilization)) $o['Utilization'] = $this->Utilization;
        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 SvcScope implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $StateCode=null,
        /** @var array<SvcBranchRow>|null */
        public ?array $Branches=null,
        /** @var array<SvcStateRow>|null */
        public ?array $States=null,
        /** @var SvcMetrics|null */
        public ?SvcMetrics $Total=null,
        /** @var SvcComparison|null */
        public ?SvcComparison $Comparison=null,
        /** @var array<SvcServiceRow>|null */
        public ?array $FeesByService=null,
        /** @var array<SvcHourRow>|null */
        public ?array $ByHour=null,
        /** @var array<SvcWorkerRow>|null */
        public ?array $Workers=null,
        /** @var bool|null */
        public ?bool $MultiZone=null,
        /** @var bool|null */
        public ?bool $MultiState=null,
        /** @var DateTime|null */
        public ?DateTime $RecordingSinceUtc=null,
        /** @var DateTime|null */
        public ?DateTime $SessionsSinceUtc=null,
        /** @var array<SvcAlert>|null */
        public ?array $Alerts=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['StateCode'])) $this->StateCode = $o['StateCode'];
        if (isset($o['Branches'])) $this->Branches = JsonConverters::fromArray('SvcBranchRow', $o['Branches']);
        if (isset($o['States'])) $this->States = JsonConverters::fromArray('SvcStateRow', $o['States']);
        if (isset($o['Total'])) $this->Total = JsonConverters::from('SvcMetrics', $o['Total']);
        if (isset($o['Comparison'])) $this->Comparison = JsonConverters::from('SvcComparison', $o['Comparison']);
        if (isset($o['FeesByService'])) $this->FeesByService = JsonConverters::fromArray('SvcServiceRow', $o['FeesByService']);
        if (isset($o['ByHour'])) $this->ByHour = JsonConverters::fromArray('SvcHourRow', $o['ByHour']);
        if (isset($o['Workers'])) $this->Workers = JsonConverters::fromArray('SvcWorkerRow', $o['Workers']);
        if (isset($o['MultiZone'])) $this->MultiZone = $o['MultiZone'];
        if (isset($o['MultiState'])) $this->MultiState = $o['MultiState'];
        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['Alerts'])) $this->Alerts = JsonConverters::fromArray('SvcAlert', $o['Alerts']);
        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->StateCode)) $o['StateCode'] = $this->StateCode;
        if (isset($this->Branches)) $o['Branches'] = JsonConverters::toArray('SvcBranchRow', $this->Branches);
        if (isset($this->States)) $o['States'] = JsonConverters::toArray('SvcStateRow', $this->States);
        if (isset($this->Total)) $o['Total'] = JsonConverters::to('SvcMetrics', $this->Total);
        if (isset($this->Comparison)) $o['Comparison'] = JsonConverters::to('SvcComparison', $this->Comparison);
        if (isset($this->FeesByService)) $o['FeesByService'] = JsonConverters::toArray('SvcServiceRow', $this->FeesByService);
        if (isset($this->ByHour)) $o['ByHour'] = JsonConverters::toArray('SvcHourRow', $this->ByHour);
        if (isset($this->Workers)) $o['Workers'] = JsonConverters::toArray('SvcWorkerRow', $this->Workers);
        if (isset($this->MultiZone)) $o['MultiZone'] = $this->MultiZone;
        if (isset($this->MultiState)) $o['MultiState'] = $this->MultiState;
        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->Alerts)) $o['Alerts'] = JsonConverters::toArray('SvcAlert', $this->Alerts);
        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 KpiV2Response implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<DashboardStatTile>|null */
        public ?array $Stats=null,
        /** @var array<DashboardSeries>|null */
        public ?array $Trend=null,
        /** @var DashboardSeries|null */
        public ?DashboardSeries $ServicesByType=null,
        /** @var array<KpiV2LocationRow>|null */
        public ?array $LocationLeaderboard=null,
        /** @var array<KpiV2WorkerRow>|null */
        public ?array $WorkerProductivity=null,
        /** @var array<KpiV2HeatPoint>|null */
        public ?array $Heatmap=null,
        /** @var array<KpiV2LiveRow>|null */
        public ?array $LiveQueue=null,
        /** @var SvcScope|null */
        public ?SvcScope $Scope=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['Stats'])) $this->Stats = JsonConverters::fromArray('DashboardStatTile', $o['Stats']);
        if (isset($o['Trend'])) $this->Trend = JsonConverters::fromArray('DashboardSeries', $o['Trend']);
        if (isset($o['ServicesByType'])) $this->ServicesByType = JsonConverters::from('DashboardSeries', $o['ServicesByType']);
        if (isset($o['LocationLeaderboard'])) $this->LocationLeaderboard = JsonConverters::fromArray('KpiV2LocationRow', $o['LocationLeaderboard']);
        if (isset($o['WorkerProductivity'])) $this->WorkerProductivity = JsonConverters::fromArray('KpiV2WorkerRow', $o['WorkerProductivity']);
        if (isset($o['Heatmap'])) $this->Heatmap = JsonConverters::fromArray('KpiV2HeatPoint', $o['Heatmap']);
        if (isset($o['LiveQueue'])) $this->LiveQueue = JsonConverters::fromArray('KpiV2LiveRow', $o['LiveQueue']);
        if (isset($o['Scope'])) $this->Scope = JsonConverters::from('SvcScope', $o['Scope']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->Stats)) $o['Stats'] = JsonConverters::toArray('DashboardStatTile', $this->Stats);
        if (isset($this->Trend)) $o['Trend'] = JsonConverters::toArray('DashboardSeries', $this->Trend);
        if (isset($this->ServicesByType)) $o['ServicesByType'] = JsonConverters::to('DashboardSeries', $this->ServicesByType);
        if (isset($this->LocationLeaderboard)) $o['LocationLeaderboard'] = JsonConverters::toArray('KpiV2LocationRow', $this->LocationLeaderboard);
        if (isset($this->WorkerProductivity)) $o['WorkerProductivity'] = JsonConverters::toArray('KpiV2WorkerRow', $this->WorkerProductivity);
        if (isset($this->Heatmap)) $o['Heatmap'] = JsonConverters::toArray('KpiV2HeatPoint', $this->Heatmap);
        if (isset($this->LiveQueue)) $o['LiveQueue'] = JsonConverters::toArray('KpiV2LiveRow', $this->LiveQueue);
        if (isset($this->Scope)) $o['Scope'] = JsonConverters::to('SvcScope', $this->Scope);
        return empty($o) ? new class(){} : $o;
    }
}

class KpiV2Request implements JsonSerializable
{
    public function __construct(
        /** @var DateTime */
        public DateTime $FromDate=new DateTime(),
        /** @var DateTime */
        public DateTime $ToDate=new DateTime(),
        /** @var array<string>|null */
        public ?array $LocationIds=null,
        /** @var bool|null */
        public ?bool $IncludeScope=null,
        /** @var string|null */
        public ?string $StateCode=null,
        /** @var string|null */
        public ?string $Compare=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        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['LocationIds'])) $this->LocationIds = JsonConverters::fromArray('Guid', $o['LocationIds']);
        if (isset($o['IncludeScope'])) $this->IncludeScope = $o['IncludeScope'];
        if (isset($o['StateCode'])) $this->StateCode = $o['StateCode'];
        if (isset($o['Compare'])) $this->Compare = $o['Compare'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        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->LocationIds)) $o['LocationIds'] = JsonConverters::toArray('Guid', $this->LocationIds);
        if (isset($this->IncludeScope)) $o['IncludeScope'] = $this->IncludeScope;
        if (isset($this->StateCode)) $o['StateCode'] = $this->StateCode;
        if (isset($this->Compare)) $o['Compare'] = $this->Compare;
        return empty($o) ? new class(){} : $o;
    }
}

PHP KpiV2Request DTOs

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

HTTP + JSV

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

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

{
	FromDate: 0001-01-01,
	ToDate: 0001-01-01,
	LocationIds: 
	[
		00000000000000000000000000000000
	],
	IncludeScope: False,
	StateCode: String,
	Compare: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Stats: 
	[
		{
			Key: String,
			Label: String,
			Value: 0,
			PreviousValue: 0,
			Unit: String
		}
	],
	Trend: 
	[
		{
			Name: String,
			Points: 
			[
				{
					Label: String,
					Value: 0
				}
			]
		}
	],
	ServicesByType: 
	{
		Name: String,
		Points: 
		[
			{
				Label: String,
				Value: 0
			}
		]
	},
	LocationLeaderboard: 
	[
		{
			LocationName: String,
			Walkins: 0,
			Completed: 0,
			AvgServiceMinutes: 0,
			AbandonmentPct: 0
		}
	],
	WorkerProductivity: 
	[
		{
			WorkerName: String,
			Completed: 0,
			AvgServiceMinutes: 0
		}
	],
	Heatmap: 
	[
		{
			Dow: 0,
			Hr: 0,
			Cnt: 0
		}
	],
	LiveQueue: 
	[
		{
			LocationName: String,
			Waiting: 0,
			InProgress: 0
		}
	],
	Scope: 
	{
		StateCode: String,
		Branches: 
		[
			{
				BranchId: 00000000000000000000000000000000,
				Name: String,
				StateCode: String,
				ZoneCode: String,
				TimeZone: String,
				Windows: 0,
				RecordingSinceUtc: 0001-01-01,
				SessionsSinceUtc: 0001-01-01,
				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
						}
					]
				}
			}
		],
		States: 
		[
			{
				StateCode: String,
				StateName: String,
				Branches: 0,
				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
						}
					]
				}
			}
		],
		Total: 
		{
			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
				}
			]
		},
		Comparison: 
		{
			Mode: String,
			FromDate: 0001-01-01,
			ToDate: 0001-01-01,
			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
					}
				]
			}
		},
		FeesByService: 
		[
			{
				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-01,
						FromFee: 0,
						ToFee: 0
					}
				]
			}
		],
		ByHour: 
		[
			{
				LocalHour: 0,
				Served: 0,
				FeesEarned: 0,
				CostToStaff: 0
			}
		],
		Workers: 
		[
			{
				EmployeeId: 00000000000000000000000000000000,
				BranchId: 00000000000000000000000000000000,
				BranchName: String,
				Name: String,
				Served: 0,
				AvgServiceSec: 0,
				Utilization: 0
			}
		],
		MultiZone: False,
		MultiState: False,
		RecordingSinceUtc: 0001-01-01,
		SessionsSinceUtc: 0001-01-01,
		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
				}
			}
		],
		CanSeeStaff: False,
		CanSeeFinancial: False,
		CanSeePay: False
	}
}