Skip to content

Commit

Permalink
Merge pull request #2 from agilitytestbed/extension-categorization
Browse files Browse the repository at this point in the history
Merge implementation of first extension into master
  • Loading branch information
oplosthee authored Apr 24, 2018
2 parents 42f8b5e + 2a48020 commit 9ca9dd9
Show file tree
Hide file tree
Showing 7 changed files with 578 additions and 33 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# Digital Payment Assistant
# Digital Payment Assistant - Team F1

This repository contains the implementation for the Digital Payment Assistant of Team F1 for the Agility Testbed of the ING Honours 2018. The goal of the Agility Testbed is to get a better understanding of software agility and to develop a testbed of comparable systems. In this project a group of students of the University of Twente is asked to create a digital payment assistant, assisting consumers in managing and analysing their bank accounts, after which the students have to deal with a high number of changing requirements.

## Testing

The JUnit tests for this implementation can be found [here](https://github.com/agilitytestbed/Team-F1-Tests).
49 changes: 49 additions & 0 deletions src/main/java/nl/utwente/ing/controller/CategoryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@
@RequestMapping("/api/v1/categories")
public class CategoryController {

/**
* Returns a list of all the categories that are available to the session ID.
*
* @param headerSessionID the session ID present in the header of the request
* @param querySessionID the session ID present in the URL of the request
* @param response the response shown to the user, necessary to edit the status code of the response
* @return a JSON serialized representation of all categories
* @see Category
*/
@RequestMapping(value = "", method = RequestMethod.GET)
public List<Category> getCategories(@RequestHeader(value = "X-session-ID", required = false) String headerSessionID,
@RequestParam(value = "session_id", required = false) String querySessionID,
Expand Down Expand Up @@ -68,6 +77,17 @@ public List<Category> getCategories(@RequestHeader(value = "X-session-ID", requi
}
}

/**
* Creates a new Category that is linked to the current session ID. Expects the body to be formatted according
* to the <a href="https://app.swaggerhub.com/apis/djhuistra/INGHonours/1.2.1">API specification</a>.
*
* @param headerSessionID the session ID present in the header of the request
* @param querySessionID the session ID present in the URL of the request
* @param body the request body containing the JSON representation of the Category to add
* @param response the response shown to the user, necessary to edit the status code of the response
* @return a JSON serialized representation of the newly added Category
* @see Category
*/
@RequestMapping(value = "", method = RequestMethod.POST)
public Category addCategory(@RequestHeader(value = "X-session-ID", required = false) String headerSessionID,
@RequestParam(value = "session_id", required = false) String querySessionID,
Expand Down Expand Up @@ -118,6 +138,16 @@ public Category addCategory(@RequestHeader(value = "X-session-ID", required = fa
}
}

/**
* Returns a specific Category corresponding to the category ID.
*
* @param headerSessionID the session ID present in the header of the request
* @param querySessionID the session ID present in the URL of the request
* @param id the category ID corresponding to the category to return
* @param response the response shown to the user, necessary to edit the status code of the response
* @return a JSON serialized representation of the specified Category
* @see Category
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public Category getCategory(@RequestHeader(value = "X-session-ID", required = false) String headerSessionID,
@RequestParam(value = "session_id", required = false) String querySessionID,
Expand Down Expand Up @@ -146,6 +176,17 @@ public Category getCategory(@RequestHeader(value = "X-session-ID", required = fa
}
}

/**
* Updates the given category corresponding to the category ID.
*
* @param headerSessionID the session ID present in the header of the request
* @param querySessionID the session ID present in the URL of the request
* @param id the category ID corresponding to the category to update
* @param body the request body containing the JSON representation of the Category to update
* @param response the response shown to the user, necessary to edit the status code of the response
* @return a JSON serialized representation of the updated Category
* @see Category
*/
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public Category putCategory(@RequestHeader(value = "X-session-ID", required = false) String headerSessionID,
@RequestParam(value = "session_id", required = false) String querySessionID,
Expand Down Expand Up @@ -190,6 +231,14 @@ public Category putCategory(@RequestHeader(value = "X-session-ID", required = fa
}
}

/**
* Deletes the category corresponding to the given category ID.
*
* @param headerSessionID the session ID present in the header of the request
* @param querySessionID the session ID present in the URL of the request
* @param id the category ID corresponding to the category to delete
* @param response the response shown to the user, necessary to edit the status code of the response
*/
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public void deleteCategory(@RequestHeader(value = "X-session-ID", required = false) String headerSessionID,
@RequestParam(value = "session_id", required = false) String querySessionID,
Expand Down
Loading

0 comments on commit 9ca9dd9

Please sign in to comment.