diff --git a/.gitignore b/.gitignore
index ad28b8c..a938efe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,3 +46,4 @@ hs_err_pid*
# test generated files
src/test/resources/OUT/*
/src/test/resources/DONE/*
+/src/test/resources/genesis_deleted_schedules/*
diff --git a/pom.xml b/pom.xml
index aeaec8a..f667512 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,7 +18,7 @@
21
2.6.0
1.6.2
- 7.19.0
+ 7.20.0
0.8.12
jacoco
@@ -98,6 +98,11 @@
jackson-databind
${jackson.version}
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ ${jackson.version}
+
diff --git a/src/main/java/fr/insee/genesis/Constants.java b/src/main/java/fr/insee/genesis/Constants.java
index 73ab856..f1711c2 100644
--- a/src/main/java/fr/insee/genesis/Constants.java
+++ b/src/main/java/fr/insee/genesis/Constants.java
@@ -11,6 +11,8 @@ public class Constants {
public static final String FILTER_RESULT_PREFIX = "FILTER_RESULT_";
public static final String MISSING_SUFFIX = "_MISSING";
private static final String[] ENO_VARIABLES = {"COMMENT_QE","COMMENT_UE","HEURE_REMPL","MIN_REMPL"};
+
+ public static final String MONGODB_SCHEDULE_COLLECTION_NAME = "schedules";
public static final String LOOP_NAME_PREFIX = "BOUCLE";
public static final String MONGODB_RESPONSE_COLLECTION_NAME = "responses";
public static final String VOLUMETRY_FOLDER_NAME = "genesis_volumetries";
@@ -18,6 +20,8 @@ public class Constants {
public static final String VOLUMETRY_FILE_DATE_FORMAT = "yyyy_MM_dd";
public static final int VOLUMETRY_FILE_EXPIRATION_DAYS = 30;
+ public static final String SCHEDULE_ARCHIVE_FOLDER_NAME = "genesis_deleted_schedules";
+
// XML sequential reading parameters
public static final int MAX_FILE_SIZE_UNTIL_SEQUENTIAL = 200; // In megabytes
diff --git a/src/main/java/fr/insee/genesis/controller/rest/ScheduleController.java b/src/main/java/fr/insee/genesis/controller/rest/ScheduleController.java
index ba7d637..d36effc 100644
--- a/src/main/java/fr/insee/genesis/controller/rest/ScheduleController.java
+++ b/src/main/java/fr/insee/genesis/controller/rest/ScheduleController.java
@@ -1,6 +1,9 @@
package fr.insee.genesis.controller.rest;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import fr.insee.genesis.Constants;
+import fr.insee.genesis.domain.model.schedule.KraftwerkExecutionSchedule;
import fr.insee.genesis.domain.model.schedule.ScheduleModel;
import fr.insee.genesis.domain.model.schedule.ServiceToCall;
import fr.insee.genesis.domain.model.schedule.TrustParameters;
@@ -22,8 +25,14 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
import java.time.LocalDateTime;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
@RequestMapping(path = "/schedule")
@Controller
@@ -75,11 +84,19 @@ public ResponseEntity