Trendsic Platform Service

<back to all web services

KpiV2DetailRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/dashboard/kpiv2/detail
<?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 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 SvcSession implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $SessionId='',
        /** @var string */
        public string $StationId='',
        /** @var string|null */
        public ?string $StationName=null,
        /** @var string */
        public string $EmployeeId='',
        /** @var string|null */
        public ?string $EmployeeName=null,
        /** @var DateTime */
        public DateTime $LocalIn=new DateTime(),
        /** @var DateTime */
        public DateTime $LocalOut=new DateTime(),
        /** @var bool|null */
        public ?bool $IsOpen=null,
        /** @var string|null */
        public ?string $EndReason=null,
        /** @var int */
        public int $PausedSec=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['SessionId'])) $this->SessionId = $o['SessionId'];
        if (isset($o['StationId'])) $this->StationId = $o['StationId'];
        if (isset($o['StationName'])) $this->StationName = $o['StationName'];
        if (isset($o['EmployeeId'])) $this->EmployeeId = $o['EmployeeId'];
        if (isset($o['EmployeeName'])) $this->EmployeeName = $o['EmployeeName'];
        if (isset($o['LocalIn'])) $this->LocalIn = JsonConverters::from('DateTime', $o['LocalIn']);
        if (isset($o['LocalOut'])) $this->LocalOut = JsonConverters::from('DateTime', $o['LocalOut']);
        if (isset($o['IsOpen'])) $this->IsOpen = $o['IsOpen'];
        if (isset($o['EndReason'])) $this->EndReason = $o['EndReason'];
        if (isset($o['PausedSec'])) $this->PausedSec = $o['PausedSec'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->SessionId)) $o['SessionId'] = $this->SessionId;
        if (isset($this->StationId)) $o['StationId'] = $this->StationId;
        if (isset($this->StationName)) $o['StationName'] = $this->StationName;
        if (isset($this->EmployeeId)) $o['EmployeeId'] = $this->EmployeeId;
        if (isset($this->EmployeeName)) $o['EmployeeName'] = $this->EmployeeName;
        if (isset($this->LocalIn)) $o['LocalIn'] = JsonConverters::to('DateTime', $this->LocalIn);
        if (isset($this->LocalOut)) $o['LocalOut'] = JsonConverters::to('DateTime', $this->LocalOut);
        if (isset($this->IsOpen)) $o['IsOpen'] = $this->IsOpen;
        if (isset($this->EndReason)) $o['EndReason'] = $this->EndReason;
        if (isset($this->PausedSec)) $o['PausedSec'] = $this->PausedSec;
        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 SvcDetail implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Kind=null,
        /** @var SvcWindowRow|null */
        public ?SvcWindowRow $Window=null,
        /** @var SvcClerkRow|null */
        public ?SvcClerkRow $Clerk=null,
        /** @var SvcMetrics|null */
        public ?SvcMetrics $BranchMetrics=null,
        /** @var SvcAverage|null */
        public ?SvcAverage $PerRowAverage=null,
        /** @var array<SvcSession>|null */
        public ?array $Sessions=null,
        /** @var array<SvcServiceRow>|null */
        public ?array $Services=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['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['Window'])) $this->Window = JsonConverters::from('SvcWindowRow', $o['Window']);
        if (isset($o['Clerk'])) $this->Clerk = JsonConverters::from('SvcClerkRow', $o['Clerk']);
        if (isset($o['BranchMetrics'])) $this->BranchMetrics = JsonConverters::from('SvcMetrics', $o['BranchMetrics']);
        if (isset($o['PerRowAverage'])) $this->PerRowAverage = JsonConverters::from('SvcAverage', $o['PerRowAverage']);
        if (isset($o['Sessions'])) $this->Sessions = JsonConverters::fromArray('SvcSession', $o['Sessions']);
        if (isset($o['Services'])) $this->Services = JsonConverters::fromArray('SvcServiceRow', $o['Services']);
        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->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->Window)) $o['Window'] = JsonConverters::to('SvcWindowRow', $this->Window);
        if (isset($this->Clerk)) $o['Clerk'] = JsonConverters::to('SvcClerkRow', $this->Clerk);
        if (isset($this->BranchMetrics)) $o['BranchMetrics'] = JsonConverters::to('SvcMetrics', $this->BranchMetrics);
        if (isset($this->PerRowAverage)) $o['PerRowAverage'] = JsonConverters::to('SvcAverage', $this->PerRowAverage);
        if (isset($this->Sessions)) $o['Sessions'] = JsonConverters::toArray('SvcSession', $this->Sessions);
        if (isset($this->Services)) $o['Services'] = JsonConverters::toArray('SvcServiceRow', $this->Services);
        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 KpiV2DetailResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var SvcDetail|null */
        public ?SvcDetail $Detail=null
    ) {
    }

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

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

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

PHP KpiV2DetailRequest DTOs

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

HTTP + CSV

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

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

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

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Detail":{"Kind":"String","Window":{"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}]}},"Clerk":{"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}]}},"BranchMetrics":{"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}]},"PerRowAverage":{"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},"Sessions":[{"SessionId":"00000000000000000000000000000000","StationId":"00000000000000000000000000000000","StationName":"String","EmployeeId":"00000000000000000000000000000000","EmployeeName":"String","LocalIn":"0001-01-01T00:00:00.0000000","LocalOut":"0001-01-01T00:00:00.0000000","IsOpen":false,"EndReason":"String","PausedSec":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}]}],"CanSeeStaff":false,"CanSeeFinancial":false,"CanSeePay":false}}