Trendsic Platform Service

<back to all web services

VisitBoardRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/visits/board
<?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 VisitCard implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $VisitKey=null,
        /** @var int */
        public int $JobID=0,
        /** @var int */
        public int $ProjectID=0,
        /** @var string|null */
        public ?string $ProjectUID=null,
        /** @var int|null */
        public ?int $AgreementJobID=null,
        /** @var string|null */
        public ?string $ScheduledDate=null,
        /** @var string|null */
        public ?string $CustomerName=null,
        /** @var string|null */
        public ?string $JobName=null,
        /** @var string|null */
        public ?string $LocationName=null,
        /** @var string|null */
        public ?string $City=null,
        /** @var string|null */
        public ?string $Zip=null,
        /** @var float|null */
        public ?float $Lat=null,
        /** @var float|null */
        public ?float $Lng=null,
        /** @var int|null */
        public ?int $CrewID=null,
        /** @var string|null */
        public ?string $CrewName=null,
        /** @var int */
        public int $SortOrder=0,
        /** @var string|null */
        public ?string $Status=null,
        /** @var int */
        public int $DurationMinutes=0,
        /** @var string|null */
        public ?string $EtaWindow=null,
        /** @var bool|null */
        public ?bool $IsCommercial=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['VisitKey'])) $this->VisitKey = $o['VisitKey'];
        if (isset($o['JobID'])) $this->JobID = $o['JobID'];
        if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
        if (isset($o['ProjectUID'])) $this->ProjectUID = $o['ProjectUID'];
        if (isset($o['AgreementJobID'])) $this->AgreementJobID = $o['AgreementJobID'];
        if (isset($o['ScheduledDate'])) $this->ScheduledDate = $o['ScheduledDate'];
        if (isset($o['CustomerName'])) $this->CustomerName = $o['CustomerName'];
        if (isset($o['JobName'])) $this->JobName = $o['JobName'];
        if (isset($o['LocationName'])) $this->LocationName = $o['LocationName'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['Zip'])) $this->Zip = $o['Zip'];
        if (isset($o['Lat'])) $this->Lat = $o['Lat'];
        if (isset($o['Lng'])) $this->Lng = $o['Lng'];
        if (isset($o['CrewID'])) $this->CrewID = $o['CrewID'];
        if (isset($o['CrewName'])) $this->CrewName = $o['CrewName'];
        if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['DurationMinutes'])) $this->DurationMinutes = $o['DurationMinutes'];
        if (isset($o['EtaWindow'])) $this->EtaWindow = $o['EtaWindow'];
        if (isset($o['IsCommercial'])) $this->IsCommercial = $o['IsCommercial'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->VisitKey)) $o['VisitKey'] = $this->VisitKey;
        if (isset($this->JobID)) $o['JobID'] = $this->JobID;
        if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
        if (isset($this->ProjectUID)) $o['ProjectUID'] = $this->ProjectUID;
        if (isset($this->AgreementJobID)) $o['AgreementJobID'] = $this->AgreementJobID;
        if (isset($this->ScheduledDate)) $o['ScheduledDate'] = $this->ScheduledDate;
        if (isset($this->CustomerName)) $o['CustomerName'] = $this->CustomerName;
        if (isset($this->JobName)) $o['JobName'] = $this->JobName;
        if (isset($this->LocationName)) $o['LocationName'] = $this->LocationName;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->Zip)) $o['Zip'] = $this->Zip;
        if (isset($this->Lat)) $o['Lat'] = $this->Lat;
        if (isset($this->Lng)) $o['Lng'] = $this->Lng;
        if (isset($this->CrewID)) $o['CrewID'] = $this->CrewID;
        if (isset($this->CrewName)) $o['CrewName'] = $this->CrewName;
        if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->DurationMinutes)) $o['DurationMinutes'] = $this->DurationMinutes;
        if (isset($this->EtaWindow)) $o['EtaWindow'] = $this->EtaWindow;
        if (isset($this->IsCommercial)) $o['IsCommercial'] = $this->IsCommercial;
        return empty($o) ? new class(){} : $o;
    }
}

class CrewColumn implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $CrewID=0,
        /** @var string|null */
        public ?string $CrewName=null,
        /** @var string|null */
        public ?string $CrewColor=null,
        /** @var int */
        public int $MemberCount=0,
        /** @var array<VisitCard>|null */
        public ?array $Visits=null,
        /** @var float */
        public float $DriveMiles=0.0,
        /** @var int */
        public int $DriveMinutes=0,
        /** @var int */
        public int $OnSiteMinutes=0,
        /** @var int */
        public int $BillablePct=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CrewID'])) $this->CrewID = $o['CrewID'];
        if (isset($o['CrewName'])) $this->CrewName = $o['CrewName'];
        if (isset($o['CrewColor'])) $this->CrewColor = $o['CrewColor'];
        if (isset($o['MemberCount'])) $this->MemberCount = $o['MemberCount'];
        if (isset($o['Visits'])) $this->Visits = JsonConverters::fromArray('VisitCard', $o['Visits']);
        if (isset($o['DriveMiles'])) $this->DriveMiles = $o['DriveMiles'];
        if (isset($o['DriveMinutes'])) $this->DriveMinutes = $o['DriveMinutes'];
        if (isset($o['OnSiteMinutes'])) $this->OnSiteMinutes = $o['OnSiteMinutes'];
        if (isset($o['BillablePct'])) $this->BillablePct = $o['BillablePct'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CrewID)) $o['CrewID'] = $this->CrewID;
        if (isset($this->CrewName)) $o['CrewName'] = $this->CrewName;
        if (isset($this->CrewColor)) $o['CrewColor'] = $this->CrewColor;
        if (isset($this->MemberCount)) $o['MemberCount'] = $this->MemberCount;
        if (isset($this->Visits)) $o['Visits'] = JsonConverters::toArray('VisitCard', $this->Visits);
        if (isset($this->DriveMiles)) $o['DriveMiles'] = $this->DriveMiles;
        if (isset($this->DriveMinutes)) $o['DriveMinutes'] = $this->DriveMinutes;
        if (isset($this->OnSiteMinutes)) $o['OnSiteMinutes'] = $this->OnSiteMinutes;
        if (isset($this->BillablePct)) $o['BillablePct'] = $this->BillablePct;
        return empty($o) ? new class(){} : $o;
    }
}

class BoardReadiness implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $TotalVisits=0,
        /** @var int */
        public int $Assigned=0,
        /** @var int */
        public int $Unassigned=0,
        /** @var int */
        public int $Conflicts=0,
        /** @var int */
        public int $AssignedPct=0
    ) {
    }

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

class VisitBoardResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Date=null,
        /** @var array<CrewColumn>|null */
        public ?array $Crews=null,
        /** @var array<VisitCard>|null */
        public ?array $Unassigned=null,
        /** @var BoardReadiness|null */
        public ?BoardReadiness $Readiness=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Date'])) $this->Date = $o['Date'];
        if (isset($o['Crews'])) $this->Crews = JsonConverters::fromArray('CrewColumn', $o['Crews']);
        if (isset($o['Unassigned'])) $this->Unassigned = JsonConverters::fromArray('VisitCard', $o['Unassigned']);
        if (isset($o['Readiness'])) $this->Readiness = JsonConverters::from('BoardReadiness', $o['Readiness']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Date)) $o['Date'] = $this->Date;
        if (isset($this->Crews)) $o['Crews'] = JsonConverters::toArray('CrewColumn', $this->Crews);
        if (isset($this->Unassigned)) $o['Unassigned'] = JsonConverters::toArray('VisitCard', $this->Unassigned);
        if (isset($this->Readiness)) $o['Readiness'] = JsonConverters::to('BoardReadiness', $this->Readiness);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class VisitBoardRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Date=null
    ) {
    }

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

PHP VisitBoardRequest 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/visits/board HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<VisitBoardResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Crews>
    <CrewColumn>
      <BillablePct>0</BillablePct>
      <CrewColor>String</CrewColor>
      <CrewID>0</CrewID>
      <CrewName>String</CrewName>
      <DriveMiles>0</DriveMiles>
      <DriveMinutes>0</DriveMinutes>
      <MemberCount>0</MemberCount>
      <OnSiteMinutes>0</OnSiteMinutes>
      <Visits>
        <VisitCard>
          <AgreementJobID>0</AgreementJobID>
          <City>String</City>
          <CrewID>0</CrewID>
          <CrewName>String</CrewName>
          <CustomerName>String</CustomerName>
          <DurationMinutes>0</DurationMinutes>
          <EtaWindow>String</EtaWindow>
          <IsCommercial>false</IsCommercial>
          <JobID>0</JobID>
          <JobName>String</JobName>
          <Lat>0</Lat>
          <Lng>0</Lng>
          <LocationName>String</LocationName>
          <ProjectID>0</ProjectID>
          <ProjectUID>String</ProjectUID>
          <ScheduledDate>String</ScheduledDate>
          <SortOrder>0</SortOrder>
          <Status>String</Status>
          <VisitKey>String</VisitKey>
          <Zip>String</Zip>
        </VisitCard>
      </Visits>
    </CrewColumn>
  </Crews>
  <Date>String</Date>
  <Readiness>
    <Assigned>0</Assigned>
    <AssignedPct>0</AssignedPct>
    <Conflicts>0</Conflicts>
    <TotalVisits>0</TotalVisits>
    <Unassigned>0</Unassigned>
  </Readiness>
  <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>
  <Unassigned>
    <VisitCard>
      <AgreementJobID>0</AgreementJobID>
      <City>String</City>
      <CrewID>0</CrewID>
      <CrewName>String</CrewName>
      <CustomerName>String</CustomerName>
      <DurationMinutes>0</DurationMinutes>
      <EtaWindow>String</EtaWindow>
      <IsCommercial>false</IsCommercial>
      <JobID>0</JobID>
      <JobName>String</JobName>
      <Lat>0</Lat>
      <Lng>0</Lng>
      <LocationName>String</LocationName>
      <ProjectID>0</ProjectID>
      <ProjectUID>String</ProjectUID>
      <ScheduledDate>String</ScheduledDate>
      <SortOrder>0</SortOrder>
      <Status>String</Status>
      <VisitKey>String</VisitKey>
      <Zip>String</Zip>
    </VisitCard>
  </Unassigned>
</VisitBoardResponse>