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

Facilities

Kordian Bruck edited this page Aug 9, 2017 · 1 revision

Contents

  1. Introduction
  2. Use cases
  3. Database model
  4. REST endpoints
  5. User Interface

Introduction

Users of TCA can tag and search facilities across all the TUM campuses. These facilities can belong to category predefined by the system such as Library, Cafe, Fußball, Table Tennis etc. The marking of a facility is done based on the current location of the user from where he/she is tagging the facility. A map with highest possible scaling is shown for the purpose of marking. After a facility has been added the same can be searched by others. Facility can also be edited and deleted by the user who created it.

There is also an option of voting(upvoting or downvoting) facilities which allows the app to filter the search results which have too many downvotes and display the remaining ones sorted by the number of upvotes.

Use cases

Following scenarios represent the use cases where this feature will be applicable.

1: Student tags his/her current location

A student visits a facility/location in TUM campus which she finds interesting and thinks it should be shared with other fellow students. She opens the TCA app and goes to the menu option “Facilities” and clicks on the add button. She then selects a category (e.g. Café, Library, Volleyball etc), enters a short name and taps on OK. Her current location will be tagged under that category.

2: Student manages his location

Student opens the "Facilities" from the menu and then clicks on the "My Facilities" tab where she can find all the facilities added by her. She then can change the facility name and its category. Upon clicking the done button the changes are saved. She can also delete the facility on the same screen by clicking on the delete button in the options menu.

3: Student searches for a facility

A student is new to the campus and wants to search all the available Fußball table across the campus. She opens the TCA app and goes to the option “Search Facilities” where she selects the category as Fußball and taps on Search. A list of all the available Fußball tables is given to her. She can then tap on any of the search result and locate it on the map.

4: Student Up votes a facility

Student searches for cafés and comes across a search result which she finds accurate and useful, she taps the up vote button next to it. It will increase the credibility of the facility. However she can downvote if she comes across a facility which appears not to be accurate.

Database model

Database model

REST endpoints

1. https://tumcabe.in.tum.de/Api/facility/category

Overview : Gets all the facility categories available in the database.
Method : GET
Paramaters : None
Response : List of categories


2. https://tumcabe.in.tum.de/Api/facility/category/{categoryId}

Overview : Gets facilities given a categoryId.
Method : GET
Paramaters : categoryId (Integer)
Response : List of facilities


3. https://tumcabe.in.tum.de/Api/facility/search/{query}

Overview : Matches the given string query with name of all the facilities and returns list of matched facilities.
Method : GET
Paramaters : query (String)
Response : List of facilities


4. https://tumcabe.in.tum.de/facility/{id}

Overview : Gets a facility given its id.
Method : GET
Paramaters : id (Integer)
Response : facility object


5. https://tumcabe.in.tum.de/facility/user/

Overview : Gets all the facilities belonging to a member.
Method : POST
Parameters : member (Integer)
Response : list of facilities


6. https://tumcabe.in.tum.de/facility/delete/{id}

Overview : Deletes a facility given its id.
Method : POST
Parameters : id (Integer)
Response : None


7. https://tumcabe.in.tum.de/facility/

Overview : Saves a facility.
Method : POST
Parameters : id (Integer)[In case of editing], name(String), longitude(Double), latitude(Double), facilityCategoryId(Integer)
Response : None


8. https://tumcabe.in.tum.de/facility/map/{longitude}/{latitude}

Overview : Gets a map with marked longitude and latitude.
Method : GET
Parameters : longitude (Double), latitude(Double)
Response : a base64 encoded string of image


9. https://tumcabe.in.tum.de/facility/{id}/votes/

Overview : Saves vote for a facility given its id.
Method : POST
Parameters : id(Integer)
Response : updated facility object


User Interface

Following sections explain the UI(android) of this feature.

Technical Architecture

Following chart shows the important components of the architecture of the whole application and how they interact. Architecture

There are 3 main components

  1. Activities : These are the screens which through which users interact with the application
  2. TumCabeClient : This class is responsible for making calls to the backend api using retrofit framework.
  3. Backend : This is a separate project written in PHP which handles all the api calls and makes interaction with the database. It also takes care of calling external apis if required.(Note : You need permissions to access this project)

Activity Flow

Various activities are part of this feature. Below is the chart of all the activities
Activity Flow

Screens

  1. FacilityMainActivity
    This activity represents the home screen of facility feature
  1. FacilityActivity
    This activity shows the search results based on search query or by category
  1. FacilityDisplayActivity
    This displays an activity when clicked from a search result page
  1. FacilityTaggingActivity
    This Activity is for adding a new facility or opening an existing activity in the edit mode
Clone this wiki locally