add get promotions to apib
parent
e2722afee7
commit
b85f987088
|
@ -1,4 +1,4 @@
|
||||||
### GET Awardings [GET /awardings{?userId,confirmed}]
|
### GET Awardings [GET /awardings{?userId,inProgress,fractFilter}]
|
||||||
|
|
||||||
List all awardings
|
List all awardings
|
||||||
|
|
||||||
|
@ -6,13 +6,19 @@ List all awardings
|
||||||
+ userId (string, optional)
|
+ userId (string, optional)
|
||||||
specific army member Id to show the awardings for
|
specific army member Id to show the awardings for
|
||||||
|
|
||||||
+ confirmed (number, optional)
|
+ inProgress (boolean, optional)
|
||||||
Field to filter by request awarding state
|
true to filter by awarding state 'in progress'
|
||||||
|
|
||||||
|
+ Default: false
|
||||||
|
|
||||||
|
+ fractFilter (enum[string], optional)
|
||||||
|
Field to filter by fraction
|
||||||
|
|
||||||
+ Members
|
+ Members
|
||||||
+ 0 - not decided
|
+ `BLUFOR`
|
||||||
+ 1 - confirmed
|
+ `OPFOR`
|
||||||
+ 2 - rejected
|
+ `GLOBAL`
|
||||||
|
|
||||||
|
|
||||||
+ Response 200
|
+ Response 200
|
||||||
|
|
||||||
|
|
|
@ -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])
|
|
@ -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
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
:[Gists](_decoration.apib)
|
:[Gists](_decoration.apib)
|
||||||
|
|
||||||
|
:[Gists](_promotion.apib)
|
||||||
|
|
||||||
:[Gists](_squad.apib)
|
:[Gists](_squad.apib)
|
||||||
|
|
||||||
:[Gists](_user.apib)
|
:[Gists](_user.apib)
|
||||||
|
|
|
@ -18,6 +18,10 @@ FORMAT: 1A
|
||||||
|
|
||||||
# Group Account
|
# Group Account
|
||||||
|
|
||||||
|
# Group Army Overview
|
||||||
|
|
||||||
|
:[Gists](army-management/army.apib)
|
||||||
|
|
||||||
# Group Awardings
|
# Group Awardings
|
||||||
|
|
||||||
:[Gists](army-management/awardings.apib)
|
:[Gists](army-management/awardings.apib)
|
||||||
|
@ -30,16 +34,14 @@ FORMAT: 1A
|
||||||
|
|
||||||
# Group Logs
|
# Group Logs
|
||||||
|
|
||||||
# Group Overview
|
|
||||||
|
|
||||||
:[Gists](overview/army.apib)
|
|
||||||
|
|
||||||
# Group Players
|
# Group Players
|
||||||
|
|
||||||
# Group Ranks
|
# Group Ranks
|
||||||
|
|
||||||
# Group Requests
|
# Group Requests
|
||||||
|
|
||||||
|
:[Gists](army-management/promotions.apib)
|
||||||
|
|
||||||
# Group Squads
|
# Group Squads
|
||||||
|
|
||||||
# Group Users
|
# Group Users
|
||||||
|
|
|
@ -58,7 +58,7 @@ request.route('/award')
|
||||||
request.route('/promotion')
|
request.route('/promotion')
|
||||||
|
|
||||||
.get((req, res, next) => {
|
.get((req, res, next) => {
|
||||||
// TODO: add SQL authentication
|
// TODO: add SQL authentication?
|
||||||
const squadFilter = req.query.squadId;
|
const squadFilter = req.query.squadId;
|
||||||
const fractFilter = req.query.fractFilter;
|
const fractFilter = req.query.fractFilter;
|
||||||
const progressFilter = req.query.inProgress;
|
const progressFilter = req.query.inProgress;
|
||||||
|
|
Loading…
Reference in New Issue