in folder RESTful
there is the REST web service that is used to communicate with the database and retrieve the resources representations returned in JSON format.
in webApp
folder there is the web app that is used by the user to interact with the web service.
Given a group id encoded in the URL, returns a JSON string containing the information about the group:
id
of the groupname
of the group- array of
members
of the group as described in next section.
example:
{ "name": "12/B",
"members": [
{ "balance": 10.20,
"name": "Alice",
"points": 78,
"password": "pbkdf2:sha1:1000$4mYgPAhx$95506b27ab6e8923fd2ddee47c226e420bd43b06",
"id": 11
},
{ "balance": -5.50,
"name": "Bob",
"points": 85,
"password": "pbkdf2:sha1:1000$DNJRmIj1$a66745add16ee270639affd47cfa8ad7afbc40c9",
"id": 12
},
{...}
],
"id": 1
}
Given a group id and a user id encoded in the URL, returns a JSON string containing the information about the user:
id
of the username
of the userpassword
of the userpoints
of the userbalance
of the user
example:
{
"balance": 10.20,
"name": "Alice",
"points": 78,
"password": "pbkdf2:sha1:1000$4mYgPAhx$95506b27ab6e8923fd2ddee47c226e420bd43b06",
"id": 11
}
Given a group id and a user id encoded in the URL, it returns a JSON string containing the gist information about the user activities:
date
of the activitiespoints
that the user collected that date
example:
{
"user": 1,
"gist": [
{
"points": 3,
"date": "2017-07-30"
},
{
"points": 2,
"date": "2017-07-31"
},
{
"points": 5,
"date": "2017-08-01"
},
{...}
]
}
Given a group id and a user id encoded in the URL, returns a JSON string containing the information about the user's cleaning activities:
id
of the activity- name of the
user
- name of the
task
date
when the activity has been carried outdescription
of the activity (can be null)
example:
[
{
"date": "2017-07-30",
"user": "Alice",
"task": "vacuum cleaner",
"description": null,
"id": 5
},
{
"date": "2017-07-20",
"user": "Alice",
"task": "wash wc",
"description": null,
"id": 15
},
{...}
]
Given a group id encoded in the URL, returns a JSON string containing the information about the financial movements within a group ordered by date in descending order:
id
of the userbalance
of the username
of the user
It can take two arguments:
offset
: the offset of the entries in the databasecount
: the number of entries to retrieve
example:
{
"activities": [
{
"description": "shopping at Coop",
"user": 11,
"date": "2017-07-30",
"id": 6,
"amount": 10.32
},
{
"description": "shopping at Poli",
"user": 12,
"date": "2017-08-01",
"id": 7,
"amount": 12.12
},
{...}
]
}
Given a group id and a task id encoded in the URL, returns a JSON string containing the information about the activities of that type within a group ordered by date in descending order:
id
of the activity- name of the
user
- name of the
task
date
when the activity has been carried outdescription
of the activity (can be null)
It can take two arguments:
offset
: the offset of the entries in the databasecount
: the number of entries to retrieve example:
[
{
"date": "2017-07-30",
"user": "Alice",
"task": "vacuum cleaner",
"description": null,
"id": 5
},
{
"date": "2017-07-31",
"user": "Bob",
"task": "clean pantries",
"description": null,
"id": 15
},
{...}
]
Given a group id encoded in the URL, returns a JSON string containing the information about the last activity of each that type within a group:
id
of the activity- name of the
user
- name of the
task
date
when the activity has been carried outdescription
of the activity (can be null)
example:
[
{
"date": "2017-07-30",
"user": "Alice",
"task": "vacuum cleaner",
"description": null,
"id": 5
},
{
"date": "2017-07-31",
"user": "Bob",
"task": "clean pantries",
"description": null,
"id": 15
},
{...}
]
Given a group id encoded in the URL, returns a JSON string containing the information about the activities of that type within a group ordered by date in descending order:
id
of the activity- name of the
user
- name of the
task
date
when the activity has been carried outdescription
of the activity (can be null)
It can take two arguments:
offset
: the offset of the entries in the databasecount
: the number of entries to retrieve example:
[
{
"date": "2017-07-30",
"user": "Alice",
"task": "vacuum cleaner",
"description": null,
"id": 5
},
{
"date": "2017-07-31",
"user": "Bob",
"task": "clean pantries",
"description": null,
"id": 15
},
{...}
]
Given a group id encoded in the URL, it returns a string containing the shopping list for that group.
Given a group id encoded in the URL, returns a JSON string containing the information about the tasks of that group:
id
of the taskname
of the taskgroup
in which the task is validfrequency
with which the task has to be completedvalue
of that task
example:
[
{
"value": 3,
"frequency": 4,
"group": 1,
"name": "vacuum cleaner",
"id": 1
},
{
"value": 5,
"frequency": 10,
"group": 1,
"name": "mop",
"id": 2
},
{...}
]
Given a group id and a user id encoded in the URL, deletes the user entry from the database. It returns a JSON string containing the information about the deleted user:
id
of the username
of the userpassword
of the usergroup
of the userbalance
of the user
example:
{ "balance": 10.20,
"name": "Alice",
"password": "pbkdf2:sha1:1000$4mYgPAhx$95506b27ab6e8923fd2ddee47c226e420bd43b06",
"id": 11,
"group": 1
}
Given a group id and a user id encoded in the URL, and the following parameters as form values:
name
: optional, new name of the userpassword
: optional, new password of the user it updates the user entry in the database. It returns a JSON string containing the updated information about the user:id
of the username
of the userpassword
of the usergroup
of the userbalance
of the user
example:
{ "balance": 10.20,
"name": "Alice",
"password": "pbkdf2:sha1:1000$4mYgPAhx$95506b27ab6e8923fd2ddee47c226e420bd43b06",
"id": 11,
"group": 1
}
Given a group id and a user id encoded in the URL, and the following parameters as form values:
delta
: mandatory, the amount to add to the balance (can be negative) it updates the user entry in the database. It returns a JSON string containing the updated information about the user:id
of the username
of the userpassword
of the usergroup
of the userbalance
of the user
example:
{ "balance": 10.20,
"name": "Alice",
"password": "pbkdf2:sha1:1000$4mYgPAhx$95506b27ab6e8923fd2ddee47c226e420bd43b06",
"id": 11,
"group": 1
}
Given a group id encoded in the URL, and the following parameters as form values:
name
: mandatory, name of the userpassword
: mandatory, password of the user it creates the user entry in the database. It returns a JSON string containing the information about the new user:id
of the username
of the userpassword
of the usergroup
of the userbalance
of the user
example:
{ "balance": 0.00,
"name": "Charlie",
"password": "pbkdf2:sha1:1000$n5ENeoo3$bddbda1b0513edcba60fbd1b4e1210256c615c2a",
"id": 15,
"group": 1
}
Given a group id encoded in the URL, it deletes the group entry from the database. It returns a JSON string containing the information about the deleted group:
id
of the groupname
of the groupmembers
of the group
example:
{ "name": "12/B",
"id": 1,
"members": [
{ "balance": 10.20,
"name": "Alice",
"points": 78,
"password": "pbkdf2:sha1:1000$4mYgPAhx$95506b27ab6e8923fd2ddee47c226e420bd43b06",
"id": 11
},
{ "balance": -5.50,
"name": "Bob",
"points": 85,
"password": "pbkdf2:sha1:1000$DNJRmIj1$a66745add16ee270639affd47cfa8ad7afbc40c9",
"id": 12
},
{...}
]
}
Given a group id encoded in the URL, and the following parameters as form values:
user
: mandatory, name of the useramount
: mandatory, amount of the movementdate
: mandatory, date of the movementdescription
: mandatory, description of the movement it creates the movement entry in the database. It returns a JSON string containing the information about the new movement:id
of the movement- name of the
user
amount
of the movementdate
of the movementdescription
of the movement
example:
{
"description": "shopping at Poli",
"user": 12,
"date": "2017-07-30",
"id": 7,
"amount": 12.12
}
Given a group id encoded in the URL, it deletes the movement entry from the database. It returns a JSON string containing the information about the deleted movement:
id
of the movement- name of the
user
amount
of the movementdate
of the movementdescription
of the movement
example:
{
"description": "shopping at Poli",
"user": 12,
"date": "2017-07-30",
"id": 7,
"amount": 12.12
}
Given a group id encoded in the URL, and the following parameters as form values:
user
: mandatory, id of the usertask
: mandatory, id of the taskdate
: optional, date of activity it creates the activity entry in the database. It returns a JSON string containing the information about the new activity:id
of the activity- id of the
user
- id of the
task
date
when the activity has been carried out
example:
{
"date": "2017-07-31",
"user": 12,
"task": 2,
"id": 15
}
Given a group id encoded in the URL and the following parameters as form values:
list
: mandatory, shopping list it updates the shopping in the database. It returns a string containing the updated shopping list for that group.
Given a group id encoded in the URL, and the following parameters as form values:
name
: mandatory, name of the taskfrequency
: mandatory, frequency with which the task has to be completedvalue
: mandatory, value of that task it creates the task entry in the database. It returns a JSON string containing the information about the new task:id
of the taskname
of the taskgroup
in which the task is validfrequency
with which the task has to be completedvalue
of that task
example:
{
"value": 5,
"frequency": 10,
"group": 1,
"name": "mop",
"id": 2
}
Given a group id encoded in the URL and the following parameters as form values:
id
: mandatory, id of the task it deletes the task entry from the database. It returns a JSON string containing the information about the deleted task:id
of the taskname
of the taskgroup
in which the task is validfrequency
with which the task has to be completedvalue
of that task
example:
{
"value": 5,
"frequency": 10,
"group": 1,
"name": "mop",
"id": 2
}
Given a group id encoded in the URL, and the following parameters as form values:
name
: optional, name of the taskfrequency
: optional, frequency with which the task has to be completedvalue
: optional, value of that task it updates the task entry in the database. It returns a JSON string containing the updated information about the task:id
of the taskname
of the taskgroup
in which the task is validfrequency
with which the task has to be completedvalue
of that task
example:
{
"value": 5,
"frequency": 7,
"group": 1,
"name": "mop",
"id": 2
}
Given a group id encoded in the URL, and the following parameters as form values:
name
: optional, name of the group it updates the group entry in the database. It returns a JSON string containing the updated information about the group:id
of the groupname
of the groupmembers
of the group
example:
{
"name": "13/A",
"id": 1,
"members": [
{ "balance": 10.20,
"name": "Alice",
"points": 78,
"password": "pbkdf2:sha1:1000$4mYgPAhx$95506b27ab6e8923fd2ddee47c226e420bd43b06",
"id": 11
},
{ "balance": -5.50,
"name": "Bob",
"points": 85,
"password": "pbkdf2:sha1:1000$DNJRmIj1$a66745add16ee270639affd47cfa8ad7afbc40c9",
"id": 12
},
{...}
]
}
Given the following parameters as form values:
name
: optional, name of the group it creates the group entry in the database. It returns a JSON string containing the information about the new group:id
of the groupname
of the groupmembers
of the group (that would be an empty list)
example:
{
"name": "25/C",
"id": 2,
"members": []
}
Given the following parameters as form values:
name
: mandatory, name of the user to look for it searches the user entry in the database. It returns a JSON string containing the information about the found user:id
of the username
of the userpassword
of the userpoints
of the userbalance
of the user
example:
{
"balance": 10.20,
"name": "Alice",
"points": 78,
"password": "pbkdf2:sha1:1000$4mYgPAhx$95506b27ab6e8923fd2ddee47c226e420bd43b06",
"id": 11
}