| POST | /v1/workforce/calc |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class CostLine implements IConvertible
{
String? Label;
String? Detail;
double? Amount;
String? RuleId;
CostLine({this.Label,this.Detail,this.Amount,this.RuleId});
CostLine.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Label = json['Label'];
Detail = json['Detail'];
Amount = JsonConverters.toDouble(json['Amount']);
RuleId = json['RuleId'];
return this;
}
Map<String, dynamic> toJson() => {
'Label': Label,
'Detail': Detail,
'Amount': Amount,
'RuleId': RuleId
};
getTypeName() => "CostLine";
TypeContext? context = _ctx;
}
class CostBreakdown implements IConvertible
{
double? Rrop;
double? St;
double? Ot;
double? Dt;
double? TotalHours;
double? Straight;
double? DiffPay;
double? OtPremium;
double? DtPremium;
double? CashWages;
double? FringeCashPay;
double? FringePlanPay;
double? BurdenPct;
double? BurdenAmount;
bool? PerDiemApplies;
double? PerDiemCost;
double? PerDiemTaxable;
double? PerDiemNonTax;
double? Loaded;
double? Revenue;
double? Margin;
double? MarginPct;
double? OtMultiplier;
double? DtMultiplier;
double? PerDiemDaily;
List<CostLine>? Lines = [];
List<String>? Notes = [];
CostBreakdown({this.Rrop,this.St,this.Ot,this.Dt,this.TotalHours,this.Straight,this.DiffPay,this.OtPremium,this.DtPremium,this.CashWages,this.FringeCashPay,this.FringePlanPay,this.BurdenPct,this.BurdenAmount,this.PerDiemApplies,this.PerDiemCost,this.PerDiemTaxable,this.PerDiemNonTax,this.Loaded,this.Revenue,this.Margin,this.MarginPct,this.OtMultiplier,this.DtMultiplier,this.PerDiemDaily,this.Lines,this.Notes});
CostBreakdown.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Rrop = JsonConverters.toDouble(json['Rrop']);
St = JsonConverters.toDouble(json['St']);
Ot = JsonConverters.toDouble(json['Ot']);
Dt = JsonConverters.toDouble(json['Dt']);
TotalHours = JsonConverters.toDouble(json['TotalHours']);
Straight = JsonConverters.toDouble(json['Straight']);
DiffPay = JsonConverters.toDouble(json['DiffPay']);
OtPremium = JsonConverters.toDouble(json['OtPremium']);
DtPremium = JsonConverters.toDouble(json['DtPremium']);
CashWages = JsonConverters.toDouble(json['CashWages']);
FringeCashPay = JsonConverters.toDouble(json['FringeCashPay']);
FringePlanPay = JsonConverters.toDouble(json['FringePlanPay']);
BurdenPct = JsonConverters.toDouble(json['BurdenPct']);
BurdenAmount = JsonConverters.toDouble(json['BurdenAmount']);
PerDiemApplies = json['PerDiemApplies'];
PerDiemCost = JsonConverters.toDouble(json['PerDiemCost']);
PerDiemTaxable = JsonConverters.toDouble(json['PerDiemTaxable']);
PerDiemNonTax = JsonConverters.toDouble(json['PerDiemNonTax']);
Loaded = JsonConverters.toDouble(json['Loaded']);
Revenue = JsonConverters.toDouble(json['Revenue']);
Margin = JsonConverters.toDouble(json['Margin']);
MarginPct = JsonConverters.toDouble(json['MarginPct']);
OtMultiplier = JsonConverters.toDouble(json['OtMultiplier']);
DtMultiplier = JsonConverters.toDouble(json['DtMultiplier']);
PerDiemDaily = JsonConverters.toDouble(json['PerDiemDaily']);
Lines = JsonConverters.fromJson(json['Lines'],'List<CostLine>',context!);
Notes = JsonConverters.fromJson(json['Notes'],'List<String>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Rrop': Rrop,
'St': St,
'Ot': Ot,
'Dt': Dt,
'TotalHours': TotalHours,
'Straight': Straight,
'DiffPay': DiffPay,
'OtPremium': OtPremium,
'DtPremium': DtPremium,
'CashWages': CashWages,
'FringeCashPay': FringeCashPay,
'FringePlanPay': FringePlanPay,
'BurdenPct': BurdenPct,
'BurdenAmount': BurdenAmount,
'PerDiemApplies': PerDiemApplies,
'PerDiemCost': PerDiemCost,
'PerDiemTaxable': PerDiemTaxable,
'PerDiemNonTax': PerDiemNonTax,
'Loaded': Loaded,
'Revenue': Revenue,
'Margin': Margin,
'MarginPct': MarginPct,
'OtMultiplier': OtMultiplier,
'DtMultiplier': DtMultiplier,
'PerDiemDaily': PerDiemDaily,
'Lines': JsonConverters.toJson(Lines,'List<CostLine>',context!),
'Notes': JsonConverters.toJson(Notes,'List<String>',context!)
};
getTypeName() => "CostBreakdown";
TypeContext? context = _ctx;
}
class CostInput implements IConvertible
{
double? Base;
double? BillRate;
double? FringeCash;
double? FringePlan;
bool? IsNight;
double? HoursPerDay;
int? OnDays;
double? OnDaysExact;
bool? HasTravel;
bool? PerDiemEligible;
bool? PrevailingWage;
String? Jurisdiction;
String? Unit;
double? PriorHours;
String? BurdenClass;
double? WcRateOverride;
CostInput({this.Base,this.BillRate,this.FringeCash,this.FringePlan,this.IsNight,this.HoursPerDay,this.OnDays,this.OnDaysExact,this.HasTravel,this.PerDiemEligible,this.PrevailingWage,this.Jurisdiction,this.Unit,this.PriorHours,this.BurdenClass,this.WcRateOverride});
CostInput.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Base = JsonConverters.toDouble(json['Base']);
BillRate = JsonConverters.toDouble(json['BillRate']);
FringeCash = JsonConverters.toDouble(json['FringeCash']);
FringePlan = JsonConverters.toDouble(json['FringePlan']);
IsNight = json['IsNight'];
HoursPerDay = JsonConverters.toDouble(json['HoursPerDay']);
OnDays = json['OnDays'];
OnDaysExact = JsonConverters.toDouble(json['OnDaysExact']);
HasTravel = json['HasTravel'];
PerDiemEligible = json['PerDiemEligible'];
PrevailingWage = json['PrevailingWage'];
Jurisdiction = json['Jurisdiction'];
Unit = json['Unit'];
PriorHours = JsonConverters.toDouble(json['PriorHours']);
BurdenClass = json['BurdenClass'];
WcRateOverride = JsonConverters.toDouble(json['WcRateOverride']);
return this;
}
Map<String, dynamic> toJson() => {
'Base': Base,
'BillRate': BillRate,
'FringeCash': FringeCash,
'FringePlan': FringePlan,
'IsNight': IsNight,
'HoursPerDay': HoursPerDay,
'OnDays': OnDays,
'OnDaysExact': OnDaysExact,
'HasTravel': HasTravel,
'PerDiemEligible': PerDiemEligible,
'PrevailingWage': PrevailingWage,
'Jurisdiction': Jurisdiction,
'Unit': Unit,
'PriorHours': PriorHours,
'BurdenClass': BurdenClass,
'WcRateOverride': WcRateOverride
};
getTypeName() => "CostInput";
TypeContext? context = _ctx;
}
class CostCalcResponse implements IConvertible
{
CostBreakdown? Result;
CostInput? ResolvedInput;
bool? CanSeePay;
ResponseStatus? ResponseStatus;
CostCalcResponse({this.Result,this.ResolvedInput,this.CanSeePay,this.ResponseStatus});
CostCalcResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Result = JsonConverters.fromJson(json['Result'],'CostBreakdown',context!);
ResolvedInput = JsonConverters.fromJson(json['ResolvedInput'],'CostInput',context!);
CanSeePay = json['CanSeePay'];
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Result': JsonConverters.toJson(Result,'CostBreakdown',context!),
'ResolvedInput': JsonConverters.toJson(ResolvedInput,'CostInput',context!),
'CanSeePay': CanSeePay,
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "CostCalcResponse";
TypeContext? context = _ctx;
}
class CostCalcRequest implements IConvertible
{
CostInput? Input;
int? ContactID;
int? ProjectID;
int? ShiftPatternID;
String? Unit;
CostCalcRequest({this.Input,this.ContactID,this.ProjectID,this.ShiftPatternID,this.Unit});
CostCalcRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Input = JsonConverters.fromJson(json['Input'],'CostInput',context!);
ContactID = json['ContactID'];
ProjectID = json['ProjectID'];
ShiftPatternID = json['ShiftPatternID'];
Unit = json['Unit'];
return this;
}
Map<String, dynamic> toJson() => {
'Input': JsonConverters.toJson(Input,'CostInput',context!),
'ContactID': ContactID,
'ProjectID': ProjectID,
'ShiftPatternID': ShiftPatternID,
'Unit': Unit
};
getTypeName() => "CostCalcRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'CostLine': TypeInfo(TypeOf.Class, create:() => CostLine()),
'CostBreakdown': TypeInfo(TypeOf.Class, create:() => CostBreakdown()),
'List<CostLine>': TypeInfo(TypeOf.Class, create:() => <CostLine>[]),
'CostInput': TypeInfo(TypeOf.Class, create:() => CostInput()),
'CostCalcResponse': TypeInfo(TypeOf.Class, create:() => CostCalcResponse()),
'CostCalcRequest': TypeInfo(TypeOf.Class, create:() => CostCalcRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/workforce/calc HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CostCalcRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<ContactID>0</ContactID>
<Input>
<Base>0</Base>
<BillRate>0</BillRate>
<BurdenClass>String</BurdenClass>
<FringeCash>0</FringeCash>
<FringePlan>0</FringePlan>
<HasTravel>false</HasTravel>
<HoursPerDay>0</HoursPerDay>
<IsNight>false</IsNight>
<Jurisdiction>String</Jurisdiction>
<OnDays>0</OnDays>
<OnDaysExact>0</OnDaysExact>
<PerDiemEligible>false</PerDiemEligible>
<PrevailingWage>false</PrevailingWage>
<PriorHours>0</PriorHours>
<Unit>String</Unit>
<WcRateOverride>0</WcRateOverride>
</Input>
<ProjectID>0</ProjectID>
<ShiftPatternID>0</ShiftPatternID>
<Unit>String</Unit>
</CostCalcRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CostCalcResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<CanSeePay>false</CanSeePay>
<ResolvedInput>
<Base>0</Base>
<BillRate>0</BillRate>
<BurdenClass>String</BurdenClass>
<FringeCash>0</FringeCash>
<FringePlan>0</FringePlan>
<HasTravel>false</HasTravel>
<HoursPerDay>0</HoursPerDay>
<IsNight>false</IsNight>
<Jurisdiction>String</Jurisdiction>
<OnDays>0</OnDays>
<OnDaysExact>0</OnDaysExact>
<PerDiemEligible>false</PerDiemEligible>
<PrevailingWage>false</PrevailingWage>
<PriorHours>0</PriorHours>
<Unit>String</Unit>
<WcRateOverride>0</WcRateOverride>
</ResolvedInput>
<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>
<Result>
<BurdenAmount>0</BurdenAmount>
<BurdenPct>0</BurdenPct>
<CashWages>0</CashWages>
<DiffPay>0</DiffPay>
<Dt>0</Dt>
<DtMultiplier>0</DtMultiplier>
<DtPremium>0</DtPremium>
<FringeCashPay>0</FringeCashPay>
<FringePlanPay>0</FringePlanPay>
<Lines>
<CostLine>
<Amount>0</Amount>
<Detail>String</Detail>
<Label>String</Label>
<RuleId>String</RuleId>
</CostLine>
</Lines>
<Loaded>0</Loaded>
<Margin>0</Margin>
<MarginPct>0</MarginPct>
<Notes xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</Notes>
<Ot>0</Ot>
<OtMultiplier>0</OtMultiplier>
<OtPremium>0</OtPremium>
<PerDiemApplies>false</PerDiemApplies>
<PerDiemCost>0</PerDiemCost>
<PerDiemDaily>0</PerDiemDaily>
<PerDiemNonTax>0</PerDiemNonTax>
<PerDiemTaxable>0</PerDiemTaxable>
<Revenue>0</Revenue>
<Rrop>0</Rrop>
<St>0</St>
<Straight>0</Straight>
<TotalHours>0</TotalHours>
</Result>
</CostCalcResponse>