Billiecart API

<back to all web services

SetEmploymentRequest

Requires Authentication
Requires the role:manager
The following routes are available for this service:
PUT/packages/{id}/employment
import Foundation
import ServiceStack

public class SetEmploymentRequest : PutOperationTenanted<SetEmploymentResponse>
{
    public var id:String?
    public var employerId:String?
    public var payrollCycle:String?
    public var firstPayDate:Date?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case id
        case employerId
        case payrollCycle
        case firstPayDate
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        id = try container.decodeIfPresent(String.self, forKey: .id)
        employerId = try container.decodeIfPresent(String.self, forKey: .employerId)
        payrollCycle = try container.decodeIfPresent(String.self, forKey: .payrollCycle)
        firstPayDate = try container.decodeIfPresent(Date.self, forKey: .firstPayDate)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if id != nil { try container.encode(id, forKey: .id) }
        if employerId != nil { try container.encode(employerId, forKey: .employerId) }
        if payrollCycle != nil { try container.encode(payrollCycle, forKey: .payrollCycle) }
        if firstPayDate != nil { try container.encode(firstPayDate, forKey: .firstPayDate) }
    }
}

public class PutOperationTenanted<TResponse : Codable> : PutOperationUnTenanted<TResponse>, ITenantedRequest
{
    public var organisationId:String?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case organisationId
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        organisationId = try container.decodeIfPresent(String.self, forKey: .organisationId)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if organisationId != nil { try container.encode(organisationId, forKey: .organisationId) }
    }
}

public class PutOperationUnTenanted<TResponse : Codable> : IPut, Codable
{
    required public init(){}
}

public class SetEmploymentResponse : Codable
{
    public var responseStatus:ResponseStatus?
    public var salaryPackage:SalaryPackage?

    required public init(){}
}

public class SalaryPackage : IIdentifiableResource, Codable
{
    public var customerId:String?
    public var customerFirstName:String?
    public var customerLastName:String?
    public var status:String?
    public var notes:String?
    public var budgetBreakdown:BudgetBreakdown?
    public var employment:Employment?
    public var vehicle:Vehicle?
    public var leaseDetails:LeaseDetails?
    public var budgetBalances:BudgetBalances?
    public var currentBalance:Double?
    public var forecastedSalarySacrifices:[ForecastedSalarySacrifice] = []
    public var forecastedOutgoingPayments:[ForecastedOutgoingPayment] = []
    public var adjustments:[Adjustment] = []
    public var transactions:[Transaction] = []
    public var id:String?

    required public init(){}
}

public class BudgetBreakdown : Codable
{
    public var leaseAmount:Double?
    public var administrationFee:Double?
    public var fuel:Double?
    public var servicing:Double?
    public var tyres:Double?
    public var insurance:Double?
    public var carWash:Double?
    public var registration:Double?
    public var roadSideAssistance:Double?
    public var anythingExtra:Double?

    required public init(){}
}

public class Employment : Codable
{
    public var payrollCycle:String?
    public var firstPayDate:Date?
    public var employerId:String?
    public var employerName:String?

    required public init(){}
}

public class Vehicle : Codable
{
    public var make:String?
    public var model:String?
    public var colour:String?
    public var bodyShape:String?
    public var licensePlate:String?
    public var transmission:String?
    public var manufactureYear:Int?

    required public init(){}
}

public class LeaseDetails : Codable
{
    public var term:Int?
    public var startDate:Date?
    public var amountFinanced:Double?
    public var paymentAmount:Double?
    public var financeProvider:String?
    public var residualValue:Double?
    public var yearlyKmsTravelled:Int?
    public var fringeBenefitTaxValue:Double?
    public var fringeBenefitTaxMethod:String?
    public var fringeBenefitTaxBusinessUse:Int?
    public var fringeBenefitTaxStartDate:Date?
    public var preTaxDeduction:Double?
    public var postTaxDeduction:Double?
    public var gstOnPostTaxDeduction:Double?
    public var luxuryVehicleCharge:Double?
    public var onRoadCost:Double?
    public var registrationDueDate:Date?
    public var insuranceDueDate:Date?
    public var leaseProviderBankAccount:BankAccount?

    required public init(){}
}

public class BankAccount : Codable
{
    public var bsbNumber:String?
    public var accountNumber:String?

    required public init(){}
}

public class BudgetBalances : Codable
{
    public var leaseAmount:Double?
    public var administrationFee:Double?
    public var fuel:Double?
    public var servicing:Double?
    public var tyres:Double?
    public var insurance:Double?
    public var carWash:Double?
    public var registration:Double?
    public var roadSideAssistance:Double?
    public var anythingExtra:Double?

    required public init(){}
}

public class ForecastedSalarySacrifice : Codable
{
    public var paymentDate:Date?
    public var amount:Double?
    public var matched:SalarySacrifice?

    required public init(){}
}

public class SalarySacrifice : Codable
{
    public var paymentDate:Date?
    public var salarySacrificeBreakdown:SalarySacrificeBreakdown?
    public var preTaxDeduction:Double?
    public var postTaxDeduction:Double?
    public var contributionId:String?

    required public init(){}
}

public class SalarySacrificeBreakdown : Codable
{
    public var leaseAmount:Double?
    public var administrationFee:Double?
    public var fuel:Double?
    public var servicing:Double?
    public var tyres:Double?
    public var insurance:Double?
    public var carWash:Double?
    public var registration:Double?
    public var roadSideAssistance:Double?
    public var anythingExtra:Double?

    required public init(){}
}

public class ForecastedOutgoingPayment : Codable
{
    public var scheduled:Date?
    public var amount:Double?
    public var budgetCategory:String?
    public var matched:Expense?

    required public init(){}
}

public class Expense : Codable
{
    public var budgetCategory:String?
    public var amount:Double?
    public var gst:Double?

    required public init(){}
}

public class Adjustment : IIdentifiableResource, Codable
{
    public var budgetCategory:String?
    public var amount:Double?
    public var gst:Double?
    public var Description:String?
    public var received:Date?
    public var id:String?

    required public init(){}
}

public class Transaction : Codable
{
    public var received:Date?
    public var budgetCategory:String?
    public var amount:Double?
    public var gst:Double?
    public var Description:String?
    public var type:String?

    required public init(){}
}


Swift SetEmploymentRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /packages/{id}/employment HTTP/1.1 
Host: staging-api.billiecart.com.au 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"id":"String","employerId":"String","payrollCycle":"String","organisationId":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"salaryPackage":{"customerId":"String","customerFirstName":"String","customerLastName":"String","status":"String","notes":"String","budgetBreakdown":{"leaseAmount":0,"administrationFee":0,"fuel":0,"servicing":0,"tyres":0,"insurance":0,"carWash":0,"registration":0,"roadSideAssistance":0,"anythingExtra":0},"employment":{"payrollCycle":"String","employerId":"String","employerName":"String"},"vehicle":{"make":"String","model":"String","colour":"String","bodyShape":"String","licensePlate":"String","transmission":"String","manufactureYear":0},"leaseDetails":{"term":0,"startDate":null,"amountFinanced":0,"paymentAmount":0,"financeProvider":"String","residualValue":0,"yearlyKmsTravelled":0,"fringeBenefitTaxValue":0,"fringeBenefitTaxMethod":"String","fringeBenefitTaxBusinessUse":0,"preTaxDeduction":0,"postTaxDeduction":0,"gstOnPostTaxDeduction":0,"luxuryVehicleCharge":0,"onRoadCost":0,"leaseProviderBankAccount":{"bsbNumber":"String","accountNumber":"String"}},"budgetBalances":{"leaseAmount":0,"administrationFee":0,"fuel":0,"servicing":0,"tyres":0,"insurance":0,"carWash":0,"registration":0,"roadSideAssistance":0,"anythingExtra":0},"currentBalance":0,"forecastedSalarySacrifices":[{"amount":0,"matched":{"salarySacrificeBreakdown":{"leaseAmount":0,"administrationFee":0,"fuel":0,"servicing":0,"tyres":0,"insurance":0,"carWash":0,"registration":0,"roadSideAssistance":0,"anythingExtra":0},"preTaxDeduction":0,"postTaxDeduction":0,"contributionId":"String"}}],"forecastedOutgoingPayments":[{"amount":0,"budgetCategory":"String","matched":{"budgetCategory":"String","amount":0,"gst":0}}],"adjustments":[{"budgetCategory":"String","amount":0,"gst":0,"description":"String","id":"String"}],"transactions":[{"budgetCategory":"String","amount":0,"gst":0,"description":"String","type":"String"}],"id":"String"}}