Skip to content
Permalink
Browse files
Document the payroll API
  • Loading branch information
Izakey committed Apr 23, 2018
1 parent 131263e commit 1316234a8ae9751a3bf2f125fa6ea5f62c138162
Showing 20 changed files with 1,376 additions and 0 deletions.
@@ -26,6 +26,7 @@ buildscript {

dependencies {
classpath ("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.3")
}
}

@@ -36,6 +37,7 @@ plugins {

apply from: '../shared.gradle'

apply plugin: 'org.asciidoctor.convert'
apply plugin: 'spring-boot'

springBoot {
@@ -60,6 +62,24 @@ dependencies {
[group: 'org.apache.fineract.cn', name: 'command', version: versions.frameworkcommand],
[group: 'org.hibernate', name: 'hibernate-validator', version: versions.validator]
)
testCompile(
[group: 'org.apache.fineract.cn.payroll', name: 'api', version: project.version],
[group: 'org.apache.fineract.cn.anubis', name: 'test', version: versions.frameworkanubis],
[group: 'org.apache.fineract.cn', name: 'api', version: versions.frameworkapi],
[group: 'org.apache.fineract.cn', name: 'test', version: versions.frameworktest],
[group: 'org.apache.fineract.cn', name: 'lang', version: versions.frameworklang],
[group: 'org.springframework.boot', name: 'spring-boot-starter-test'],
[group: 'org.springframework.restdocs', name: 'spring-restdocs-mockmvc'],
[group: 'junit', name: 'junit', version: '4.12']
)
}

asciidoctor {
sourceDir 'src/doc/asciidoc/'
outputDir 'src/doc/html5'
options backend: "html", doctype: "book"
attributes "source-highlighter": "highlightjs", \
'snippets': file('src/doc/generated-snippets/')
}

publishToMavenLocal.dependsOn bootRepackage
@@ -0,0 +1,31 @@
== Apache Fineract CN Payroll Management API Documentation ==

== Payroll Configurations ==

==== Configure Payroll Distribution ====

.curl-request
include::{snippets}/test-configurations/should-create-payroll-distribution/curl-request.adoc[]

.http-request
include::{snippets}/test-configurations/should-create-payroll-distribution/http-request.adoc[]

.http-response
include::{snippets}/test-configurations/should-create-payroll-distribution/http-response.adoc[]

.httpie-request
include::{snippets}/test-configurations/should-create-payroll-distribution/httpie-request.adoc[]

==== Update Payroll Distribution ====

.curl-request
include::{snippets}/test-configurations/should-update-payroll-distribution/curl-request.adoc[]

.http-request
include::{snippets}/test-configurations/should-update-payroll-distribution/http-request.adoc[]

.http-response
include::{snippets}/test-configurations/should-update-payroll-distribution/http-response.adoc[]

.httpie-request
include::{snippets}/test-configurations/should-update-payroll-distribution/httpie-request.adoc[]
@@ -0,0 +1,4 @@
[source,bash]
----
$ curl 'http://localhost:8080/payroll/v1/customers/wwiP1hjgY4urDKHZZmE7K7Pbwr5OV9J3/payroll' -i -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d 'wwiP1hjgY4urDKHZZmE7K7Pbwr5OV9J3'
----
@@ -0,0 +1,10 @@
[source,http,options="nowrap"]
----
POST /payroll/v1/customers/wwiP1hjgY4urDKHZZmE7K7Pbwr5OV9J3/payroll HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080
Content-Length: 32
wwiP1hjgY4urDKHZZmE7K7Pbwr5OV9J3
----
@@ -0,0 +1,5 @@
[source,http,options="nowrap"]
----
HTTP/1.1 404 Not Found
----
@@ -0,0 +1,4 @@
[source,bash]
----
$ echo 'wwiP1hjgY4urDKHZZmE7K7Pbwr5OV9J3' | http POST 'http://localhost:8080/payroll/v1/customers/wwiP1hjgY4urDKHZZmE7K7Pbwr5OV9J3/payroll' 'Accept:application/json' 'Content-Type:application/json'
----
@@ -0,0 +1,4 @@
[source,bash]
----
$ curl 'http://localhost:8080/payroll/v1/customers/WhfpMOMifcLw4XIoImryT51O75wTyfVa/payroll/org.apache.fineract.cn.payroll.api.v1.domain.PayrollConfiguration@42c661d4' -i -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json'
----
@@ -0,0 +1,8 @@
[source,http,options="nowrap"]
----
PUT /payroll/v1/customers/WhfpMOMifcLw4XIoImryT51O75wTyfVa/payroll/org.apache.fineract.cn.payroll.api.v1.domain.PayrollConfiguration@42c661d4 HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080
----
@@ -0,0 +1,5 @@
[source,http,options="nowrap"]
----
HTTP/1.1 404 Not Found
----
@@ -0,0 +1,4 @@
[source,bash]
----
$ http PUT 'http://localhost:8080/payroll/v1/customers/WhfpMOMifcLw4XIoImryT51O75wTyfVa/payroll/org.apache.fineract.cn.payroll.api.v1.domain.PayrollConfiguration@42c661d4' 'Accept:application/json' 'Content-Type:application/json'
----

0 comments on commit 1316234

Please sign in to comment.