Trendsic Platform Service

<back to all web services

ExecutiveDashboardRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/dashboards/executive
<?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 ExecKpi implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Key=null,
        /** @var string|null */
        public ?string $Label=null,
        /** @var string|null */
        public ?string $Value=null,
        /** @var string|null */
        public ?string $Sub_=null,
        /** @var string|null */
        public ?string $Delta=null,
        /** @var bool|null */
        public ?bool $DeltaUp=null,
        /** @var bool|null */
        public ?bool $HasDelta=null,
        /** @var bool|null */
        public ?bool $Good=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['Sub_'])) $this->Sub_ = $o['Sub_'];
        if (isset($o['Delta'])) $this->Delta = $o['Delta'];
        if (isset($o['DeltaUp'])) $this->DeltaUp = $o['DeltaUp'];
        if (isset($o['HasDelta'])) $this->HasDelta = $o['HasDelta'];
        if (isset($o['Good'])) $this->Good = $o['Good'];
    }
    
    /** @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->Sub_)) $o['Sub_'] = $this->Sub_;
        if (isset($this->Delta)) $o['Delta'] = $this->Delta;
        if (isset($this->DeltaUp)) $o['DeltaUp'] = $this->DeltaUp;
        if (isset($this->HasDelta)) $o['HasDelta'] = $this->HasDelta;
        if (isset($this->Good)) $o['Good'] = $this->Good;
        return empty($o) ? new class(){} : $o;
    }
}

class ExecCostCategory implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=null,
        /** @var float */
        public float $CostUSD=0.0,
        /** @var float */
        public float $BilledUSD=0.0
    ) {
    }

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

class ExecMonthPoint implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Month=null,
        /** @var float */
        public float $RevenueUSD=0.0,
        /** @var float */
        public float $CostUSD=0.0
    ) {
    }

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

class ExecBacklogYear implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Year=null,
        /** @var float */
        public float $ValueUSD=0.0
    ) {
    }

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

class ExecBacklog implements JsonSerializable
{
    public function __construct(
        /** @var float */
        public float $TotalUSD=0.0,
        /** @var float */
        public float $MonthsAhead=0.0,
        /** @var float */
        public float $AwardsYtdUSD=0.0,
        /** @var float */
        public float $BurnYtdUSD=0.0,
        /** @var array<ExecBacklogYear>|null */
        public ?array $ByYear=null
    ) {
    }

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

class ExecWipRow implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ContractId=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Owner=null,
        /** @var float */
        public float $ValueUSD=0.0,
        /** @var float */
        public float $PctComplete=0.0,
        /** @var float */
        public float $BilledUSD=0.0,
        /** @var float */
        public float $OverUnderUSD=0.0,
        /** @var float */
        public float $MarginPct=0.0,
        /** @var float */
        public float $FadePts=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ContractId'])) $this->ContractId = $o['ContractId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Owner'])) $this->Owner = $o['Owner'];
        if (isset($o['ValueUSD'])) $this->ValueUSD = $o['ValueUSD'];
        if (isset($o['PctComplete'])) $this->PctComplete = $o['PctComplete'];
        if (isset($o['BilledUSD'])) $this->BilledUSD = $o['BilledUSD'];
        if (isset($o['OverUnderUSD'])) $this->OverUnderUSD = $o['OverUnderUSD'];
        if (isset($o['MarginPct'])) $this->MarginPct = $o['MarginPct'];
        if (isset($o['FadePts'])) $this->FadePts = $o['FadePts'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ContractId)) $o['ContractId'] = $this->ContractId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Owner)) $o['Owner'] = $this->Owner;
        if (isset($this->ValueUSD)) $o['ValueUSD'] = $this->ValueUSD;
        if (isset($this->PctComplete)) $o['PctComplete'] = $this->PctComplete;
        if (isset($this->BilledUSD)) $o['BilledUSD'] = $this->BilledUSD;
        if (isset($this->OverUnderUSD)) $o['OverUnderUSD'] = $this->OverUnderUSD;
        if (isset($this->MarginPct)) $o['MarginPct'] = $this->MarginPct;
        if (isset($this->FadePts)) $o['FadePts'] = $this->FadePts;
        return empty($o) ? new class(){} : $o;
    }
}

class ExecPipelineStage implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Stage=null,
        /** @var float */
        public float $ValueUSD=0.0,
        /** @var int */
        public int $Count=0
    ) {
    }

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

class ExecAgingBucket implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Bucket=null,
        /** @var float */
        public float $AmountUSD=0.0,
        /** @var bool|null */
        public ?bool $IsRetainage=null
    ) {
    }

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

class ExecSafetyMetric implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Label=null,
        /** @var string|null */
        public ?string $Value=null,
        /** @var string|null */
        public ?string $Sub_=null,
        /** @var bool|null */
        public ?bool $Good=null
    ) {
    }

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

class ExecutiveDashboard implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Period=null,
        /** @var DateTime */
        public DateTime $FromDate=new DateTime(),
        /** @var DateTime */
        public DateTime $ToDate=new DateTime(),
        /** @var int */
        public int $Fy=0,
        /** @var array<ExecKpi>|null */
        public ?array $Kpis=null,
        /** @var array<ExecCostCategory>|null */
        public ?array $CostVsBilling=null,
        /** @var array<ExecMonthPoint>|null */
        public ?array $Monthly=null,
        /** @var ExecBacklog|null */
        public ?ExecBacklog $Backlog=null,
        /** @var array<ExecWipRow>|null */
        public ?array $Wip=null,
        /** @var array<ExecPipelineStage>|null */
        public ?array $Pipeline=null,
        /** @var float */
        public float $WinRatePct=0.0,
        /** @var array<ExecAgingBucket>|null */
        public ?array $Receivables=null,
        /** @var float */
        public float $RetainageUSD=0.0,
        /** @var int */
        public int $DsoDays=0,
        /** @var array<ExecSafetyMetric>|null */
        public ?array $Safety=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Period'])) $this->Period = $o['Period'];
        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['Fy'])) $this->Fy = $o['Fy'];
        if (isset($o['Kpis'])) $this->Kpis = JsonConverters::fromArray('ExecKpi', $o['Kpis']);
        if (isset($o['CostVsBilling'])) $this->CostVsBilling = JsonConverters::fromArray('ExecCostCategory', $o['CostVsBilling']);
        if (isset($o['Monthly'])) $this->Monthly = JsonConverters::fromArray('ExecMonthPoint', $o['Monthly']);
        if (isset($o['Backlog'])) $this->Backlog = JsonConverters::from('ExecBacklog', $o['Backlog']);
        if (isset($o['Wip'])) $this->Wip = JsonConverters::fromArray('ExecWipRow', $o['Wip']);
        if (isset($o['Pipeline'])) $this->Pipeline = JsonConverters::fromArray('ExecPipelineStage', $o['Pipeline']);
        if (isset($o['WinRatePct'])) $this->WinRatePct = $o['WinRatePct'];
        if (isset($o['Receivables'])) $this->Receivables = JsonConverters::fromArray('ExecAgingBucket', $o['Receivables']);
        if (isset($o['RetainageUSD'])) $this->RetainageUSD = $o['RetainageUSD'];
        if (isset($o['DsoDays'])) $this->DsoDays = $o['DsoDays'];
        if (isset($o['Safety'])) $this->Safety = JsonConverters::fromArray('ExecSafetyMetric', $o['Safety']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Period)) $o['Period'] = $this->Period;
        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->Fy)) $o['Fy'] = $this->Fy;
        if (isset($this->Kpis)) $o['Kpis'] = JsonConverters::toArray('ExecKpi', $this->Kpis);
        if (isset($this->CostVsBilling)) $o['CostVsBilling'] = JsonConverters::toArray('ExecCostCategory', $this->CostVsBilling);
        if (isset($this->Monthly)) $o['Monthly'] = JsonConverters::toArray('ExecMonthPoint', $this->Monthly);
        if (isset($this->Backlog)) $o['Backlog'] = JsonConverters::to('ExecBacklog', $this->Backlog);
        if (isset($this->Wip)) $o['Wip'] = JsonConverters::toArray('ExecWipRow', $this->Wip);
        if (isset($this->Pipeline)) $o['Pipeline'] = JsonConverters::toArray('ExecPipelineStage', $this->Pipeline);
        if (isset($this->WinRatePct)) $o['WinRatePct'] = $this->WinRatePct;
        if (isset($this->Receivables)) $o['Receivables'] = JsonConverters::toArray('ExecAgingBucket', $this->Receivables);
        if (isset($this->RetainageUSD)) $o['RetainageUSD'] = $this->RetainageUSD;
        if (isset($this->DsoDays)) $o['DsoDays'] = $this->DsoDays;
        if (isset($this->Safety)) $o['Safety'] = JsonConverters::toArray('ExecSafetyMetric', $this->Safety);
        return empty($o) ? new class(){} : $o;
    }
}

class ExecutiveDashboardResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var ExecutiveDashboard|null */
        public ?ExecutiveDashboard $Dashboard=null
    ) {
    }

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

class ExecutiveDashboardRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Period=null,
        /** @var string|null */
        public ?string $Region=null,
        /** @var int|null */
        public ?int $Fy=null
    ) {
    }

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

PHP ExecutiveDashboardRequest DTOs

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

HTTP + XML

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

GET /v1/dashboards/executive HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ExecutiveDashboardResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Dashboard>
    <Backlog>
      <AwardsYtdUSD>0</AwardsYtdUSD>
      <BurnYtdUSD>0</BurnYtdUSD>
      <ByYear>
        <ExecBacklogYear>
          <ValueUSD>0</ValueUSD>
          <Year>String</Year>
        </ExecBacklogYear>
      </ByYear>
      <MonthsAhead>0</MonthsAhead>
      <TotalUSD>0</TotalUSD>
    </Backlog>
    <CostVsBilling>
      <ExecCostCategory>
        <BilledUSD>0</BilledUSD>
        <CostUSD>0</CostUSD>
        <Name>String</Name>
      </ExecCostCategory>
    </CostVsBilling>
    <DsoDays>0</DsoDays>
    <FromDate>0001-01-01T00:00:00</FromDate>
    <Fy>0</Fy>
    <Kpis>
      <ExecKpi>
        <Delta>String</Delta>
        <DeltaUp>false</DeltaUp>
        <Good>false</Good>
        <HasDelta>false</HasDelta>
        <Key>String</Key>
        <Label>String</Label>
        <Sub_>String</Sub_>
        <Value>String</Value>
      </ExecKpi>
    </Kpis>
    <Monthly>
      <ExecMonthPoint>
        <CostUSD>0</CostUSD>
        <Month>String</Month>
        <RevenueUSD>0</RevenueUSD>
      </ExecMonthPoint>
    </Monthly>
    <Period>String</Period>
    <Pipeline>
      <ExecPipelineStage>
        <Count>0</Count>
        <Stage>String</Stage>
        <ValueUSD>0</ValueUSD>
      </ExecPipelineStage>
    </Pipeline>
    <Receivables>
      <ExecAgingBucket>
        <AmountUSD>0</AmountUSD>
        <Bucket>String</Bucket>
        <IsRetainage>false</IsRetainage>
      </ExecAgingBucket>
    </Receivables>
    <RetainageUSD>0</RetainageUSD>
    <Safety>
      <ExecSafetyMetric>
        <Good>false</Good>
        <Label>String</Label>
        <Sub_>String</Sub_>
        <Value>String</Value>
      </ExecSafetyMetric>
    </Safety>
    <ToDate>0001-01-01T00:00:00</ToDate>
    <WinRatePct>0</WinRatePct>
    <Wip>
      <ExecWipRow>
        <BilledUSD>0</BilledUSD>
        <ContractId>0</ContractId>
        <FadePts>0</FadePts>
        <MarginPct>0</MarginPct>
        <Name>String</Name>
        <OverUnderUSD>0</OverUnderUSD>
        <Owner>String</Owner>
        <PctComplete>0</PctComplete>
        <ValueUSD>0</ValueUSD>
      </ExecWipRow>
    </Wip>
  </Dashboard>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
</ExecutiveDashboardResponse>