Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from Izakey/develop
Browse files Browse the repository at this point in the history
Document the Office API
  • Loading branch information
Izakey committed Apr 23, 2018
2 parents ce10118 + d965c1e commit 67053a9
Show file tree
Hide file tree
Showing 67 changed files with 2,744 additions and 0 deletions.
19 changes: 19 additions & 0 deletions service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ buildscript {

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

Expand All @@ -37,6 +38,7 @@ plugins {
apply from: '../shared.gradle'

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

springBoot {
executable = true
Expand All @@ -58,6 +60,23 @@ dependencies {
[group: 'org.apache.fineract.cn', name: 'mariadb', version: versions.frameworkmariadb],
[group: 'org.apache.fineract.cn', name: 'command', version: versions.frameworkcommand],
)
testCompile(
[group: 'org.apache.fineract.cn.office', name: 'api', version: project.version],
[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.anubis', name: 'test', version: versions.frameworkanubis],
[group: 'org.springframework.restdocs', name: 'spring-restdocs-mockmvc'],
[group: 'org.springframework.boot', name: 'spring-boot-starter-test'],
[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
Expand Down
201 changes: 201 additions & 0 deletions service/src/doc/asciidoc/api-docs.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
== Apache Fineract CN Office Management API Documentation ==

== Offices ==

==== Create An Office ====

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

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

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

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

==== Get An Office ====

.curl-request
include::{snippets}/test-office/should-indicate-office-has-external-references/curl-request.adoc[]

.http-request
include::{snippets}/test-office/should-indicate-office-has-external-references/http-request.adoc[]

.http-response
include::{snippets}/test-office/should-indicate-office-has-external-references/http-response.adoc[]

.httpie-request
include::{snippets}/test-office/should-indicate-office-has-external-references/httpie-request.adoc[]

==== Get An Office's Address ====

.curl-request
include::{snippets}/test-office/should-get-address-of-office/curl-request.adoc[]

.http-request
include::{snippets}/test-office/should-get-address-of-office/http-request.adoc[]

.http-response
include::{snippets}/test-office/should-get-address-of-office/http-response.adoc[]

.httpie-request
include::{snippets}/test-office/should-get-address-of-office/httpie-request.adoc[]

==== Update An Office's Address ====

.curl-request
include::{snippets}/test-office/should-set-address-of-office/curl-request.adoc[]

.http-request
include::{snippets}/test-office/should-set-address-of-office/http-request.adoc[]

.http-response
include::{snippets}/test-office/should-set-address-of-office/http-response.adoc[]

.httpie-request
include::{snippets}/test-office/should-set-address-of-office/httpie-request.adoc[]

==== Update An Office ====

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

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

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

.httpie-request
include::{snippets}/test-office/should-update-office/httpie-request.adoc[]

==== Delete An Office's Address ====

.curl-request
include::{snippets}/test-office/should-delete-address-of-office/curl-request.adoc[]

.http-request
include::{snippets}/test-office/should-delete-address-of-office/http-request.adoc[]

.http-response
include::{snippets}/test-office/should-delete-address-of-office/http-response.adoc[]

.httpie-request
include::{snippets}/test-office/should-delete-address-of-office/httpie-request.adoc[]

==== Add A Branch To An Office ====

.curl-request
include::{snippets}/test-office/should-add-branch/curl-request.adoc[]

.http-request
include::{snippets}/test-office/should-add-branch/http-request.adoc[]

.http-response
include::{snippets}/test-office/should-add-branch/http-response.adoc[]

.httpie-request
include::{snippets}/test-office/should-add-branch/httpie-request.adoc[]

== Employees ==

==== Create An Employee ====

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

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

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

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

==== Update An Employee ====

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

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

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

.httpie-request
include::{snippets}/test-employee/should-update-employee/httpie-request.adoc[]

==== Get Employees ====

.curl-request
include::{snippets}/test-employee/should-find-all-employees/curl-request.adoc[]

.http-request
include::{snippets}/test-employee/should-find-all-employees/http-request.adoc[]

.http-response
include::{snippets}/test-employee/should-find-all-employees/http-response.adoc[]

.httpie-request
include::{snippets}/test-employee/should-find-all-employees/httpie-request.adoc[]

==== Get An Office's Employees ====

.curl-request
include::{snippets}/test-employee/should-find-employees-by-office/curl-request.adoc[]

.http-request
include::{snippets}/test-employee/should-find-employees-by-office/http-request.adoc[]

.http-response
include::{snippets}/test-employee/should-find-employees-by-office/http-response.adoc[]

.httpie-request
include::{snippets}/test-employee/should-find-employees-by-office/httpie-request.adoc[]

==== Update Employee's Contact Details ====

.curl-request
include::{snippets}/test-employee/should-set-contact-detail-of-employee/curl-request.adoc[]

.http-request
include::{snippets}/test-employee/should-set-contact-detail-of-employee/http-request.adoc[]

.http-response
include::{snippets}/test-employee/should-set-contact-detail-of-employee/http-response.adoc[]

.httpie-request
include::{snippets}/test-employee/should-set-contact-detail-of-employee/httpie-request.adoc[]

==== Delete Employee's Contact Details ====

.curl-request
include::{snippets}/test-employee/should-delete-contact-detail-of-employee/curl-request.adoc[]

.http-request
include::{snippets}/test-employee/should-delete-contact-detail-of-employee/http-request.adoc[]

.http-response
include::{snippets}/test-employee/should-delete-contact-detail-of-employee/http-response.adoc[]

.httpie-request
include::{snippets}/test-employee/should-delete-contact-detail-of-employee/httpie-request.adoc[]

==== Delete An Employee ====

.curl-request
include::{snippets}/test-employee/should-delete-employee/curl-request.adoc[]

.http-request
include::{snippets}/test-employee/should-delete-employee/http-request.adoc[]

.http-response
include::{snippets}/test-employee/should-delete-employee/http-response.adoc[]

.httpie-request
include::{snippets}/test-employee/should-delete-employee/httpie-request.adoc[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source,bash]
----
$ curl 'http://localhost:8080/office/v1/employees' -i -X POST -H 'Content-Type: application/json' -d 'pmOnIEX1BHG2Zj3CI45It135RjS30UMZ'
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[source,http,options="nowrap"]
----
POST /office/v1/employees HTTP/1.1
Content-Type: application/json
Host: localhost:8080
Content-Length: 32
pmOnIEX1BHG2Zj3CI45It135RjS30UMZ
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[source,http,options="nowrap"]
----
HTTP/1.1 404 Not Found
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source,bash]
----
$ echo 'pmOnIEX1BHG2Zj3CI45It135RjS30UMZ' | http POST 'http://localhost:8080/office/v1/employees' 'Content-Type:application/json'
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source,bash]
----
$ curl 'http://localhost:8080/office/v1/employees/GNhkajYzqKNwN4QCRkuPbCl5ZhME0LfO/contacts' -i -X DELETE -H 'Content-Type: image/png'
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[source,http,options="nowrap"]
----
DELETE /office/v1/employees/GNhkajYzqKNwN4QCRkuPbCl5ZhME0LfO/contacts HTTP/1.1
Content-Type: image/png
Host: localhost:8080
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[source,http,options="nowrap"]
----
HTTP/1.1 404 Not Found
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source,bash]
----
$ http DELETE 'http://localhost:8080/office/v1/employees/GNhkajYzqKNwN4QCRkuPbCl5ZhME0LfO/contacts' 'Content-Type:image/png'
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source,bash]
----
$ curl 'http://localhost:8080/office/v1/employees/FBea9IQEOII3aaR7xv7jBQCN6dEFrqqY' -i -X DELETE -H 'Accept: */*' -H 'Content-Type: application/json'
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[source,http,options="nowrap"]
----
DELETE /office/v1/employees/FBea9IQEOII3aaR7xv7jBQCN6dEFrqqY HTTP/1.1
Accept: */*
Content-Type: application/json
Host: localhost:8080
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[source,http,options="nowrap"]
----
HTTP/1.1 404 Not Found
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source,bash]
----
$ http DELETE 'http://localhost:8080/office/v1/employees/FBea9IQEOII3aaR7xv7jBQCN6dEFrqqY' 'Accept:*/*' 'Content-Type:application/json'
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source,bash]
----
$ curl 'http://localhost:8080/office/v1/employees' -i -H 'Accept: */*'
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[source,http,options="nowrap"]
----
GET /office/v1/employees HTTP/1.1
Accept: */*
Host: localhost:8080
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[source,http,options="nowrap"]
----
HTTP/1.1 404 Not Found
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source,bash]
----
$ http GET 'http://localhost:8080/office/v1/employees' 'Accept:*/*'
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source,bash]
----
$ curl 'http://localhost:8080/office/v1/employees' -i -H 'Accept: */*'
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[source,http,options="nowrap"]
----
GET /office/v1/employees HTTP/1.1
Accept: */*
Host: localhost:8080
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[source,http,options="nowrap"]
----
HTTP/1.1 404 Not Found
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source,bash]
----
$ http GET 'http://localhost:8080/office/v1/employees' 'Accept:*/*'
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[source,bash]
----
$ curl 'http://localhost:8080/office/v1/employees/nqnRpYG4QlyLKtPVrJQDz2mEak2cncBL/contacts' -i -X PUT -H 'Accept: */*' -H 'Content-Type: application/json' -d 'nqnRpYG4QlyLKtPVrJQDz2mEak2cncBL'
----
Loading

0 comments on commit 67053a9

Please sign in to comment.