| GET,OPTIONS | /v1/visits/board |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VisitCard:
visit_key: Optional[str] = None
job_i_d: int = 0
project_i_d: int = 0
project_u_i_d: Optional[str] = None
agreement_job_i_d: Optional[int] = None
scheduled_date: Optional[str] = None
customer_name: Optional[str] = None
job_name: Optional[str] = None
location_name: Optional[str] = None
city: Optional[str] = None
zip: Optional[str] = None
lat: Optional[float] = None
lng: Optional[float] = None
crew_i_d: Optional[int] = None
crew_name: Optional[str] = None
sort_order: int = 0
status: Optional[str] = None
duration_minutes: int = 0
eta_window: Optional[str] = None
is_commercial: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CrewColumn:
crew_i_d: int = 0
crew_name: Optional[str] = None
crew_color: Optional[str] = None
member_count: int = 0
visits: List[VisitCard] = field(default_factory=list)
drive_miles: float = 0.0
drive_minutes: int = 0
on_site_minutes: int = 0
billable_pct: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BoardReadiness:
total_visits: int = 0
assigned: int = 0
unassigned: int = 0
conflicts: int = 0
assigned_pct: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VisitBoardResponse:
date: Optional[str] = None
crews: List[CrewColumn] = field(default_factory=list)
unassigned: List[VisitCard] = field(default_factory=list)
readiness: Optional[BoardReadiness] = None
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VisitBoardRequest:
date: Optional[str] = None
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Date: String,
Crews:
[
{
CrewID: 0,
CrewName: String,
CrewColor: String,
MemberCount: 0,
Visits:
[
{
VisitKey: String,
JobID: 0,
ProjectID: 0,
ProjectUID: String,
AgreementJobID: 0,
ScheduledDate: String,
CustomerName: String,
JobName: String,
LocationName: String,
City: String,
Zip: String,
Lat: 0,
Lng: 0,
CrewID: 0,
CrewName: String,
SortOrder: 0,
Status: String,
DurationMinutes: 0,
EtaWindow: String,
IsCommercial: False
}
],
DriveMiles: 0,
DriveMinutes: 0,
OnSiteMinutes: 0,
BillablePct: 0
}
],
Unassigned:
[
{
VisitKey: String,
JobID: 0,
ProjectID: 0,
ProjectUID: String,
AgreementJobID: 0,
ScheduledDate: String,
CustomerName: String,
JobName: String,
LocationName: String,
City: String,
Zip: String,
Lat: 0,
Lng: 0,
CrewID: 0,
CrewName: String,
SortOrder: 0,
Status: String,
DurationMinutes: 0,
EtaWindow: String,
IsCommercial: False
}
],
Readiness:
{
TotalVisits: 0,
Assigned: 0,
Unassigned: 0,
Conflicts: 0,
AssignedPct: 0
},
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}