From b7bedf182ccabc053a7f895bc39415d51abc1fb5 Mon Sep 17 00:00:00 2001 From: abel Date: Mon, 3 Apr 2023 13:03:10 +0200 Subject: [PATCH] aggegrate KPI = false toegevoegd aan inputs --- FarmmapsApi/Constants.cs | 2 ++ FarmmapsApi/Services/GeneralService.cs | 6 +++--- FarmmapsKPI/KPIService.cs | 12 +++++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/FarmmapsApi/Constants.cs b/FarmmapsApi/Constants.cs index 027d98b..51bc178 100644 --- a/FarmmapsApi/Constants.cs +++ b/FarmmapsApi/Constants.cs @@ -13,6 +13,8 @@ namespace FarmmapsApiSamples public const string GEOJSON_ITEMTYPE = "vnd.farmmaps.itemtype.geojson"; public const string BLIGHT_ITEMTYPE = "vnd.farmmaps.itemtype.blight"; public const string CROPREC_ITEMTYPE = "vnd.farmmaps.itemtype.crprec.operation"; + public const string CROPSCHEME_ITEMTYPE = "vnd.farmmaps.itemtype.croppingscheme"; // deze toegevoegd, misschien is het type van de KPI task wel een croppingscheme + public const string VRANBS_TASK = "vnd.farmmaps.task.vranbs"; public const string VRAHERBICIDE_TASK = "vnd.farmmaps.task.vraherbicide"; diff --git a/FarmmapsApi/Services/GeneralService.cs b/FarmmapsApi/Services/GeneralService.cs index 8fde298..80ee8fe 100644 --- a/FarmmapsApi/Services/GeneralService.cs +++ b/FarmmapsApi/Services/GeneralService.cs @@ -300,12 +300,12 @@ namespace FarmmapsApi.Services //hier nog definieren waar in de hierarchie een KPI item is? //the kpi data is a child of the cropfield - var itemname = "KPI"; + var itemName = "kpi"; var KPIItem = await FindChildItemAsync(cropfieldItem.Code, - CROPFIELD_ITEMTYPE, itemname); //hier moet ik dus verwijzen naar waar het KPIItem zit? ik gok dat het een cropfield item type is... + CROPFIELD_ITEMTYPE, itemName); //hier moet ik dus verwijzen naar waar het KPIItem zit? ik gok dat het een cropfield item type is.-> of onderdeel van een croppingscheme? net toegevoegd. if (KPIItem == null) { - _logger.LogError("could not find the bofek data as a child item under the cropfield"); + _logger.LogError("could not find the KPI data as a child item under the cropfield"); return null; } diff --git a/FarmmapsKPI/KPIService.cs b/FarmmapsKPI/KPIService.cs index ce88acd..846bce7 100644 --- a/FarmmapsKPI/KPIService.cs +++ b/FarmmapsKPI/KPIService.cs @@ -23,7 +23,17 @@ namespace FarmmapsKPI _farmmapsApiService = farmmapsApiService; _generalService = generalService; } + // zoiets kan ik overwegen als ik de itemtype niet kan vinden + //public async Task CreateTargetKPIItem(Item cropfieldItem) + //{ + // var itemRequest = new ItemRequest() + // { + // ParentCode = cropfieldItem.ParentCode, + // ItemType = USERINPUT_ITEMTYPE, + // Name = "kpi" + // }; + // return await _farmmapsApiService.CreateItemAsync(itemRequest); + //} - } } \ No newline at end of file