Trendsic Platform Service

<back to all web services

DispatchRateConfigSaveRequest

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

class DispatchRateConfigView implements IConvertible
{
    double? FuelSurchargePct;
    double? TransportPerMile;
    double? TransportJobMin;
    double? TransportEnclosedUpliftPct;
    double? OdBase;
    double? OdPerBag;
    double? OdPremiumUpliftPct;
    String? HaulBasis;
    String? Facility;
    String? Unit;
    double? LoadQty;

    DispatchRateConfigView({this.FuelSurchargePct,this.TransportPerMile,this.TransportJobMin,this.TransportEnclosedUpliftPct,this.OdBase,this.OdPerBag,this.OdPremiumUpliftPct,this.HaulBasis,this.Facility,this.Unit,this.LoadQty});
    DispatchRateConfigView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FuelSurchargePct = JsonConverters.toDouble(json['FuelSurchargePct']);
        TransportPerMile = JsonConverters.toDouble(json['TransportPerMile']);
        TransportJobMin = JsonConverters.toDouble(json['TransportJobMin']);
        TransportEnclosedUpliftPct = JsonConverters.toDouble(json['TransportEnclosedUpliftPct']);
        OdBase = JsonConverters.toDouble(json['OdBase']);
        OdPerBag = JsonConverters.toDouble(json['OdPerBag']);
        OdPremiumUpliftPct = JsonConverters.toDouble(json['OdPremiumUpliftPct']);
        HaulBasis = json['HaulBasis'];
        Facility = json['Facility'];
        Unit = json['Unit'];
        LoadQty = JsonConverters.toDouble(json['LoadQty']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FuelSurchargePct': FuelSurchargePct,
        'TransportPerMile': TransportPerMile,
        'TransportJobMin': TransportJobMin,
        'TransportEnclosedUpliftPct': TransportEnclosedUpliftPct,
        'OdBase': OdBase,
        'OdPerBag': OdPerBag,
        'OdPremiumUpliftPct': OdPremiumUpliftPct,
        'HaulBasis': HaulBasis,
        'Facility': Facility,
        'Unit': Unit,
        'LoadQty': LoadQty
    };

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

class DispatchLaneRateView implements IConvertible
{
    int? DispatchSiteID;
    int? DispatchSupplierID;
    String? SourceLabel;
    String? SupplierName;
    int? DispatchLaneRateID;
    double? Miles;
    double? RatePerTon;
    double? RatePerLoad;
    double? RatePerTonMile;
    double? RatePerHour;

    DispatchLaneRateView({this.DispatchSiteID,this.DispatchSupplierID,this.SourceLabel,this.SupplierName,this.DispatchLaneRateID,this.Miles,this.RatePerTon,this.RatePerLoad,this.RatePerTonMile,this.RatePerHour});
    DispatchLaneRateView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        DispatchSiteID = json['DispatchSiteID'];
        DispatchSupplierID = json['DispatchSupplierID'];
        SourceLabel = json['SourceLabel'];
        SupplierName = json['SupplierName'];
        DispatchLaneRateID = json['DispatchLaneRateID'];
        Miles = JsonConverters.toDouble(json['Miles']);
        RatePerTon = JsonConverters.toDouble(json['RatePerTon']);
        RatePerLoad = JsonConverters.toDouble(json['RatePerLoad']);
        RatePerTonMile = JsonConverters.toDouble(json['RatePerTonMile']);
        RatePerHour = JsonConverters.toDouble(json['RatePerHour']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'DispatchSiteID': DispatchSiteID,
        'DispatchSupplierID': DispatchSupplierID,
        'SourceLabel': SourceLabel,
        'SupplierName': SupplierName,
        'DispatchLaneRateID': DispatchLaneRateID,
        'Miles': Miles,
        'RatePerTon': RatePerTon,
        'RatePerLoad': RatePerLoad,
        'RatePerTonMile': RatePerTonMile,
        'RatePerHour': RatePerHour
    };

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

class DispatchZoneRateView implements IConvertible
{
    String? Zone;
    int? DispatchZoneRateID;
    double? Base;
    double? PerBag;
    double? PremiumUpliftPct;
    int? Drivers;

    DispatchZoneRateView({this.Zone,this.DispatchZoneRateID,this.Base,this.PerBag,this.PremiumUpliftPct,this.Drivers});
    DispatchZoneRateView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Zone = json['Zone'];
        DispatchZoneRateID = json['DispatchZoneRateID'];
        Base = JsonConverters.toDouble(json['Base']);
        PerBag = JsonConverters.toDouble(json['PerBag']);
        PremiumUpliftPct = JsonConverters.toDouble(json['PremiumUpliftPct']);
        Drivers = json['Drivers'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Zone': Zone,
        'DispatchZoneRateID': DispatchZoneRateID,
        'Base': Base,
        'PerBag': PerBag,
        'PremiumUpliftPct': PremiumUpliftPct,
        'Drivers': Drivers
    };

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

class DispatchPayPlanView implements IConvertible
{
    int? DispatchPayPlanID;
    String? Name;
    String? Basis;
    double? Rate;
    double? Rate2;
    DateTime? EffectiveDate;
    bool? IsActive;
    int? Drivers;

    DispatchPayPlanView({this.DispatchPayPlanID,this.Name,this.Basis,this.Rate,this.Rate2,this.EffectiveDate,this.IsActive,this.Drivers});
    DispatchPayPlanView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        DispatchPayPlanID = json['DispatchPayPlanID'];
        Name = json['Name'];
        Basis = json['Basis'];
        Rate = JsonConverters.toDouble(json['Rate']);
        Rate2 = JsonConverters.toDouble(json['Rate2']);
        EffectiveDate = JsonConverters.fromJson(json['EffectiveDate'],'DateTime',context!);
        IsActive = json['IsActive'];
        Drivers = json['Drivers'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'DispatchPayPlanID': DispatchPayPlanID,
        'Name': Name,
        'Basis': Basis,
        'Rate': Rate,
        'Rate2': Rate2,
        'EffectiveDate': JsonConverters.toJson(EffectiveDate,'DateTime',context!),
        'IsActive': IsActive,
        'Drivers': Drivers
    };

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

class DispatchRatesResponse implements IConvertible
{
    DispatchRateConfigView? Config;
    List<DispatchLaneRateView>? Lanes = [];
    List<DispatchZoneRateView>? Zones = [];
    List<DispatchPayPlanView>? Plans = [];
    int? Repriced;
    int? StillNoRevenue;
    int? StillNoPay;
    ResponseStatus? ResponseStatus;

    DispatchRatesResponse({this.Config,this.Lanes,this.Zones,this.Plans,this.Repriced,this.StillNoRevenue,this.StillNoPay,this.ResponseStatus});
    DispatchRatesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Config = JsonConverters.fromJson(json['Config'],'DispatchRateConfigView',context!);
        Lanes = JsonConverters.fromJson(json['Lanes'],'List<DispatchLaneRateView>',context!);
        Zones = JsonConverters.fromJson(json['Zones'],'List<DispatchZoneRateView>',context!);
        Plans = JsonConverters.fromJson(json['Plans'],'List<DispatchPayPlanView>',context!);
        Repriced = json['Repriced'];
        StillNoRevenue = json['StillNoRevenue'];
        StillNoPay = json['StillNoPay'];
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Config': JsonConverters.toJson(Config,'DispatchRateConfigView',context!),
        'Lanes': JsonConverters.toJson(Lanes,'List<DispatchLaneRateView>',context!),
        'Zones': JsonConverters.toJson(Zones,'List<DispatchZoneRateView>',context!),
        'Plans': JsonConverters.toJson(Plans,'List<DispatchPayPlanView>',context!),
        'Repriced': Repriced,
        'StillNoRevenue': StillNoRevenue,
        'StillNoPay': StillNoPay,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class DispatchRateConfigSaveRequest implements IConvertible
{
    DispatchRateConfigView? Config;

    DispatchRateConfigSaveRequest({this.Config});
    DispatchRateConfigSaveRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Config = JsonConverters.fromJson(json['Config'],'DispatchRateConfigView',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Config': JsonConverters.toJson(Config,'DispatchRateConfigView',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'DispatchRateConfigView': TypeInfo(TypeOf.Class, create:() => DispatchRateConfigView()),
    'DispatchLaneRateView': TypeInfo(TypeOf.Class, create:() => DispatchLaneRateView()),
    'DispatchZoneRateView': TypeInfo(TypeOf.Class, create:() => DispatchZoneRateView()),
    'DispatchPayPlanView': TypeInfo(TypeOf.Class, create:() => DispatchPayPlanView()),
    'DispatchRatesResponse': TypeInfo(TypeOf.Class, create:() => DispatchRatesResponse()),
    'List<DispatchLaneRateView>': TypeInfo(TypeOf.Class, create:() => <DispatchLaneRateView>[]),
    'List<DispatchZoneRateView>': TypeInfo(TypeOf.Class, create:() => <DispatchZoneRateView>[]),
    'List<DispatchPayPlanView>': TypeInfo(TypeOf.Class, create:() => <DispatchPayPlanView>[]),
    'DispatchRateConfigSaveRequest': TypeInfo(TypeOf.Class, create:() => DispatchRateConfigSaveRequest()),
});

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

PUT /v1/dispatch/rates/config HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Config":{"FuelSurchargePct":0,"TransportPerMile":0,"TransportJobMin":0,"TransportEnclosedUpliftPct":0,"OdBase":0,"OdPerBag":0,"OdPremiumUpliftPct":0,"HaulBasis":"String","Facility":"String","Unit":"String","LoadQty":0}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Config":{"FuelSurchargePct":0,"TransportPerMile":0,"TransportJobMin":0,"TransportEnclosedUpliftPct":0,"OdBase":0,"OdPerBag":0,"OdPremiumUpliftPct":0,"HaulBasis":"String","Facility":"String","Unit":"String","LoadQty":0},"Lanes":[{"DispatchSiteID":0,"DispatchSupplierID":0,"SourceLabel":"String","SupplierName":"String","DispatchLaneRateID":0,"Miles":0,"RatePerTon":0,"RatePerLoad":0,"RatePerTonMile":0,"RatePerHour":0}],"Zones":[{"Zone":"String","DispatchZoneRateID":0,"Base":0,"PerBag":0,"PremiumUpliftPct":0,"Drivers":0}],"Plans":[{"DispatchPayPlanID":0,"Name":"String","Basis":"String","Rate":0,"Rate2":0,"EffectiveDate":"0001-01-01T00:00:00.0000000","IsActive":false,"Drivers":0}],"Repriced":0,"StillNoRevenue":0,"StillNoPay":0,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}