Requires the role: | manager |
POST | /contributions/{Id}/distribute |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Infrastructure.Api.Interfaces.ServiceOperations.Contributions;
using Infrastructure.Api.Interfaces.ServiceOperations;
using Application.Interfaces.Resources;
namespace Application.Interfaces.Resources
{
public partial class ContributionSalaryPackage
: IIdentifiableResource
{
public virtual decimal? PreTaxDeduction { get; set; }
public virtual decimal? PostTaxDeduction { get; set; }
public virtual SalarySacrificeBreakdown SalarySacrificeBreakdown { get; set; }
public virtual string Id { get; set; }
}
public partial class SalarySacrificeBreakdown
{
public virtual decimal? LeaseAmount { get; set; }
public virtual decimal? AdministrationFee { get; set; }
public virtual decimal? Fuel { get; set; }
public virtual decimal? Servicing { get; set; }
public virtual decimal? Tyres { get; set; }
public virtual decimal? Insurance { get; set; }
public virtual decimal? CarWash { get; set; }
public virtual decimal? Registration { get; set; }
public virtual decimal? RoadSideAssistance { get; set; }
public virtual decimal? AnythingExtra { get; set; }
}
}
namespace Infrastructure.Api.Interfaces.ServiceOperations
{
public partial class PostOperationTenanted<TResponse>
: PostOperationUnTenanted<TResponse>, ITenantedRequest
{
public virtual string OrganisationId { get; set; }
}
public partial class PostOperationUnTenanted<TResponse>
: IPost
{
}
}
namespace Infrastructure.Api.Interfaces.ServiceOperations.Contributions
{
public partial class DistributeContributionRequest
: PostOperationTenanted<DistributeContributionResponse>
{
public DistributeContributionRequest()
{
SalaryPackages = new List<ContributionSalaryPackage>{};
}
public virtual string Id { get; set; }
public virtual List<ContributionSalaryPackage> SalaryPackages { get; set; }
}
public partial class DistributeContributionResponse
{
public virtual ResponseStatus ResponseStatus { get; set; }
}
}
C# DistributeContributionRequest 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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /contributions/{Id}/distribute HTTP/1.1
Host: staging-api.billiecart.com.au
Accept: application/json
Content-Type: application/json
Content-Length: length
{"id":"String","salaryPackages":[{"preTaxDeduction":0,"postTaxDeduction":0,"salarySacrificeBreakdown":{"leaseAmount":0,"administrationFee":0,"fuel":0,"servicing":0,"tyres":0,"insurance":0,"carWash":0,"registration":0,"roadSideAssistance":0,"anythingExtra":0},"id":"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"}}}