Requires the role: | manager |
PUT | /packages/{Id}/lease-details |
---|
import Foundation
import ServiceStack
public class SetLeaseDetailsRequest : PutOperationTenanted<SetLeaseDetailsResponse>
{
public var id:String?
public var term:Int?
public var startDate:Date?
public var amountFinanced:Double?
public var financeProvider:String?
public var paymentAmount:Double?
public var residualValue:Double?
public var yearlyKmsTravelled:Int?
public var onRoadCost:Double?
public var fringeBenefitTaxValue:Double?
public var fringeBenefitTaxMethod:String?
public var fringeBenefitBusinessUse:Int?
public var fringeBenefitStartDate:Date?
public var preTaxDeduction:Double?
public var postTaxDeduction:Double?
public var gstOnPostTaxDeduction:Double?
public var luxuryVehicleCharge:Double?
public var registrationDueDate:Date?
public var insuranceDueDate:Date?
public var leaseProviderBankAccountNumber:String?
public var leaseProviderBankAccountBsbNumber:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case term
case startDate
case amountFinanced
case financeProvider
case paymentAmount
case residualValue
case yearlyKmsTravelled
case onRoadCost
case fringeBenefitTaxValue
case fringeBenefitTaxMethod
case fringeBenefitBusinessUse
case fringeBenefitStartDate
case preTaxDeduction
case postTaxDeduction
case gstOnPostTaxDeduction
case luxuryVehicleCharge
case registrationDueDate
case insuranceDueDate
case leaseProviderBankAccountNumber
case leaseProviderBankAccountBsbNumber
}
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)
term = try container.decodeIfPresent(Int.self, forKey: .term)
startDate = try container.decodeIfPresent(Date.self, forKey: .startDate)
amountFinanced = try container.decodeIfPresent(Double.self, forKey: .amountFinanced)
financeProvider = try container.decodeIfPresent(String.self, forKey: .financeProvider)
paymentAmount = try container.decodeIfPresent(Double.self, forKey: .paymentAmount)
residualValue = try container.decodeIfPresent(Double.self, forKey: .residualValue)
yearlyKmsTravelled = try container.decodeIfPresent(Int.self, forKey: .yearlyKmsTravelled)
onRoadCost = try container.decodeIfPresent(Double.self, forKey: .onRoadCost)
fringeBenefitTaxValue = try container.decodeIfPresent(Double.self, forKey: .fringeBenefitTaxValue)
fringeBenefitTaxMethod = try container.decodeIfPresent(String.self, forKey: .fringeBenefitTaxMethod)
fringeBenefitBusinessUse = try container.decodeIfPresent(Int.self, forKey: .fringeBenefitBusinessUse)
fringeBenefitStartDate = try container.decodeIfPresent(Date.self, forKey: .fringeBenefitStartDate)
preTaxDeduction = try container.decodeIfPresent(Double.self, forKey: .preTaxDeduction)
postTaxDeduction = try container.decodeIfPresent(Double.self, forKey: .postTaxDeduction)
gstOnPostTaxDeduction = try container.decodeIfPresent(Double.self, forKey: .gstOnPostTaxDeduction)
luxuryVehicleCharge = try container.decodeIfPresent(Double.self, forKey: .luxuryVehicleCharge)
registrationDueDate = try container.decodeIfPresent(Date.self, forKey: .registrationDueDate)
insuranceDueDate = try container.decodeIfPresent(Date.self, forKey: .insuranceDueDate)
leaseProviderBankAccountNumber = try container.decodeIfPresent(String.self, forKey: .leaseProviderBankAccountNumber)
leaseProviderBankAccountBsbNumber = try container.decodeIfPresent(String.self, forKey: .leaseProviderBankAccountBsbNumber)
}
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 term != nil { try container.encode(term, forKey: .term) }
if startDate != nil { try container.encode(startDate, forKey: .startDate) }
if amountFinanced != nil { try container.encode(amountFinanced, forKey: .amountFinanced) }
if financeProvider != nil { try container.encode(financeProvider, forKey: .financeProvider) }
if paymentAmount != nil { try container.encode(paymentAmount, forKey: .paymentAmount) }
if residualValue != nil { try container.encode(residualValue, forKey: .residualValue) }
if yearlyKmsTravelled != nil { try container.encode(yearlyKmsTravelled, forKey: .yearlyKmsTravelled) }
if onRoadCost != nil { try container.encode(onRoadCost, forKey: .onRoadCost) }
if fringeBenefitTaxValue != nil { try container.encode(fringeBenefitTaxValue, forKey: .fringeBenefitTaxValue) }
if fringeBenefitTaxMethod != nil { try container.encode(fringeBenefitTaxMethod, forKey: .fringeBenefitTaxMethod) }
if fringeBenefitBusinessUse != nil { try container.encode(fringeBenefitBusinessUse, forKey: .fringeBenefitBusinessUse) }
if fringeBenefitStartDate != nil { try container.encode(fringeBenefitStartDate, forKey: .fringeBenefitStartDate) }
if preTaxDeduction != nil { try container.encode(preTaxDeduction, forKey: .preTaxDeduction) }
if postTaxDeduction != nil { try container.encode(postTaxDeduction, forKey: .postTaxDeduction) }
if gstOnPostTaxDeduction != nil { try container.encode(gstOnPostTaxDeduction, forKey: .gstOnPostTaxDeduction) }
if luxuryVehicleCharge != nil { try container.encode(luxuryVehicleCharge, forKey: .luxuryVehicleCharge) }
if registrationDueDate != nil { try container.encode(registrationDueDate, forKey: .registrationDueDate) }
if insuranceDueDate != nil { try container.encode(insuranceDueDate, forKey: .insuranceDueDate) }
if leaseProviderBankAccountNumber != nil { try container.encode(leaseProviderBankAccountNumber, forKey: .leaseProviderBankAccountNumber) }
if leaseProviderBankAccountBsbNumber != nil { try container.encode(leaseProviderBankAccountBsbNumber, forKey: .leaseProviderBankAccountBsbNumber) }
}
}
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 SetLeaseDetailsResponse : 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 SetLeaseDetailsRequest DTOs
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.
PUT /packages/{Id}/lease-details HTTP/1.1
Host: staging-api.billiecart.com.au
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SetLeaseDetailsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Infrastructure.Api.Interfaces.ServiceOperations.SalaryPackages">
<OrganisationId xmlns="http://schemas.datacontract.org/2004/07/Infrastructure.Api.Interfaces.ServiceOperations">String</OrganisationId>
<AmountFinanced>0</AmountFinanced>
<FinanceProvider>String</FinanceProvider>
<FringeBenefitBusinessUse>0</FringeBenefitBusinessUse>
<FringeBenefitStartDate>0001-01-01T00:00:00</FringeBenefitStartDate>
<FringeBenefitTaxMethod>String</FringeBenefitTaxMethod>
<FringeBenefitTaxValue>0</FringeBenefitTaxValue>
<GstOnPostTaxDeduction>0</GstOnPostTaxDeduction>
<Id>String</Id>
<InsuranceDueDate>0001-01-01T00:00:00</InsuranceDueDate>
<LeaseProviderBankAccountBsbNumber>String</LeaseProviderBankAccountBsbNumber>
<LeaseProviderBankAccountNumber>String</LeaseProviderBankAccountNumber>
<LuxuryVehicleCharge>0</LuxuryVehicleCharge>
<OnRoadCost>0</OnRoadCost>
<PaymentAmount>0</PaymentAmount>
<PostTaxDeduction>0</PostTaxDeduction>
<PreTaxDeduction>0</PreTaxDeduction>
<RegistrationDueDate>0001-01-01T00:00:00</RegistrationDueDate>
<ResidualValue>0</ResidualValue>
<StartDate>0001-01-01T00:00:00</StartDate>
<Term>0</Term>
<YearlyKmsTravelled>0</YearlyKmsTravelled>
</SetLeaseDetailsRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <SetLeaseDetailsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Infrastructure.Api.Interfaces.ServiceOperations.SalaryPackages"> <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> <SalaryPackage xmlns:d2p1="http://schemas.datacontract.org/2004/07/Application.Interfaces.Resources"> <d2p1:Adjustments> <d2p1:Adjustment> <d2p1:Amount>0</d2p1:Amount> <d2p1:BudgetCategory>String</d2p1:BudgetCategory> <d2p1:Description>String</d2p1:Description> <d2p1:Gst>0</d2p1:Gst> <d2p1:Id>String</d2p1:Id> <d2p1:Received>0001-01-01T00:00:00</d2p1:Received> </d2p1:Adjustment> </d2p1:Adjustments> <d2p1:BudgetBalances> <d2p1:AdministrationFee>0</d2p1:AdministrationFee> <d2p1:AnythingExtra>0</d2p1:AnythingExtra> <d2p1:CarWash>0</d2p1:CarWash> <d2p1:Fuel>0</d2p1:Fuel> <d2p1:Insurance>0</d2p1:Insurance> <d2p1:LeaseAmount>0</d2p1:LeaseAmount> <d2p1:Registration>0</d2p1:Registration> <d2p1:RoadSideAssistance>0</d2p1:RoadSideAssistance> <d2p1:Servicing>0</d2p1:Servicing> <d2p1:Tyres>0</d2p1:Tyres> </d2p1:BudgetBalances> <d2p1:BudgetBreakdown> <d2p1:AdministrationFee>0</d2p1:AdministrationFee> <d2p1:AnythingExtra>0</d2p1:AnythingExtra> <d2p1:CarWash>0</d2p1:CarWash> <d2p1:Fuel>0</d2p1:Fuel> <d2p1:Insurance>0</d2p1:Insurance> <d2p1:LeaseAmount>0</d2p1:LeaseAmount> <d2p1:Registration>0</d2p1:Registration> <d2p1:RoadSideAssistance>0</d2p1:RoadSideAssistance> <d2p1:Servicing>0</d2p1:Servicing> <d2p1:Tyres>0</d2p1:Tyres> </d2p1:BudgetBreakdown> <d2p1:CurrentBalance>0</d2p1:CurrentBalance> <d2p1:CustomerFirstName>String</d2p1:CustomerFirstName> <d2p1:CustomerId>String</d2p1:CustomerId> <d2p1:CustomerLastName>String</d2p1:CustomerLastName> <d2p1:Employment> <d2p1:EmployerId>String</d2p1:EmployerId> <d2p1:EmployerName>String</d2p1:EmployerName> <d2p1:FirstPayDate>0001-01-01T00:00:00</d2p1:FirstPayDate> <d2p1:PayrollCycle>String</d2p1:PayrollCycle> </d2p1:Employment> <d2p1:ForecastedOutgoingPayments> <d2p1:ForecastedOutgoingPayment> <d2p1:Amount>0</d2p1:Amount> <d2p1:BudgetCategory>String</d2p1:BudgetCategory> <d2p1:Matched> <d2p1:Amount>0</d2p1:Amount> <d2p1:BudgetCategory>String</d2p1:BudgetCategory> <d2p1:Gst>0</d2p1:Gst> </d2p1:Matched> <d2p1:Scheduled>0001-01-01T00:00:00</d2p1:Scheduled> </d2p1:ForecastedOutgoingPayment> </d2p1:ForecastedOutgoingPayments> <d2p1:ForecastedSalarySacrifices> <d2p1:ForecastedSalarySacrifice> <d2p1:Amount>0</d2p1:Amount> <d2p1:Matched> <d2p1:ContributionId>String</d2p1:ContributionId> <d2p1:PaymentDate>0001-01-01T00:00:00</d2p1:PaymentDate> <d2p1:PostTaxDeduction>0</d2p1:PostTaxDeduction> <d2p1:PreTaxDeduction>0</d2p1:PreTaxDeduction> <d2p1:SalarySacrificeBreakdown> <d2p1:AdministrationFee>0</d2p1:AdministrationFee> <d2p1:AnythingExtra>0</d2p1:AnythingExtra> <d2p1:CarWash>0</d2p1:CarWash> <d2p1:Fuel>0</d2p1:Fuel> <d2p1:Insurance>0</d2p1:Insurance> <d2p1:LeaseAmount>0</d2p1:LeaseAmount> <d2p1:Registration>0</d2p1:Registration> <d2p1:RoadSideAssistance>0</d2p1:RoadSideAssistance> <d2p1:Servicing>0</d2p1:Servicing> <d2p1:Tyres>0</d2p1:Tyres> </d2p1:SalarySacrificeBreakdown> </d2p1:Matched> <d2p1:PaymentDate>0001-01-01T00:00:00</d2p1:PaymentDate> </d2p1:ForecastedSalarySacrifice> </d2p1:ForecastedSalarySacrifices> <d2p1:Id>String</d2p1:Id> <d2p1:LeaseDetails> <d2p1:AmountFinanced>0</d2p1:AmountFinanced> <d2p1:FinanceProvider>String</d2p1:FinanceProvider> <d2p1:FringeBenefitTaxBusinessUse>0</d2p1:FringeBenefitTaxBusinessUse> <d2p1:FringeBenefitTaxMethod>String</d2p1:FringeBenefitTaxMethod> <d2p1:FringeBenefitTaxStartDate>0001-01-01T00:00:00</d2p1:FringeBenefitTaxStartDate> <d2p1:FringeBenefitTaxValue>0</d2p1:FringeBenefitTaxValue> <d2p1:GstOnPostTaxDeduction>0</d2p1:GstOnPostTaxDeduction> <d2p1:InsuranceDueDate>0001-01-01T00:00:00</d2p1:InsuranceDueDate> <d2p1:LeaseProviderBankAccount> <d2p1:AccountNumber>String</d2p1:AccountNumber> <d2p1:BsbNumber>String</d2p1:BsbNumber> </d2p1:LeaseProviderBankAccount> <d2p1:LuxuryVehicleCharge>0</d2p1:LuxuryVehicleCharge> <d2p1:OnRoadCost>0</d2p1:OnRoadCost> <d2p1:PaymentAmount>0</d2p1:PaymentAmount> <d2p1:PostTaxDeduction>0</d2p1:PostTaxDeduction> <d2p1:PreTaxDeduction>0</d2p1:PreTaxDeduction> <d2p1:RegistrationDueDate>0001-01-01T00:00:00</d2p1:RegistrationDueDate> <d2p1:ResidualValue>0</d2p1:ResidualValue> <d2p1:StartDate>0001-01-01T00:00:00</d2p1:StartDate> <d2p1:Term>0</d2p1:Term> <d2p1:YearlyKmsTravelled>0</d2p1:YearlyKmsTravelled> </d2p1:LeaseDetails> <d2p1:Notes>String</d2p1:Notes> <d2p1:Status>String</d2p1:Status> <d2p1:Transactions> <d2p1:Transaction> <d2p1:Amount>0</d2p1:Amount> <d2p1:BudgetCategory>String</d2p1:BudgetCategory> <d2p1:Description>String</d2p1:Description> <d2p1:Gst>0</d2p1:Gst> <d2p1:Received>0001-01-01T00:00:00</d2p1:Received> <d2p1:Type>String</d2p1:Type> </d2p1:Transaction> </d2p1:Transactions> <d2p1:Vehicle> <d2p1:BodyShape>String</d2p1:BodyShape> <d2p1:Colour>String</d2p1:Colour> <d2p1:LicensePlate>String</d2p1:LicensePlate> <d2p1:Make>String</d2p1:Make> <d2p1:ManufactureYear>0</d2p1:ManufactureYear> <d2p1:Model>String</d2p1:Model> <d2p1:Transmission>String</d2p1:Transmission> </d2p1:Vehicle> </SalaryPackage> </SetLeaseDetailsResponse>