| GET,OPTIONS | /v1/laborsales/summary |
|---|
<?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 DayView implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $DateIso=null,
/** @var float */
public float $GrossSales=0.0,
/** @var int */
public int $TransactionCount=0,
/** @var float */
public float $LaborHours=0.0,
/** @var float */
public float $CostedHours=0.0,
/** @var float */
public float $LaborCost=0.0,
/** @var int */
public int $WorkerCount=0,
/** @var float|null */
public ?float $LaborPct=null,
/** @var float|null */
public ?float $Splh=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DateIso'])) $this->DateIso = $o['DateIso'];
if (isset($o['GrossSales'])) $this->GrossSales = $o['GrossSales'];
if (isset($o['TransactionCount'])) $this->TransactionCount = $o['TransactionCount'];
if (isset($o['LaborHours'])) $this->LaborHours = $o['LaborHours'];
if (isset($o['CostedHours'])) $this->CostedHours = $o['CostedHours'];
if (isset($o['LaborCost'])) $this->LaborCost = $o['LaborCost'];
if (isset($o['WorkerCount'])) $this->WorkerCount = $o['WorkerCount'];
if (isset($o['LaborPct'])) $this->LaborPct = $o['LaborPct'];
if (isset($o['Splh'])) $this->Splh = $o['Splh'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DateIso)) $o['DateIso'] = $this->DateIso;
if (isset($this->GrossSales)) $o['GrossSales'] = $this->GrossSales;
if (isset($this->TransactionCount)) $o['TransactionCount'] = $this->TransactionCount;
if (isset($this->LaborHours)) $o['LaborHours'] = $this->LaborHours;
if (isset($this->CostedHours)) $o['CostedHours'] = $this->CostedHours;
if (isset($this->LaborCost)) $o['LaborCost'] = $this->LaborCost;
if (isset($this->WorkerCount)) $o['WorkerCount'] = $this->WorkerCount;
if (isset($this->LaborPct)) $o['LaborPct'] = $this->LaborPct;
if (isset($this->Splh)) $o['Splh'] = $this->Splh;
return empty($o) ? new class(){} : $o;
}
}
class LocationView implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $LocationId=null,
/** @var string|null */
public ?string $LocationName=null,
/** @var float */
public float $GrossSales=0.0,
/** @var int */
public int $TransactionCount=0,
/** @var float|null */
public ?float $SharePct=null,
/** @var string|null */
public ?string $BranchId=null,
/** @var string|null */
public ?string $BranchName=null,
/** @var float|null */
public ?float $LaborHours=null,
/** @var float|null */
public ?float $CostedHours=null,
/** @var float|null */
public ?float $LaborCost=null,
/** @var float|null */
public ?float $LaborPct=null,
/** @var float|null */
public ?float $Splh=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
if (isset($o['LocationName'])) $this->LocationName = $o['LocationName'];
if (isset($o['GrossSales'])) $this->GrossSales = $o['GrossSales'];
if (isset($o['TransactionCount'])) $this->TransactionCount = $o['TransactionCount'];
if (isset($o['SharePct'])) $this->SharePct = $o['SharePct'];
if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
if (isset($o['BranchName'])) $this->BranchName = $o['BranchName'];
if (isset($o['LaborHours'])) $this->LaborHours = $o['LaborHours'];
if (isset($o['CostedHours'])) $this->CostedHours = $o['CostedHours'];
if (isset($o['LaborCost'])) $this->LaborCost = $o['LaborCost'];
if (isset($o['LaborPct'])) $this->LaborPct = $o['LaborPct'];
if (isset($o['Splh'])) $this->Splh = $o['Splh'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
if (isset($this->LocationName)) $o['LocationName'] = $this->LocationName;
if (isset($this->GrossSales)) $o['GrossSales'] = $this->GrossSales;
if (isset($this->TransactionCount)) $o['TransactionCount'] = $this->TransactionCount;
if (isset($this->SharePct)) $o['SharePct'] = $this->SharePct;
if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
if (isset($this->BranchName)) $o['BranchName'] = $this->BranchName;
if (isset($this->LaborHours)) $o['LaborHours'] = $this->LaborHours;
if (isset($this->CostedHours)) $o['CostedHours'] = $this->CostedHours;
if (isset($this->LaborCost)) $o['LaborCost'] = $this->LaborCost;
if (isset($this->LaborPct)) $o['LaborPct'] = $this->LaborPct;
if (isset($this->Splh)) $o['Splh'] = $this->Splh;
return empty($o) ? new class(){} : $o;
}
}
class TotalsView implements JsonSerializable
{
public function __construct(
/** @var float */
public float $GrossSales=0.0,
/** @var int */
public int $TransactionCount=0,
/** @var float */
public float $LaborHours=0.0,
/** @var float */
public float $CostedHours=0.0,
/** @var float */
public float $LaborCost=0.0,
/** @var float|null */
public ?float $LaborPct=null,
/** @var float|null */
public ?float $Splh=null,
/** @var int */
public int $DaysWithSales=0,
/** @var int */
public int $DaysWithLabor=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['GrossSales'])) $this->GrossSales = $o['GrossSales'];
if (isset($o['TransactionCount'])) $this->TransactionCount = $o['TransactionCount'];
if (isset($o['LaborHours'])) $this->LaborHours = $o['LaborHours'];
if (isset($o['CostedHours'])) $this->CostedHours = $o['CostedHours'];
if (isset($o['LaborCost'])) $this->LaborCost = $o['LaborCost'];
if (isset($o['LaborPct'])) $this->LaborPct = $o['LaborPct'];
if (isset($o['Splh'])) $this->Splh = $o['Splh'];
if (isset($o['DaysWithSales'])) $this->DaysWithSales = $o['DaysWithSales'];
if (isset($o['DaysWithLabor'])) $this->DaysWithLabor = $o['DaysWithLabor'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->GrossSales)) $o['GrossSales'] = $this->GrossSales;
if (isset($this->TransactionCount)) $o['TransactionCount'] = $this->TransactionCount;
if (isset($this->LaborHours)) $o['LaborHours'] = $this->LaborHours;
if (isset($this->CostedHours)) $o['CostedHours'] = $this->CostedHours;
if (isset($this->LaborCost)) $o['LaborCost'] = $this->LaborCost;
if (isset($this->LaborPct)) $o['LaborPct'] = $this->LaborPct;
if (isset($this->Splh)) $o['Splh'] = $this->Splh;
if (isset($this->DaysWithSales)) $o['DaysWithSales'] = $this->DaysWithSales;
if (isset($this->DaysWithLabor)) $o['DaysWithLabor'] = $this->DaysWithLabor;
return empty($o) ? new class(){} : $o;
}
}
class SummaryView implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $Configured=null,
/** @var bool|null */
public ?bool $Connected=null,
/** @var bool|null */
public ?bool $NeedsReconnect=null,
/** @var string|null */
public ?string $Currency=null,
/** @var array<DayView>|null */
public ?array $Days=null,
/** @var array<LocationView>|null */
public ?array $Locations=null,
/** @var TotalsView|null */
public ?TotalsView $Totals=null,
/** @var TotalsView|null */
public ?TotalsView $PriorTotals=null,
/** @var string|null */
public ?string $AttributionNote=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Configured'])) $this->Configured = $o['Configured'];
if (isset($o['Connected'])) $this->Connected = $o['Connected'];
if (isset($o['NeedsReconnect'])) $this->NeedsReconnect = $o['NeedsReconnect'];
if (isset($o['Currency'])) $this->Currency = $o['Currency'];
if (isset($o['Days'])) $this->Days = JsonConverters::fromArray('DayView', $o['Days']);
if (isset($o['Locations'])) $this->Locations = JsonConverters::fromArray('LocationView', $o['Locations']);
if (isset($o['Totals'])) $this->Totals = JsonConverters::from('TotalsView', $o['Totals']);
if (isset($o['PriorTotals'])) $this->PriorTotals = JsonConverters::from('TotalsView', $o['PriorTotals']);
if (isset($o['AttributionNote'])) $this->AttributionNote = $o['AttributionNote'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Configured)) $o['Configured'] = $this->Configured;
if (isset($this->Connected)) $o['Connected'] = $this->Connected;
if (isset($this->NeedsReconnect)) $o['NeedsReconnect'] = $this->NeedsReconnect;
if (isset($this->Currency)) $o['Currency'] = $this->Currency;
if (isset($this->Days)) $o['Days'] = JsonConverters::toArray('DayView', $this->Days);
if (isset($this->Locations)) $o['Locations'] = JsonConverters::toArray('LocationView', $this->Locations);
if (isset($this->Totals)) $o['Totals'] = JsonConverters::to('TotalsView', $this->Totals);
if (isset($this->PriorTotals)) $o['PriorTotals'] = JsonConverters::to('TotalsView', $this->PriorTotals);
if (isset($this->AttributionNote)) $o['AttributionNote'] = $this->AttributionNote;
return empty($o) ? new class(){} : $o;
}
}
class LaborSalesSummaryResponse implements JsonSerializable
{
public function __construct(
/** @var SummaryView|null */
public ?SummaryView $Summary=null,
/** @var string|null */
public ?string $FromDate=null,
/** @var string|null */
public ?string $ToDate=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Summary'])) $this->Summary = JsonConverters::from('SummaryView', $o['Summary']);
if (isset($o['FromDate'])) $this->FromDate = $o['FromDate'];
if (isset($o['ToDate'])) $this->ToDate = $o['ToDate'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Summary)) $o['Summary'] = JsonConverters::to('SummaryView', $this->Summary);
if (isset($this->FromDate)) $o['FromDate'] = $this->FromDate;
if (isset($this->ToDate)) $o['ToDate'] = $this->ToDate;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class LaborSalesSummaryRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $FromDate=null,
/** @var string|null */
public ?string $ToDate=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['FromDate'])) $this->FromDate = $o['FromDate'];
if (isset($o['ToDate'])) $this->ToDate = $o['ToDate'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->FromDate)) $o['FromDate'] = $this->FromDate;
if (isset($this->ToDate)) $o['ToDate'] = $this->ToDate;
return empty($o) ? new class(){} : $o;
}
}
PHP LaborSalesSummaryRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/laborsales/summary HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Summary":{"Configured":false,"Connected":false,"NeedsReconnect":false,"Currency":"String","Days":[{"DateIso":"String","GrossSales":0,"TransactionCount":0,"LaborHours":0,"CostedHours":0,"LaborCost":0,"WorkerCount":0,"LaborPct":0,"Splh":0}],"Locations":[{"LocationId":"String","LocationName":"String","GrossSales":0,"TransactionCount":0,"SharePct":0,"BranchId":"String","BranchName":"String","LaborHours":0,"CostedHours":0,"LaborCost":0,"LaborPct":0,"Splh":0}],"Totals":{"GrossSales":0,"TransactionCount":0,"LaborHours":0,"CostedHours":0,"LaborCost":0,"LaborPct":0,"Splh":0,"DaysWithSales":0,"DaysWithLabor":0},"PriorTotals":{"GrossSales":0,"TransactionCount":0,"LaborHours":0,"CostedHours":0,"LaborCost":0,"LaborPct":0,"Splh":0,"DaysWithSales":0,"DaysWithLabor":0},"AttributionNote":"String"},"FromDate":"String","ToDate":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}