add get promotions to apib

pull/32/head
HardiReady 2018-03-25 21:06:57 +02:00
parent e2722afee7
commit b85f987088
7 changed files with 60 additions and 12 deletions

View File

@ -1,18 +1,24 @@
### GET Awardings [GET /awardings{?userId,confirmed}]
### GET Awardings [GET /awardings{?userId,inProgress,fractFilter}]
List all awardings
+ Parameters
+ userId (string, optional)
specific army member Id to show the awardings for
specific army member Id to show the awardings for
+ confirmed (number, optional)
Field to filter by request awarding state
+ inProgress (boolean, optional)
true to filter by awarding state 'in progress'
+ Default: false
+ fractFilter (enum[string], optional)
Field to filter by fraction
+ Members
+ 0 - not decided
+ 1 - confirmed
+ 2 - rejected
+ `BLUFOR`
+ `OPFOR`
+ `GLOBAL`
+ Response 200

View File

@ -0,0 +1,25 @@
### GET Promotions [GET /promotion{?squadId,inProgress,fractFilter}]
List all promotion requests
+ Parameters
+ squadId (string, optional)
specific squad Id to show the promotion requests for
+ inProgress (boolean, optional)
true to filter by promotion state 'in progress'
+ Default: false
+ fractFilter (enum[string], optional)
Field to filter by fraction
+ Members
+ `BLUFOR`
+ `OPFOR`
+ `GLOBAL`
+ Response 200
+ Attributes (array[Promotion])

View File

@ -0,0 +1,13 @@
# Promotion (object)
Representation of a promotion request for a army member
## Properties
+ _id: `5as7d05dcb90ce4da68c4f5f` (string, required) - unique id of the promotion request
+ confirmed: 0 (number, required) - number representing status of the promotion (0 - in progress, 1 - approved, 2 - rejected)
+ newRankLvl: 14 - new rank level that is requested in this promotion
+ oldRankLvl: 10 - old rank level of the user
+ proposer: (Proposer, required) - app user who requested the promotion
+ timestamp: `2018-03-25T18:54:21.609Z` (string, required) - creation timestamp
+ updatedAt: `2018-03-25T18:54:21.609Z` (string, required) - version timestamp
+ userId (User, required) - populated user instance of user the promotion is requested for
+ __v: 0 (number, required) - version number of promotion instance

View File

@ -10,6 +10,8 @@
:[Gists](_decoration.apib)
:[Gists](_promotion.apib)
:[Gists](_squad.apib)
:[Gists](_user.apib)

View File

@ -18,6 +18,10 @@ FORMAT: 1A
# Group Account
# Group Army Overview
:[Gists](army-management/army.apib)
# Group Awardings
:[Gists](army-management/awardings.apib)
@ -30,16 +34,14 @@ FORMAT: 1A
# Group Logs
# Group Overview
:[Gists](overview/army.apib)
# Group Players
# Group Ranks
# Group Requests
:[Gists](army-management/promotions.apib)
# Group Squads
# Group Users

View File

@ -58,7 +58,7 @@ request.route('/award')
request.route('/promotion')
.get((req, res, next) => {
// TODO: add SQL authentication
// TODO: add SQL authentication?
const squadFilter = req.query.squadId;
const fractFilter = req.query.fractFilter;
const progressFilter = req.query.inProgress;