| POST | /v1/workforce/calc |
|---|
import Foundation
import ServiceStack
public class CostCalcRequest : Codable
{
public var input:CostInput
public var contactID:Int?
public var projectID:Int?
public var shiftPatternID:Int?
public var unit:String
required public init(){}
}
public class CostInput : Codable
{
public var base:Double
public var billRate:Double
public var fringeCash:Double
public var fringePlan:Double
public var isNight:Bool
public var hoursPerDay:Double
public var onDays:Int
public var onDaysExact:Double?
public var hasTravel:Bool
public var perDiemEligible:Bool
public var prevailingWage:Bool
public var jurisdiction:String
public var unit:String
public var priorHours:Double
public var burdenClass:String
public var wcRateOverride:Double?
required public init(){}
}
public class CostCalcResponse : Codable
{
public var result:CostBreakdown
public var resolvedInput:CostInput
public var canSeePay:Bool
public var responseStatus:ResponseStatus
required public init(){}
}
public class CostBreakdown : Codable
{
public var rrop:Double
public var st:Double
public var ot:Double
public var dt:Double
public var totalHours:Double
public var straight:Double
public var diffPay:Double
public var otPremium:Double
public var dtPremium:Double
public var cashWages:Double
public var fringeCashPay:Double
public var fringePlanPay:Double
public var burdenPct:Double
public var burdenAmount:Double
public var perDiemApplies:Bool
public var perDiemCost:Double
public var perDiemTaxable:Double
public var perDiemNonTax:Double
public var loaded:Double
public var revenue:Double
public var margin:Double
public var marginPct:Double
public var otMultiplier:Double
public var dtMultiplier:Double
public var perDiemDaily:Double
public var lines:[CostLine] = []
public var notes:[String] = []
required public init(){}
}
public class CostLine : Codable
{
public var label:String
public var detail:String
public var amount:Double
public var ruleId:String
required public init(){}
}
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>