Trendsic Platform Service

<back to all web services

CostCalcRequest

Requires Authentication
The following routes are available for this service:
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(){}
}


Swift CostCalcRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

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

{"Input":{"Base":0,"BillRate":0,"FringeCash":0,"FringePlan":0,"IsNight":false,"HoursPerDay":0,"OnDays":0,"OnDaysExact":0,"HasTravel":false,"PerDiemEligible":false,"PrevailingWage":false,"Jurisdiction":"String","Unit":"String","PriorHours":0,"BurdenClass":"String","WcRateOverride":0},"ContactID":0,"ProjectID":0,"ShiftPatternID":0,"Unit":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Result":{"Rrop":0,"St":0,"Ot":0,"Dt":0,"TotalHours":0,"Straight":0,"DiffPay":0,"OtPremium":0,"DtPremium":0,"CashWages":0,"FringeCashPay":0,"FringePlanPay":0,"BurdenPct":0,"BurdenAmount":0,"PerDiemApplies":false,"PerDiemCost":0,"PerDiemTaxable":0,"PerDiemNonTax":0,"Loaded":0,"Revenue":0,"Margin":0,"MarginPct":0,"OtMultiplier":0,"DtMultiplier":0,"PerDiemDaily":0,"Lines":[{"Label":"String","Detail":"String","Amount":0,"RuleId":"String"}],"Notes":["String"]},"ResolvedInput":{"Base":0,"BillRate":0,"FringeCash":0,"FringePlan":0,"IsNight":false,"HoursPerDay":0,"OnDays":0,"OnDaysExact":0,"HasTravel":false,"PerDiemEligible":false,"PrevailingWage":false,"Jurisdiction":"String","Unit":"String","PriorHours":0,"BurdenClass":"String","WcRateOverride":0},"CanSeePay":false,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}