Trendsic Platform Service

<back to all web services

RoutePlanWeekRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/routeplan/week
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 RoutePlanCrew:
    crew_i_d: int = 0
    crew_name: Optional[str] = None
    crew_color: Optional[str] = None
    home_zip: Optional[str] = None
    yard_lat: Optional[float] = None
    yard_lng: Optional[float] = None
    daily_capacity_min: int = 0
    weekly_capacity_min: int = 0
    specialist: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RoutePlanVisit:
    agreement_i_d: int = 0
    agreement_job_i_d: Optional[int] = None
    name: Optional[str] = None
    sub: Optional[str] = None
    service_type: Optional[str] = None
    zip: Optional[str] = None
    area: Optional[str] = None
    lat: Optional[float] = None
    lng: Optional[float] = None
    duration_min: int = 0
    due_iso: Optional[str] = None
    due_label: Optional[str] = None
    overdue: bool = False
    default_crew_i_d: Optional[int] = None
    route_crew_i_d: Optional[int] = None
    route_seq: Optional[int] = None
    route_date_iso: Optional[str] = None
    late_days: int = 0
    auto_pay: bool = False
    skip_policy: Optional[str] = None
    skip_credit_amount: Decimal = decimal.Decimal(0)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RoutePlanSkippedVisit:
    agreement_job_i_d: int = 0
    agreement_i_d: int = 0
    name: Optional[str] = None
    date_iso: Optional[str] = None
    reason: Optional[str] = None
    credit_amount: Decimal = decimal.Decimal(0)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RoutePlanWeekResponse:
    from_iso: Optional[str] = None
    to_iso: Optional[str] = None
    crews: List[RoutePlanCrew] = field(default_factory=list)
    visits: List[RoutePlanVisit] = field(default_factory=list)
    skipped: List[RoutePlanSkippedVisit] = field(default_factory=list)
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RoutePlanWeekRequest:
    from_: Optional[str] = field(metadata=config(field_name='from'), default=None)

Python RoutePlanWeekRequest DTOs

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

HTTP + OTHER

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

GET /v1/routeplan/week HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"FromIso":"String","ToIso":"String","Crews":[{"CrewID":0,"CrewName":"String","CrewColor":"String","HomeZip":"String","YardLat":0,"YardLng":0,"DailyCapacityMin":0,"WeeklyCapacityMin":0,"Specialist":false}],"Visits":[{"AgreementID":0,"AgreementJobID":0,"Name":"String","Sub":"String","ServiceType":"String","Zip":"String","Area":"String","Lat":0,"Lng":0,"DurationMin":0,"DueIso":"String","DueLabel":"String","Overdue":false,"DefaultCrewID":0,"RouteCrewID":0,"RouteSeq":0,"RouteDateIso":"String","LateDays":0,"AutoPay":false,"SkipPolicy":"String","SkipCreditAmount":0}],"Skipped":[{"AgreementJobID":0,"AgreementID":0,"Name":"String","DateIso":"String","Reason":"String","CreditAmount":0}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}