Dev/combined rawdata#367
Conversation
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
todo: add @indexed to interrogationId in LunaticJsonRawDataDocument
| @Slf4j | ||
| public class CombinedRawDataService { | ||
|
|
||
| @Qualifier("lunaticJsonMongoAdapterNew") |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
suggestion: Use a DTO to be sure on what to return
| private static final String INTERROGATION_ID = "interrogationId"; | ||
| private final CombinedRawDataService combinedRawDataService; | ||
|
|
||
| public CombinedRawDataController(CombinedRawDataService combinedRawDataService) { |
| @Qualifier("rawResponseMongoAdapter") | ||
| private final RawResponsePersistencePort rawResponsePersistencePort; | ||
|
|
||
| public CombinedRawDataService(LunaticJsonRawDataPersistencePort lunaticJsonRawDataPersistencePort, RawResponsePersistencePort rawResponsePersistencePort) { |
Adds a new endpoint to retrieve combined raw responses and Lunatic JSON raw data by interrogationId.