diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml index ebe712c9..48090efc 100644 --- a/.github/workflows/test-report.yml +++ b/.github/workflows/test-report.yml @@ -23,12 +23,15 @@ jobs: with: java-version: 1.8 - - name: Decrypt release secret + - name: Decrypt secrets run: | + chmod +x ./.github/scripts/decrypt_key.sh chmod +x ./.github/scripts/decrypt_develop_key.sh + ./.github/scripts/decrypt_key.sh ./.github/scripts/decrypt_develop_key.sh env: FIREBASE_DEVELOP_PASSPHRASE: ${{ secrets.FIREBASE_DEVELOP_PASSPHRASE }} + FIREBASE_PASSPHRASE: ${{ secrets.FIREBASE_PASSPHRASE }} - name: Grant execute permission for gradlew run: chmod +x gradlew diff --git a/.gitignore b/.gitignore index 0e9bda82..feeb1fd8 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ out/ my-pet-care-85883-firebase-adminsdk-voovm-0b4dfbf318.json my-pet-care-production-firebase-adminsdk-c1es4-6387c47d60.json +/src/main/resources/application.properties diff --git a/README.md b/README.md index 19c4256e..06bcd12b 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,4 @@ Software project from FIB (Facultat d'Informàtica de Barcelona) ## Documentation Documentation for the current release: - - [Webservice Javadoc](https://javadoc.jitpack.io/com/github/Grupo13-PES-Mascotas/PES_My-Pet-Care-Webservice/develop-5330235bba-1/javadoc/) + - [Webservice Javadoc](https://javadoc.jitpack.io/com/github/Grupo13-PES-Mascotas/PES_My-Pet-Care-Webservice/v2.0.1/javadoc/) diff --git a/src/main/java/org/pesmypetcare/webservice/controller/appmanager/GoogleCalendarRestController.java b/src/main/java/org/pesmypetcare/webservice/controller/appmanager/GoogleCalendarRestController.java index d9453ce8..77cccf99 100644 --- a/src/main/java/org/pesmypetcare/webservice/controller/appmanager/GoogleCalendarRestController.java +++ b/src/main/java/org/pesmypetcare/webservice/controller/appmanager/GoogleCalendarRestController.java @@ -144,9 +144,9 @@ public void updateEvent(@RequestHeader(TOKEN) String accessToken, @PathVariable */ @DeleteMapping("/event/{owner}/{petName}") public void deleteEvent(@RequestHeader(TOKEN) String accessToken, @PathVariable String owner, - @PathVariable String petName, @RequestBody Map<String, Object> body) + @PathVariable String petName, @RequestBody Map<String, String> body) throws CalendarAccessException, DatabaseAccessException, DocumentException { - googleCalendarService.deleteEvent(accessToken, owner, petName, (String) body.get("eventId")); + googleCalendarService.deleteEvent(accessToken, owner, petName, body.get("eventId")); } } diff --git a/src/main/java/org/pesmypetcare/webservice/entity/petmanager/PetEntity.java b/src/main/java/org/pesmypetcare/webservice/entity/petmanager/PetEntity.java index 4bda29e0..4062f973 100644 --- a/src/main/java/org/pesmypetcare/webservice/entity/petmanager/PetEntity.java +++ b/src/main/java/org/pesmypetcare/webservice/entity/petmanager/PetEntity.java @@ -138,7 +138,7 @@ public static void checkCollectionKeyAndBody(String field, String key, Map<Strin checkMeals(key, body); break; case WEIGHTS: - checkDateAndValueInteger(key, body); + checkDateAndValueDouble(key, body); break; case EXERCISES: checkExercises(key, body); @@ -181,16 +181,16 @@ public static void checkMeals(String key, Map<String, Object> body) { /** * Checks that key and body have the correct format for a date key and body with one element whose key is 'value' - * and has an Object of type Integer. + * and has an Object of type Double. * @param key Key of the attribute * @param body Body of the attribute */ - public static void checkDateAndValueInteger(String key, Map<String, Object> body) { + public static void checkDateAndValueDouble(String key, Map<String, Object> body) { checkDateFormat(key); if (body.size() != 1 || !body.containsKey(VALUE)) { throw new IllegalArgumentException(INCORRECT_BODY_FORMAT); } - if (!(body.get(VALUE) instanceof Integer)) { + if (!(body.get(VALUE) instanceof Integer) && !(body.get(VALUE) instanceof Double)) { throw new IllegalArgumentException(INCORRECT_BODY_FORMAT); } }