Skip to content

Commit 6571774

Browse files
committed
style : add deprecated since
1 parent fd64a60 commit 6571774

File tree

7 files changed

+19
-22
lines changed

7 files changed

+19
-22
lines changed

src/main/java/fr/insee/genesis/domain/model/surveyunit/SurveyUnitModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class SurveyUnitModel {
2727
/**
2828
* @deprecated We will not receive this identifier anymore
2929
*/
30-
@Deprecated(forRemoval = true)
30+
@Deprecated(forRemoval = true, since = "2026-01-01")
3131
private String campaignId;
3232
private String interrogationId;
3333
// New name of idUE

src/main/java/fr/insee/genesis/domain/service/rawdata/RawResponseService.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.util.List;
3737
import java.util.Map;
3838
import java.util.Set;
39+
import java.util.stream.Collectors;
3940

4041
@Service
4142
@Slf4j
@@ -179,7 +180,6 @@ public List<SurveyUnitModel> convertRawResponse(List<RawResponse> rawResponses,
179180
}
180181
}
181182
return surveyUnitModels;
182-
//return List.of();
183183
}
184184

185185
@Override
@@ -195,13 +195,10 @@ public void updateProcessDates(List<SurveyUnitModel> surveyUnitModels) {
195195
}
196196

197197
for (String collectionInstrumentId : collectionInstrumentIds) {
198-
Set<String> interrogationIds = new HashSet<>();
199-
for (SurveyUnitModel surveyUnitModel :
200-
surveyUnitModels.stream().filter(
201-
surveyUnitModel -> surveyUnitModel.getCollectionInstrumentId().equals(collectionInstrumentId)
202-
).toList()) {
203-
interrogationIds.add(surveyUnitModel.getInterrogationId());
204-
}
198+
Set<String> interrogationIds = surveyUnitModels.stream()
199+
.filter(su -> su.getCollectionInstrumentId().equals(collectionInstrumentId))
200+
.map(SurveyUnitModel::getInterrogationId)
201+
.collect(Collectors.toSet());
205202
rawResponsePersistencePort.updateProcessDates(collectionInstrumentId, interrogationIds);
206203
}
207204
}
@@ -218,11 +215,12 @@ private Map<String, Set<String>> getProcessedIdsMap(List<SurveyUnitModel> survey
218215

219216
private void sendProcessedIdsToQualityTool(List<SurveyUnitModel> surveyUnitModels) {
220217
try {
218+
Map<String, Set<String>> processedIdsMap = getProcessedIdsMap(surveyUnitModels);
221219
ResponseEntity<Object> response =
222-
surveyUnitQualityToolPort.sendProcessedIds(getProcessedIdsMap(surveyUnitModels));
220+
surveyUnitQualityToolPort.sendProcessedIds(processedIdsMap);
223221

224222
if (response.getStatusCode().is2xxSuccessful()) {
225-
log.info("Successfully sent {} ids to quality tool", getProcessedIdsMap(surveyUnitModels).size());
223+
log.info("Successfully sent {} ids to quality tool", processedIdsMap.size());
226224
}else{
227225
log.warn("Survey unit quality tool responded non-2xx code {} and body {}",
228226
response.getStatusCode(), response.getBody());
@@ -237,7 +235,7 @@ private static Boolean getIsCapturedIndirectly(RawResponse rawResponse) {
237235
return rawResponse.payload().get("isCapturedIndirectly") == null ? null :
238236
Boolean.parseBoolean(rawResponse.payload().get("isCapturedIndirectly").toString());
239237
}catch(Exception e){
240-
log.warn("Exception when parsing isCapturedIndirectly : {}}",e.toString());
238+
log.warn("Exception when parsing isCapturedIndirectly : {}",e.toString());
241239
return Boolean.FALSE;
242240
}
243241
}
@@ -247,7 +245,7 @@ private static LocalDateTime getValidationDate(RawResponse rawResponse) {
247245
return rawResponse.payload().get("validationDate") == null ? null :
248246
LocalDateTime.parse(rawResponse.payload().get("validationDate").toString());
249247
}catch(Exception e){
250-
log.warn("Exception when parsing validation date : {}}",e.toString());
248+
log.warn("Exception when parsing validation date : {}",e.toString());
251249
return null;
252250
}
253251
}
@@ -340,7 +338,7 @@ private static void convertOneVar(Map.Entry<String, Object> externalVariableEntr
340338

341339
private static String getIdLoop(VariablesMap variablesMap, String variableName) {
342340
if (variablesMap.getVariable(variableName) == null) {
343-
log.warn("Variable {} not present in metadatas, assigning to {}", variableName, Constants.ROOT_GROUP_NAME);
341+
log.warn("Variable {} not present in metadata, assigning to {}", variableName, Constants.ROOT_GROUP_NAME);
344342
return Constants.ROOT_GROUP_NAME;
345343
}
346344
return variablesMap.getVariable(variableName).getGroupName();

src/main/java/fr/insee/genesis/infrastructure/document/contextualexternal/ContextualExternalVariableDocument.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class ContextualExternalVariableDocument {
2222
/**
2323
* @deprecated it will be replaced by collectionInstrumentId
2424
*/
25-
@Deprecated(forRemoval = true)
25+
@Deprecated(forRemoval = true, since = "2026-01-01")
2626
@Indexed
2727
String questionnaireId;
2828
@Indexed

src/main/java/fr/insee/genesis/infrastructure/document/contextualprevious/ContextualPreviousVariableDocument.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class ContextualPreviousVariableDocument {
2121
/**
2222
* @deprecated it will be replaced by collectionInstrumentId
2323
*/
24-
@Deprecated(forRemoval = true)
24+
@Deprecated(forRemoval = true, since = "2026-01-01")
2525
@Indexed
2626
String questionnaireId;
2727
@Indexed

src/main/java/fr/insee/genesis/infrastructure/document/lunaticmodel/LunaticModelDocument.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ I choose to keep the record here (this choice can be challenged)*/
1616
@Builder
1717
@Document(collection = "lunaticmodels")
1818
public record LunaticModelDocument (
19-
20-
@Deprecated
19+
@Deprecated (since = "2026-01-01", forRemoval = true)
2120
@Indexed
2221
String questionnaireId,
2322
@Indexed

src/main/java/fr/insee/genesis/infrastructure/document/metadata/QuestionnaireMetadataDocument.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ I choose to keep the record here (this choice can be challenged)*/
1717
@Document(collection = "questionnaireMetadatas")
1818
public record QuestionnaireMetadataDocument(
1919

20-
@Deprecated
20+
@Deprecated (since = "2026-01-01", forRemoval = true)
2121
@Indexed
2222
String questionnaireId,
2323
@Indexed

src/main/java/fr/insee/genesis/infrastructure/document/surveyunit/SurveyUnitDocument.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ public class SurveyUnitDocument {
2424
/**
2525
* @deprecated This piece of information will not be available anymore in the raw responses
2626
*/
27-
@Deprecated(forRemoval = true)
27+
@Deprecated(forRemoval = true, since ="2026-01-01")
2828
private String campaignId;
2929
@Indexed
3030
private String interrogationId;
3131

3232
/**
3333
* @deprecated It will be replaced by usualSurveyUnitId
3434
*/
35-
@Deprecated(forRemoval = true)
35+
@Deprecated(forRemoval = true, since ="2026-01-01")
3636
private String idUE;
3737

3838
private String usualSurveyUnitId;
3939

4040
/**
4141
* @deprecated It will be replaced by collectionInstrumentId
4242
*/
43-
@Deprecated(forRemoval = true)
43+
@Deprecated(forRemoval = true, since ="2026-01-01")
4444
private String questionnaireId;
4545

4646
private String collectionInstrumentId;

0 commit comments

Comments
 (0)