614 lines
13 KiB
JSON
614 lines
13 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "Api Documentation",
|
|
"version": "1.0",
|
|
"title": "Api Documentation",
|
|
"termsOfService": "urn:tos",
|
|
"contact": {
|
|
"name": "Contact Email"
|
|
},
|
|
"license": {
|
|
"name": "Apache 2.0",
|
|
"url": "http://www.apache.org/licenses/LICENSE-2.0"
|
|
}
|
|
},
|
|
"host": "localhost:8080",
|
|
"basePath": "/",
|
|
"tags": [
|
|
{
|
|
"name": "account-query-controller",
|
|
"description": "Account Query Controller"
|
|
},
|
|
{
|
|
"name": "money-transfer-controller",
|
|
"description": "Money Transfer Controller"
|
|
},
|
|
{
|
|
"name": "auth-controller",
|
|
"description": "Auth Controller"
|
|
},
|
|
{
|
|
"name": "customer-controller",
|
|
"description": "Customer Controller"
|
|
},
|
|
{
|
|
"name": "customer-query-controller",
|
|
"description": "Customer Query Controller"
|
|
},
|
|
{
|
|
"name": "account-controller",
|
|
"description": "Account Controller"
|
|
}
|
|
],
|
|
"paths": {
|
|
"/accounts": {
|
|
"get": {
|
|
"tags": [
|
|
"account-query-controller"
|
|
],
|
|
"summary": "getAccountsForCustomer",
|
|
"operationId": "getAccountsForCustomerUsingGET",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"*/*"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "customerId",
|
|
"in": "query",
|
|
"description": "customerId",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/GetAccountResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"account-controller"
|
|
],
|
|
"summary": "createAccount",
|
|
"operationId": "createAccountUsingPOST",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"*/*"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "request",
|
|
"description": "request",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/CreateAccountRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/CreateAccountResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountId}": {
|
|
"get": {
|
|
"tags": [
|
|
"account-query-controller"
|
|
],
|
|
"summary": "get",
|
|
"operationId": "getUsingGET",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"*/*"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "accountId",
|
|
"in": "path",
|
|
"description": "accountId",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/GetAccountResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountId}/history": {
|
|
"get": {
|
|
"tags": [
|
|
"account-query-controller"
|
|
],
|
|
"summary": "getTransactionsHistory",
|
|
"operationId": "getTransactionsHistoryUsingGET",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"*/*"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "accountId",
|
|
"in": "path",
|
|
"description": "accountId",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/AccountTransactionInfo"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/customers": {
|
|
"get": {
|
|
"tags": [
|
|
"customer-query-controller"
|
|
],
|
|
"summary": "getCustomersByEmail",
|
|
"operationId": "getCustomersByEmailUsingGET",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"*/*"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "email",
|
|
"in": "query",
|
|
"description": "email",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/CustomersQueryResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"customer-controller"
|
|
],
|
|
"summary": "createCustomer",
|
|
"operationId": "createCustomerUsingPOST",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"*/*"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "customer",
|
|
"description": "customer",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/CustomerInfo"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/CustomerResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/customers/{customerId}": {
|
|
"get": {
|
|
"tags": [
|
|
"customer-query-controller"
|
|
],
|
|
"summary": "getCustomer",
|
|
"operationId": "getCustomerUsingGET",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"*/*"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "customerId",
|
|
"in": "path",
|
|
"description": "customerId",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/QuerySideCustomer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/customers/{id}/toaccounts": {
|
|
"post": {
|
|
"tags": [
|
|
"customer-controller"
|
|
],
|
|
"summary": "addToAccount",
|
|
"operationId": "addToAccountUsingPOST",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"*/*"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"description": "id",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"in": "body",
|
|
"name": "request",
|
|
"description": "request",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/ToAccountInfo"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/login": {
|
|
"post": {
|
|
"tags": [
|
|
"auth-controller"
|
|
],
|
|
"summary": "doAuth",
|
|
"operationId": "doAuthUsingPOST",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"*/*"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "request",
|
|
"description": "request",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/AuthRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/QuerySideCustomer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/transfers": {
|
|
"post": {
|
|
"tags": [
|
|
"money-transfer-controller"
|
|
],
|
|
"summary": "createMoneyTransfer",
|
|
"operationId": "createMoneyTransferUsingPOST",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"*/*"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "request",
|
|
"description": "request",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/CreateMoneyTransferRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/CreateMoneyTransferResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/user": {
|
|
"get": {
|
|
"tags": [
|
|
"auth-controller"
|
|
],
|
|
"summary": "getCurrentUser",
|
|
"operationId": "getCurrentUserUsingGET",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"*/*"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/QuerySideCustomer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"CreateAccountResponse": {
|
|
"properties": {
|
|
"accountId": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"AuthRequest": {
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"QuerySideCustomer": {
|
|
"properties": {
|
|
"address": {
|
|
"$ref": "#/definitions/Address"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"$ref": "#/definitions/Name"
|
|
},
|
|
"phoneNumber": {
|
|
"type": "string"
|
|
},
|
|
"ssn": {
|
|
"type": "string"
|
|
},
|
|
"toAccounts": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"$ref": "#/definitions/ToAccountInfo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"Address": {
|
|
"properties": {
|
|
"city": {
|
|
"type": "string"
|
|
},
|
|
"state": {
|
|
"type": "string"
|
|
},
|
|
"street1": {
|
|
"type": "string"
|
|
},
|
|
"street2": {
|
|
"type": "string"
|
|
},
|
|
"zipCode": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"CreateMoneyTransferResponse": {
|
|
"properties": {
|
|
"moneyTransferId": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"ToAccountInfo": {
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"owner": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Name": {
|
|
"properties": {
|
|
"firstName": {
|
|
"type": "string"
|
|
},
|
|
"lastName": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"GetAccountResponse": {
|
|
"properties": {
|
|
"accountId": {
|
|
"type": "string"
|
|
},
|
|
"balance": {
|
|
"type": "number",
|
|
"format": "double"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"CreateAccountRequest": {
|
|
"properties": {
|
|
"customerId": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"initialBalance": {
|
|
"type": "number",
|
|
"format": "double"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"CustomersQueryResponse": {
|
|
"properties": {
|
|
"customers": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/QuerySideCustomer"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"AccountTransactionInfo": {
|
|
"properties": {
|
|
"amount": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"fromAccountId": {
|
|
"type": "string"
|
|
},
|
|
"toAccountId": {
|
|
"type": "string"
|
|
},
|
|
"transactionId": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Map«string,ToAccountInfo»": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"$ref": "#/definitions/ToAccountInfo"
|
|
}
|
|
},
|
|
"CreateMoneyTransferRequest": {
|
|
"properties": {
|
|
"amount": {
|
|
"type": "number",
|
|
"format": "double"
|
|
},
|
|
"fromAccountId": {
|
|
"type": "string"
|
|
},
|
|
"toAccountId": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"CustomerInfo": {
|
|
"properties": {
|
|
"address": {
|
|
"$ref": "#/definitions/Address"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"$ref": "#/definitions/Name"
|
|
},
|
|
"phoneNumber": {
|
|
"type": "string"
|
|
},
|
|
"ssn": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"CustomerResponse": {
|
|
"properties": {
|
|
"customerInfo": {
|
|
"$ref": "#/definitions/CustomerInfo"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |