Trendsic Platform Service

<back to all web services

DispatchReportRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/dashboard/dispatch
import 'package:servicestack/servicestack.dart';

class DashboardStatTile implements IConvertible
{
    String? Key;
    String? Label;
    double? Value;
    double? PreviousValue;
    String? Unit;
    double? DeltaPct;

    DashboardStatTile({this.Key,this.Label,this.Value,this.PreviousValue,this.Unit,this.DeltaPct});
    DashboardStatTile.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Key = json['Key'];
        Label = json['Label'];
        Value = JsonConverters.toDouble(json['Value']);
        PreviousValue = JsonConverters.toDouble(json['PreviousValue']);
        Unit = json['Unit'];
        DeltaPct = JsonConverters.toDouble(json['DeltaPct']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Key': Key,
        'Label': Label,
        'Value': Value,
        'PreviousValue': PreviousValue,
        'Unit': Unit,
        'DeltaPct': DeltaPct
    };

    getTypeName() => "DashboardStatTile";
    TypeContext? context = _ctx;
}

class DispatchReportDayRow implements IConvertible
{
    String? Label;
    int? Loads;
    double? Revenue;
    double? Pay;
    double? Qty;
    double? AvgCycleMins;

    DispatchReportDayRow({this.Label,this.Loads,this.Revenue,this.Pay,this.Qty,this.AvgCycleMins});
    DispatchReportDayRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Label = json['Label'];
        Loads = json['Loads'];
        Revenue = JsonConverters.toDouble(json['Revenue']);
        Pay = JsonConverters.toDouble(json['Pay']);
        Qty = JsonConverters.toDouble(json['Qty']);
        AvgCycleMins = JsonConverters.toDouble(json['AvgCycleMins']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Label': Label,
        'Loads': Loads,
        'Revenue': Revenue,
        'Pay': Pay,
        'Qty': Qty,
        'AvgCycleMins': AvgCycleMins
    };

    getTypeName() => "DispatchReportDayRow";
    TypeContext? context = _ctx;
}

class DispatchReportModuleRow implements IConvertible
{
    String? Module;
    int? Loads;
    double? Qty;
    double? Revenue;
    double? Pay;

    DispatchReportModuleRow({this.Module,this.Loads,this.Qty,this.Revenue,this.Pay});
    DispatchReportModuleRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Module = json['Module'];
        Loads = json['Loads'];
        Qty = JsonConverters.toDouble(json['Qty']);
        Revenue = JsonConverters.toDouble(json['Revenue']);
        Pay = JsonConverters.toDouble(json['Pay']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Module': Module,
        'Loads': Loads,
        'Qty': Qty,
        'Revenue': Revenue,
        'Pay': Pay
    };

    getTypeName() => "DispatchReportModuleRow";
    TypeContext? context = _ctx;
}

class DispatchReportLaneRow implements IConvertible
{
    String? SupplierName;
    String? SourceLabel;
    int? Loads;
    double? Qty;
    double? Revenue;
    double? AvgCycleMins;

    DispatchReportLaneRow({this.SupplierName,this.SourceLabel,this.Loads,this.Qty,this.Revenue,this.AvgCycleMins});
    DispatchReportLaneRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        SupplierName = json['SupplierName'];
        SourceLabel = json['SourceLabel'];
        Loads = json['Loads'];
        Qty = JsonConverters.toDouble(json['Qty']);
        Revenue = JsonConverters.toDouble(json['Revenue']);
        AvgCycleMins = JsonConverters.toDouble(json['AvgCycleMins']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'SupplierName': SupplierName,
        'SourceLabel': SourceLabel,
        'Loads': Loads,
        'Qty': Qty,
        'Revenue': Revenue,
        'AvgCycleMins': AvgCycleMins
    };

    getTypeName() => "DispatchReportLaneRow";
    TypeContext? context = _ctx;
}

class DispatchReportTruckRow implements IConvertible
{
    String? TruckLabel;
    String? DriverLabel;
    int? Loads;
    double? Qty;
    double? Revenue;
    double? Pay;
    double? AvgCycleMins;
    int? DaysActive;

    DispatchReportTruckRow({this.TruckLabel,this.DriverLabel,this.Loads,this.Qty,this.Revenue,this.Pay,this.AvgCycleMins,this.DaysActive});
    DispatchReportTruckRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        TruckLabel = json['TruckLabel'];
        DriverLabel = json['DriverLabel'];
        Loads = json['Loads'];
        Qty = JsonConverters.toDouble(json['Qty']);
        Revenue = JsonConverters.toDouble(json['Revenue']);
        Pay = JsonConverters.toDouble(json['Pay']);
        AvgCycleMins = JsonConverters.toDouble(json['AvgCycleMins']);
        DaysActive = json['DaysActive'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'TruckLabel': TruckLabel,
        'DriverLabel': DriverLabel,
        'Loads': Loads,
        'Qty': Qty,
        'Revenue': Revenue,
        'Pay': Pay,
        'AvgCycleMins': AvgCycleMins,
        'DaysActive': DaysActive
    };

    getTypeName() => "DispatchReportTruckRow";
    TypeContext? context = _ctx;
}

class DispatchReportDriverRow implements IConvertible
{
    String? Driver;
    int? DriverContactId;
    int? Loads;
    double? Qty;
    double? Pay;
    int? DaysActive;
    int? Unpriced;

    DispatchReportDriverRow({this.Driver,this.DriverContactId,this.Loads,this.Qty,this.Pay,this.DaysActive,this.Unpriced});
    DispatchReportDriverRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Driver = json['Driver'];
        DriverContactId = json['DriverContactId'];
        Loads = json['Loads'];
        Qty = JsonConverters.toDouble(json['Qty']);
        Pay = JsonConverters.toDouble(json['Pay']);
        DaysActive = json['DaysActive'];
        Unpriced = json['Unpriced'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Driver': Driver,
        'DriverContactId': DriverContactId,
        'Loads': Loads,
        'Qty': Qty,
        'Pay': Pay,
        'DaysActive': DaysActive,
        'Unpriced': Unpriced
    };

    getTypeName() => "DispatchReportDriverRow";
    TypeContext? context = _ctx;
}

class DispatchReportJobRow implements IConvertible
{
    String? JobCode;
    String? Customer;
    String? Cargo;
    String? Route;
    int? Miles;
    double? Revenue;
    double? Pay;
    double? MarginPct;
    DateTime? ClosedUtc;

    DispatchReportJobRow({this.JobCode,this.Customer,this.Cargo,this.Route,this.Miles,this.Revenue,this.Pay,this.MarginPct,this.ClosedUtc});
    DispatchReportJobRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        JobCode = json['JobCode'];
        Customer = json['Customer'];
        Cargo = json['Cargo'];
        Route = json['Route'];
        Miles = json['Miles'];
        Revenue = JsonConverters.toDouble(json['Revenue']);
        Pay = JsonConverters.toDouble(json['Pay']);
        MarginPct = JsonConverters.toDouble(json['MarginPct']);
        ClosedUtc = JsonConverters.fromJson(json['ClosedUtc'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'JobCode': JobCode,
        'Customer': Customer,
        'Cargo': Cargo,
        'Route': Route,
        'Miles': Miles,
        'Revenue': Revenue,
        'Pay': Pay,
        'MarginPct': MarginPct,
        'ClosedUtc': JsonConverters.toJson(ClosedUtc,'DateTime',context!)
    };

    getTypeName() => "DispatchReportJobRow";
    TypeContext? context = _ctx;
}

class DispatchReportIncidentRow implements IConvertible
{
    String? Kind;
    int? Opened;
    int? Resolved;
    double? AvgResolveMins;

    DispatchReportIncidentRow({this.Kind,this.Opened,this.Resolved,this.AvgResolveMins});
    DispatchReportIncidentRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Kind = json['Kind'];
        Opened = json['Opened'];
        Resolved = json['Resolved'];
        AvgResolveMins = JsonConverters.toDouble(json['AvgResolveMins']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Kind': Kind,
        'Opened': Opened,
        'Resolved': Resolved,
        'AvgResolveMins': AvgResolveMins
    };

    getTypeName() => "DispatchReportIncidentRow";
    TypeContext? context = _ctx;
}

class DispatchReportHoldRow implements IConvertible
{
    String? ScopeKind;
    int? Holds;
    int? PausedMins;
    int? Weather;
    int? FromIncidents;

    DispatchReportHoldRow({this.ScopeKind,this.Holds,this.PausedMins,this.Weather,this.FromIncidents});
    DispatchReportHoldRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ScopeKind = json['ScopeKind'];
        Holds = json['Holds'];
        PausedMins = json['PausedMins'];
        Weather = json['Weather'];
        FromIncidents = json['FromIncidents'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ScopeKind': ScopeKind,
        'Holds': Holds,
        'PausedMins': PausedMins,
        'Weather': Weather,
        'FromIncidents': FromIncidents
    };

    getTypeName() => "DispatchReportHoldRow";
    TypeContext? context = _ctx;
}

class DispatchReportResponse implements IConvertible
{
    List<DashboardStatTile>? Stats = [];
    String? Unit;
    List<DispatchReportDayRow>? Trend = [];
    List<DispatchReportModuleRow>? ByModule = [];
    List<DispatchReportLaneRow>? ByLane = [];
    List<DispatchReportTruckRow>? ByTruck = [];
    List<DispatchReportDriverRow>? ByDriver = [];
    List<DispatchReportJobRow>? Jobs = [];
    List<DispatchReportIncidentRow>? Incidents = [];
    List<DispatchReportHoldRow>? Holds = [];
    ResponseStatus? ResponseStatus;

    DispatchReportResponse({this.Stats,this.Unit,this.Trend,this.ByModule,this.ByLane,this.ByTruck,this.ByDriver,this.Jobs,this.Incidents,this.Holds,this.ResponseStatus});
    DispatchReportResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Stats = JsonConverters.fromJson(json['Stats'],'List<DashboardStatTile>',context!);
        Unit = json['Unit'];
        Trend = JsonConverters.fromJson(json['Trend'],'List<DispatchReportDayRow>',context!);
        ByModule = JsonConverters.fromJson(json['ByModule'],'List<DispatchReportModuleRow>',context!);
        ByLane = JsonConverters.fromJson(json['ByLane'],'List<DispatchReportLaneRow>',context!);
        ByTruck = JsonConverters.fromJson(json['ByTruck'],'List<DispatchReportTruckRow>',context!);
        ByDriver = JsonConverters.fromJson(json['ByDriver'],'List<DispatchReportDriverRow>',context!);
        Jobs = JsonConverters.fromJson(json['Jobs'],'List<DispatchReportJobRow>',context!);
        Incidents = JsonConverters.fromJson(json['Incidents'],'List<DispatchReportIncidentRow>',context!);
        Holds = JsonConverters.fromJson(json['Holds'],'List<DispatchReportHoldRow>',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Stats': JsonConverters.toJson(Stats,'List<DashboardStatTile>',context!),
        'Unit': Unit,
        'Trend': JsonConverters.toJson(Trend,'List<DispatchReportDayRow>',context!),
        'ByModule': JsonConverters.toJson(ByModule,'List<DispatchReportModuleRow>',context!),
        'ByLane': JsonConverters.toJson(ByLane,'List<DispatchReportLaneRow>',context!),
        'ByTruck': JsonConverters.toJson(ByTruck,'List<DispatchReportTruckRow>',context!),
        'ByDriver': JsonConverters.toJson(ByDriver,'List<DispatchReportDriverRow>',context!),
        'Jobs': JsonConverters.toJson(Jobs,'List<DispatchReportJobRow>',context!),
        'Incidents': JsonConverters.toJson(Incidents,'List<DispatchReportIncidentRow>',context!),
        'Holds': JsonConverters.toJson(Holds,'List<DispatchReportHoldRow>',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "DispatchReportResponse";
    TypeContext? context = _ctx;
}

class DispatchReportRequest implements IConvertible
{
    DateTime? FromDate;
    DateTime? ToDate;
    List<String>? LocationIds = [];

    DispatchReportRequest({this.FromDate,this.ToDate,this.LocationIds});
    DispatchReportRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FromDate = JsonConverters.fromJson(json['FromDate'],'DateTime',context!);
        ToDate = JsonConverters.fromJson(json['ToDate'],'DateTime',context!);
        LocationIds = JsonConverters.fromJson(json['LocationIds'],'List<String>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FromDate': JsonConverters.toJson(FromDate,'DateTime',context!),
        'ToDate': JsonConverters.toJson(ToDate,'DateTime',context!),
        'LocationIds': JsonConverters.toJson(LocationIds,'List<String>',context!)
    };

    getTypeName() => "DispatchReportRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'DashboardStatTile': TypeInfo(TypeOf.Class, create:() => DashboardStatTile()),
    'DispatchReportDayRow': TypeInfo(TypeOf.Class, create:() => DispatchReportDayRow()),
    'DispatchReportModuleRow': TypeInfo(TypeOf.Class, create:() => DispatchReportModuleRow()),
    'DispatchReportLaneRow': TypeInfo(TypeOf.Class, create:() => DispatchReportLaneRow()),
    'DispatchReportTruckRow': TypeInfo(TypeOf.Class, create:() => DispatchReportTruckRow()),
    'DispatchReportDriverRow': TypeInfo(TypeOf.Class, create:() => DispatchReportDriverRow()),
    'DispatchReportJobRow': TypeInfo(TypeOf.Class, create:() => DispatchReportJobRow()),
    'DispatchReportIncidentRow': TypeInfo(TypeOf.Class, create:() => DispatchReportIncidentRow()),
    'DispatchReportHoldRow': TypeInfo(TypeOf.Class, create:() => DispatchReportHoldRow()),
    'DispatchReportResponse': TypeInfo(TypeOf.Class, create:() => DispatchReportResponse()),
    'List<DashboardStatTile>': TypeInfo(TypeOf.Class, create:() => <DashboardStatTile>[]),
    'List<DispatchReportDayRow>': TypeInfo(TypeOf.Class, create:() => <DispatchReportDayRow>[]),
    'List<DispatchReportModuleRow>': TypeInfo(TypeOf.Class, create:() => <DispatchReportModuleRow>[]),
    'List<DispatchReportLaneRow>': TypeInfo(TypeOf.Class, create:() => <DispatchReportLaneRow>[]),
    'List<DispatchReportTruckRow>': TypeInfo(TypeOf.Class, create:() => <DispatchReportTruckRow>[]),
    'List<DispatchReportDriverRow>': TypeInfo(TypeOf.Class, create:() => <DispatchReportDriverRow>[]),
    'List<DispatchReportJobRow>': TypeInfo(TypeOf.Class, create:() => <DispatchReportJobRow>[]),
    'List<DispatchReportIncidentRow>': TypeInfo(TypeOf.Class, create:() => <DispatchReportIncidentRow>[]),
    'List<DispatchReportHoldRow>': TypeInfo(TypeOf.Class, create:() => <DispatchReportHoldRow>[]),
    'DispatchReportRequest': TypeInfo(TypeOf.Class, create:() => DispatchReportRequest()),
});

Dart DispatchReportRequest 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.

POST /v1/dashboard/dispatch HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<DispatchReportRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <FromDate>0001-01-01T00:00:00</FromDate>
  <LocationIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:guid>00000000-0000-0000-0000-000000000000</d2p1:guid>
  </LocationIds>
  <ToDate>0001-01-01T00:00:00</ToDate>
</DispatchReportRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DispatchReportResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ByDriver>
    <DispatchReportDriverRow>
      <DaysActive>0</DaysActive>
      <Driver>String</Driver>
      <DriverContactId>0</DriverContactId>
      <Loads>0</Loads>
      <Pay>0</Pay>
      <Qty>0</Qty>
      <Unpriced>0</Unpriced>
    </DispatchReportDriverRow>
  </ByDriver>
  <ByLane>
    <DispatchReportLaneRow>
      <AvgCycleMins>0</AvgCycleMins>
      <Loads>0</Loads>
      <Qty>0</Qty>
      <Revenue>0</Revenue>
      <SourceLabel>String</SourceLabel>
      <SupplierName>String</SupplierName>
    </DispatchReportLaneRow>
  </ByLane>
  <ByModule>
    <DispatchReportModuleRow>
      <Loads>0</Loads>
      <Module>String</Module>
      <Pay>0</Pay>
      <Qty>0</Qty>
      <Revenue>0</Revenue>
    </DispatchReportModuleRow>
  </ByModule>
  <ByTruck>
    <DispatchReportTruckRow>
      <AvgCycleMins>0</AvgCycleMins>
      <DaysActive>0</DaysActive>
      <DriverLabel>String</DriverLabel>
      <Loads>0</Loads>
      <Pay>0</Pay>
      <Qty>0</Qty>
      <Revenue>0</Revenue>
      <TruckLabel>String</TruckLabel>
    </DispatchReportTruckRow>
  </ByTruck>
  <Holds>
    <DispatchReportHoldRow>
      <FromIncidents>0</FromIncidents>
      <Holds>0</Holds>
      <PausedMins>0</PausedMins>
      <ScopeKind>String</ScopeKind>
      <Weather>0</Weather>
    </DispatchReportHoldRow>
  </Holds>
  <Incidents>
    <DispatchReportIncidentRow>
      <AvgResolveMins>0</AvgResolveMins>
      <Kind>String</Kind>
      <Opened>0</Opened>
      <Resolved>0</Resolved>
    </DispatchReportIncidentRow>
  </Incidents>
  <Jobs>
    <DispatchReportJobRow>
      <Cargo>String</Cargo>
      <ClosedUtc>0001-01-01T00:00:00</ClosedUtc>
      <Customer>String</Customer>
      <JobCode>String</JobCode>
      <MarginPct>0</MarginPct>
      <Miles>0</Miles>
      <Pay>0</Pay>
      <Revenue>0</Revenue>
      <Route>String</Route>
    </DispatchReportJobRow>
  </Jobs>
  <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>
  <Stats>
    <DashboardStatTile>
      <Key>String</Key>
      <Label>String</Label>
      <PreviousValue>0</PreviousValue>
      <Unit>String</Unit>
      <Value>0</Value>
    </DashboardStatTile>
  </Stats>
  <Trend>
    <DispatchReportDayRow>
      <AvgCycleMins>0</AvgCycleMins>
      <Label>String</Label>
      <Loads>0</Loads>
      <Pay>0</Pay>
      <Qty>0</Qty>
      <Revenue>0</Revenue>
    </DispatchReportDayRow>
  </Trend>
  <Unit>String</Unit>
</DispatchReportResponse>