Skip to content

Conversation

@Hajarel-moukh
Copy link
Contributor

Adds a new endpoint to retrieve combined raw responses and Lunatic JSON raw data by interrogationId.

@alexisszmundy alexisszmundy changed the base branch from main to devFixUsualSurveyUnitId December 23, 2025 10:34
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Rename it to combinedRawDataModel and create a similar DTO classed returned in the controller

List<String> findInterrogationIdByCollectionInstrumentIdAndProcessDateIsNull(String collectionInstrumentId);

@Query(value = "{ 'interrogationId': ?0}")
List<RawResponseDocument> findByInterrogationId(String interrogationId);
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: add "@indexed" to interrogationId in rawResponseDocument

List<LunaticJsonRawDataDocument> findModesByCampaignIdAndByModeAndinterrogationIdIninterrogationIdList(String campaignName, Mode mode, List<String> interrogationIdList);

@Query(value = "{ 'interrogationId': ?0}")
List<LunaticJsonRawDataDocument> findByInterrogationId(String interrogationId);
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: add @indexed to interrogationId in LunaticJsonRawDataDocument

@Slf4j
public class CombinedRawDataService {

@Qualifier("lunaticJsonMongoAdapterNew")
Copy link
Contributor

Choose a reason for hiding this comment

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

note: qualifier is used in the case we have differents beans implementing the same interface, it's not the case here during normal functionning for now but we put it in case we add another implementation.
suggestion: No implem has this qualifier. Rename it to "lunaticJsonMongoAdapter" to correspond with the mongo adapter qualifier

@PreAuthorize("hasAnyRole('ADMIN', 'USER_PLATINE')")
public ResponseEntity<CombinedRawData> getCombinetRawData(
@RequestParam(INTERROGATION_ID) String interrogationId
){CombinedRawData data = combinedRawDataService.getCombinedRawDataByInterrogationId(interrogationId);
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Use a DTO to be sure on what to return

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