From 088ceef382a1140d09f919592a54f49e8d5e44e8 Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Tue, 30 Aug 2022 09:56:19 +0200
Subject: [PATCH] Improving documentation for the endpoints in
 GrowthStageService

---
 .../logic/service/GrowthStageService.java     | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/src/main/java/no/nibio/vips/logic/service/GrowthStageService.java b/src/main/java/no/nibio/vips/logic/service/GrowthStageService.java
index 05b07d7a..d4954d2d 100644
--- a/src/main/java/no/nibio/vips/logic/service/GrowthStageService.java
+++ b/src/main/java/no/nibio/vips/logic/service/GrowthStageService.java
@@ -60,6 +60,7 @@ public class GrowthStageService {
     PointOfInterestBean pointOfInterestBean;
     
     /**
+     * TODO Add response example
      * At what dates can we expect the given crop to be at the given growth stages
      * at the given location?
      * @param organismId
@@ -94,6 +95,7 @@ public class GrowthStageService {
     }
     
     /**
+     * TODO Add response example
      * At what GS is the given organism at the given date and location?
      * @param organismId
      * @param dateStr
@@ -122,6 +124,11 @@ public class GrowthStageService {
         return Response.ok().entity(retVal).build();
     }
 
+    /**
+     * 
+     * @param location
+     * @return 
+     */
     private Coordinate getLocationCoordinate(String location)
     {
         String[] lonLat = location.split(",");
@@ -131,6 +138,12 @@ public class GrowthStageService {
         return retVal;
     }
     
+    /**
+     * 
+     * @param datesForGrowthStages
+     * @param date
+     * @return 
+     */
     private Integer getGrowthStageForDate(List<GrowthStageLocationDate> datesForGrowthStages, LocalDate date)
     {
         Integer dateDayNum = date.getDayOfYear();
@@ -168,6 +181,13 @@ public class GrowthStageService {
         return null;
     }
     
+    /**
+     * 
+     * @param datesForGrowthStages
+     * @param growthStage
+     * @param season
+     * @return 
+     */
     private LocalDate getDateForGrowthStage(List<GrowthStageLocationDate> datesForGrowthStages, Integer growthStage, Integer season)
     {
         Collections.sort(datesForGrowthStages);
@@ -203,6 +223,12 @@ public class GrowthStageService {
         return null;
     }
     
+    /**
+     * 
+     * @param location
+     * @param organismId
+     * @return 
+     */
     private List<GrowthStageLocationDate> getGrowthStageDatesForLocationAndCrop(String location, Integer organismId)
     {
         List<PointOfInterestWeatherStation> stationsWithGrowthStageInfoForCrop = em.createNativeQuery(
-- 
GitLab