Skip to content

feat: add two reprocess endpoints#425

Open
Hajarel-moukh wants to merge 18 commits intomainfrom
devReprocessRawDatas
Open

feat: add two reprocess endpoints#425
Hajarel-moukh wants to merge 18 commits intomainfrom
devReprocessRawDatas

Conversation

@Hajarel-moukh
Copy link
Copy Markdown
Contributor

@Hajarel-moukh Hajarel-moukh commented Mar 10, 2026

Ajout de services de "reprocess" des données brutes vers le format Genesis.

Logique du reprocess

  • récupération des interrogations déjà traitées pour un questionnaire / collection instrument
  • reset des processDate
  • suppression des SurveyUnit correspondantes
  • relance du processRawData derrière

Copy link
Copy Markdown

@nsenave nsenave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quelques commentaires

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wildcard

Copy link
Copy Markdown

@nsenave nsenave Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Je comprends pas ce commentaire : intellij met automatiquement une wildcard à partir d'un certain nombres d'imports d'un même package avec le '"optimize imports".

Si tu trouves que les wildcards sont une mauvaise pratique, on pourrait configurer un prettier sur le projet (autrement on va pas s'embêter à défaire à la main le travail que fait l'ide)

@Override
@Deprecated(since = "1.13.0")
public DataProcessResult processRawData(String campaignName, List<String> interrogationIdList, List<GenesisError> errors) throws GenesisException {
public DataProcessResult processRawData(String questionnaireId, List<String> interrogationIdList, List<GenesisError> errors) throws GenesisException {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: Cette méthode va être supprimée avec le nettoyage

Suggestion: Créer une nouvelle méthode byQuestionnaireId plutôt que modifier une méthode deprecated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est processRawData(String questionnaireId) qu'il faut utiliser c'est ça ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Après avoir passé un peu de temps sur la branche c'est toujours pas clair pour moi quelle méthode utiliser pour appeler le "process" des données Lunatic.

Si on veut reprocess les données Lunatic, il faut avoir la méthode qui process, peut-être qu'elle n'était pas à déprécier finalement ? (autrement dit : si c'est pour copier-coller la méthode avec un nom différent, autant la garder tout simplement ?)

import fr.insee.genesis.domain.model.surveyunit.Mode;
import fr.insee.genesis.domain.model.surveyunit.SurveyUnitModel;
import fr.insee.genesis.domain.model.surveyunit.VariableModel;
import fr.insee.genesis.domain.model.surveyunit.*;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wildcard

import java.util.Map;
import java.util.Set;
import java.time.format.DateTimeFormatter;
import java.util.*;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wildcard

@nsenave nsenave changed the title add two reprocess endpoints feat: add two reprocess endpoints Mar 30, 2026
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB : ici au niveau de l'interface la méthode utilise le nom "collectionInstruementId" et l'implémentation "questionnaireId", en m'appuyant sur le fait que c'est la même propriété, juste renommée dans le modèle filière (cf. les @param dans la javadoc des méthodes)

J'ai fait ce compromis pour avoir du polymorphisme et pas dupliquer le code du reprocess service.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants