Api quest restrictions - no purchase/start without fulfilling eligibility requirements (#10387)

* removing duplicate translation key

* fixing typos

* extracting quest prerequisite check. adding check for previous quest completion, if required

* fixing (undoing) static change, adding tests

* more typos

* correcting test failures

* honoring quest prerequisites in quest invite API call. updating format of il8n string replacement arg

* no longer using apiError, use translate method instead (msg key was not defined)

* adding @apiError to docblock as requested in issue

* removing checks on quest invite method. small window of opportunity/low risk
This commit is contained in:
Brian Fenton
2018-05-27 09:41:56 -05:00
committed by Matteo Pagliazzi
parent 8fb67e7944
commit ac90a40be5
9 changed files with 64 additions and 11 deletions

View File

@@ -830,7 +830,9 @@ api.buyMysterySet = {
*
* @apiErrorExample {json} Quest chosen does not exist
* {"success":false,"error":"NotFound","message":"Quest \"dilatoryDistress99\" not found."}
* @apiErrorExample {json} NotAuthorized Not enough gold
* @apiErrorExample {json} You must first complete this quest's prerequisites
* {"success":false,"error":"NotAuthorized","message":"You must first complete dilatoryDistress2."}
* @apiErrorExample {json} NotAuthorized Not enough gold
* {"success":false,"error":"NotAuthorized","message":"Not Enough Gold"}
*
*/
@@ -912,7 +914,7 @@ api.buySpecialSpell = {
* }
*
* @apiError {NotAuthorized} messageAlreadyPet Already have the specific pet combination
* @apiError {NotFound} messageMissingEggPotion One or both of the ingrediants are missing.
* @apiError {NotFound} messageMissingEggPotion One or both of the ingredients are missing.
* @apiError {NotFound} messageInvalidEggPotionCombo Cannot use that combination of egg and potion.
*
* @apiErrorExample {json} Already have that pet.