dzhw / zofar

10 stars 1 forks source link

calendar: functions for evaluate calendar and JSON Array #505

Closed andreaschu closed 1 year ago

andreaschu commented 2 years ago

As researcher I need some additional functions to evaluate the JSON Array for transition and plausible checks.

andreaschu commented 2 years ago

edit christian-fr: Können wir damit schon nach vorhandenen Flags sortieren? Testcases fehlen noch. Review fehlt.

edit christian-fr: Ist als overlapEpisodeWithArray() implementiert. Testcases sind eingebaut und aktiv. Review fehlt.

christian-fr commented 2 years ago
  • [x] Episode bestimmten Typs vorhanden ja/nein

    • zofar.hasEpisodes()

    • episodePresent(JSON_ARRAY, {"type":"NSET"}) --> bool ~ -> UnitTest fehlt noch

christian-fr commented 2 years ago
* [ ]  Episode eines bestimmten Typs unter Zusatzbedingungen vorhanden ja/nein
  ~>>returns bool~
  ~episodePresent(~
  --> Array of Filter-Maps: [{},{},{}] verodert --> nochmal checken, ob der Funktionsumfang derzeit schon gegeben ist

* zofar.hasEpisodes()

  * Flags noch ergänzen
    -> UnitTest fehlt noch
christian-fr commented 2 years ago
* [ ]  Maximum/Minimum eines Datums einer Episode bestimmten Typs unter Zusatzbedingungen; bspw. Minimum des Abschlussdatums wenn Episodentyp Studium und Studium abgeschlossen
  rangeMin / rangeMax als Plausibilierung (oder Ähnliches, wenn wir etwas Besseres finden)
  minValue(JSON_ARRAY, [{},{},{}], "PROPERTY/KEY", "rangeMin"="2020-...", "rangeMax"="2022..") -> minimum value
  maxValue(JSON_ARRAY, [{},{},{}], "PROPERTY/KEY", "rangeMin"="2020-...", "rangeMax"="2022..") -> maximum value
  ```
   Bsp.:
   minValue(json_array, [{"type": "NSET"}], "startDate") -> "2018-01..."
  ```
  --> Entwurf ist vorhanden, muss getestet und integriert werden
  -> UnitTest fehlt noch
christian-fr commented 2 years ago
* [ ]  Abgleich eines Datums in einer Episode mit einem anderen Datum; Bspw. Enddatum==Exitdatum
  ~--> hier evtl auch noch eine proximity-range (+/-)~
  -> JSONequals(JSON_ARRAY, index1, index2, "PROPERTY/KEY1", "PROPERTY/KEY2")
  -> return:
  -1 Val1  < Val2
  0 Val1 == Val2
  +1 Val1  > Val2
  -> Konzeption und Implementation steht noch aus
  -> UnitTest fehlt noch
christian-fr commented 2 years ago
* [ ]  Überlappung einer Episode mit einem (gefilterten) JSON_ARRAY -> bool
  -> Array filtern
  -> aktuelle Episode ggf. aus dem Array entfernen
  -> Überlappung bestimmen
  -> return true/false
  ==> Kommunikation ans Projekt: bei allen boolschen Funktionen ist "false" der default-Rückgabewerte bei Fehlern etc.
  ~ overlap(JSON_ARRAY, index, [{"type":"NSET", "state":"done"}]) -> bool ~
  ~ overlap(JSON_ARRAY, filter1=[{"type":"NSET", "state":"done"}], filter2=[{"type":"STUD", "state":"done"}]) -> bool ~
  ~-> keine Episode doppelt~
  -> Konzeption und Implementation steht noch aus
  • [x] implementiert als overlapEpisodeWithArray() --> hier auch Calendar() nutzen, refactoring
  • [x] test cases
  • [x] code review
andreaschu commented 1 year ago

Sind alle integriert und sollten funktionieren.