Payroll Configurations
Prepare A Payroll Configuration
$ curl 'http://localhost:8080/customers/customerOne/payroll' -i -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{
"mainAccountNumber" : "12345678910",
"payrollAllocations" : [ {
"accountNumber" : "9876543210",
"amount" : 5500.0,
"proportional" : true
}, {
"accountNumber" : "24681097531",
"amount" : 43.0,
"proportional" : true
} ]
}'
PUT /customers/customerOne/payroll HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080
Content-Length: 253
{
"mainAccountNumber" : "12345678910",
"payrollAllocations" : [ {
"accountNumber" : "9876543210",
"amount" : 5500.0,
"proportional" : true
}, {
"accountNumber" : "24681097531",
"amount" : 43.0,
"proportional" : true
} ]
}
$ echo '{
"mainAccountNumber" : "12345678910",
"payrollAllocations" : [ {
"accountNumber" : "9876543210",
"amount" : 5500.0,
"proportional" : true
}, {
"accountNumber" : "24681097531",
"amount" : 43.0,
"proportional" : true
} ]
}' | http PUT 'http://localhost:8080/customers/customerOne/payroll' 'Accept:application/json' 'Content-Type:application/json'
Path | Type | Description |
---|---|---|
|
|
Main account number |
|
|
Account from where you pay first allocation |
|
|
Amount to be paid during first allocation |
|
|
Should payments be proportional ? |
|
|
Account from where you pay second allocation |
|
|
Amount to be paid during first allocation |
|
|
Should payments be proportional ? |
HTTP/1.1 202 Accepted
Find A Payroll Configuration
$ curl 'http://localhost:8080/customers/faundCostoma/payroll' -i -H 'Accept: application/json' -H 'Content-Type: application/json'
GET /customers/faundCostoma/payroll HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080
$ http GET 'http://localhost:8080/customers/faundCostoma/payroll' 'Accept:application/json' 'Content-Type:application/json'
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 364
{
"mainAccountNumber" : "AB12345",
"payrollAllocations" : [ {
"accountNumber" : "BAH97531",
"amount" : 73.0,
"proportional" : true
}, {
"accountNumber" : "CAG24680",
"amount" : 21.0,
"proportional" : true
} ],
"createdBy" : "mage",
"createdOn" : "2018-06-19T06:22:54.261Z",
"lastModifiedBy" : null,
"lastModifiedOn" : null
}
Path | Type | Description |
---|---|---|
|
|
Main account number |
|
|
Account from where you pay first allocation |
|
|
Amount to be paid during first allocation |
|
|
Should payments be proportional ? |
|
|
Account from where you pay second allocation |
|
|
Amount to be paid during first allocation |
|
|
Should payments be proportional ? |
|
|
Employee who configured payroll |
|
|
Date when payroll was configured |
|
|
Employee who last modified payroll |
|
|
Date when payroll was last modified |
Distribute Payments
$ curl 'http://localhost:8080/distribution' -i -X POST -H 'Content-Type: application/json' -d '{
"sourceAccountNumber" : "S1R2C3A4C5C6",
"payrollPayments" : [ {
"customerIdentifier" : "flauna",
"employer" : "The Shop",
"salary" : 1234.56
}, {
"customerIdentifier" : "flauna",
"employer" : "The Tank",
"salary" : 14.54
} ]
}'
POST /distribution HTTP/1.1
Content-Type: application/json
Host: localhost:8080
Content-Length: 260
{
"sourceAccountNumber" : "S1R2C3A4C5C6",
"payrollPayments" : [ {
"customerIdentifier" : "flauna",
"employer" : "The Shop",
"salary" : 1234.56
}, {
"customerIdentifier" : "flauna",
"employer" : "The Tank",
"salary" : 14.54
} ]
}
$ echo '{
"sourceAccountNumber" : "S1R2C3A4C5C6",
"payrollPayments" : [ {
"customerIdentifier" : "flauna",
"employer" : "The Shop",
"salary" : 1234.56
}, {
"customerIdentifier" : "flauna",
"employer" : "The Tank",
"salary" : 14.54
} ]
}' | http POST 'http://localhost:8080/distribution' 'Content-Type:application/json'
Path | Type | Description |
---|---|---|
|
|
Account from which payments ensue |
|
|
first customer’s identifier |
|
|
first customer’s employer |
|
|
first customer’s salary |
|
|
second customer’s identifier |
|
|
second customer’s employer |
|
|
second customer’s salary |
HTTP/1.1 202 Accepted
Fetch Distribution History
$ curl 'http://localhost:8080/distribution' -i -H 'Accept: */*' -H 'Content-Type: application/json'
GET /distribution HTTP/1.1
Accept: */*
Content-Type: application/json
Host: localhost:8080
$ http GET 'http://localhost:8080/distribution' 'Accept:*/*' 'Content-Type:application/json'
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 168
[ {
"identifier" : "rBX30gbtvLrORr2ipUsDNKiUsRgqB4FC",
"sourceAccountNumber" : "S9R7C5A3C1C",
"createdBy" : "mage",
"createdOn" : "2018-06-19T06:24:38.616Z"
} ]
Path | Type | Description |
---|---|---|
|
|
Payroll history identifier |
|
|
Account from which payments ensue |
|
|
Employee who distributed payroll |
|
|
Date when payroll was distributed |
Fetch Payments
$ curl 'http://localhost:8080/distribution/9tBCjquueC5iXblOS5Upy34MyOg6zy7d/payments' -i -H 'Accept: */*' -H 'Content-Type: application/json'
GET /distribution/9tBCjquueC5iXblOS5Upy34MyOg6zy7d/payments HTTP/1.1
Accept: */*
Content-Type: application/json
Host: localhost:8080
$ http GET 'http://localhost:8080/distribution/9tBCjquueC5iXblOS5Upy34MyOg6zy7d/payments' 'Accept:*/*' 'Content-Type:application/json'
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 208
{
"payrollPayments" : [ {
"customerIdentifier" : "ngone",
"employer" : "Nkwane",
"salary" : 945.0,
"processed" : true,
"message" : null
} ],
"totalPages" : 1,
"totalElements" : 1
}
Path | Type | Description |
---|---|---|
|
|
second customer’s identifier |
|
|
second customer’s employer |
|
|
second customer’s salary |
|
|
second customer’s employer |
|
|
second customer’s salary |
|
|
Pages of payroll payments |
|
|
Number of payroll payments |