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 .jsv suffix or ?format=jsv

HTTP + JSV

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: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	FromDate: 0001-01-01,
	ToDate: 0001-01-01,
	LocationIds: 
	[
		00000000000000000000000000000000
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Stats: 
	[
		{
			Key: String,
			Label: String,
			Value: 0,
			PreviousValue: 0,
			Unit: String
		}
	],
	Unit: String,
	Trend: 
	[
		{
			Label: String,
			Loads: 0,
			Revenue: 0,
			Pay: 0,
			Qty: 0,
			AvgCycleMins: 0
		}
	],
	ByModule: 
	[
		{
			Module: String,
			Loads: 0,
			Qty: 0,
			Revenue: 0,
			Pay: 0
		}
	],
	ByLane: 
	[
		{
			SupplierName: String,
			SourceLabel: String,
			Loads: 0,
			Qty: 0,
			Revenue: 0,
			AvgCycleMins: 0
		}
	],
	ByTruck: 
	[
		{
			TruckLabel: String,
			DriverLabel: String,
			Loads: 0,
			Qty: 0,
			Revenue: 0,
			Pay: 0,
			AvgCycleMins: 0,
			DaysActive: 0
		}
	],
	ByDriver: 
	[
		{
			Driver: String,
			DriverContactId: 0,
			Loads: 0,
			Qty: 0,
			Pay: 0,
			DaysActive: 0,
			Unpriced: 0
		}
	],
	Jobs: 
	[
		{
			JobCode: String,
			Customer: String,
			Cargo: String,
			Route: String,
			Miles: 0,
			Revenue: 0,
			Pay: 0,
			MarginPct: 0,
			ClosedUtc: 0001-01-01
		}
	],
	Incidents: 
	[
		{
			Kind: String,
			Opened: 0,
			Resolved: 0,
			AvgResolveMins: 0
		}
	],
	Holds: 
	[
		{
			ScopeKind: String,
			Holds: 0,
			PausedMins: 0,
			Weather: 0,
			FromIncidents: 0
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}