-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/2024-6' into release/2024-7
- Loading branch information
Showing
82 changed files
with
4,925 additions
and
822 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...ain/java/se/inera/intyg/webcert/web/csintegration/aggregate/CreateQuestionAggregator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (C) 2024 Inera AB (http://www.inera.se) | ||
* | ||
* This file is part of sklintyg (https://github.com/sklintyg). | ||
* | ||
* sklintyg is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* sklintyg is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package se.inera.intyg.webcert.web.csintegration.aggregate; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import se.inera.intyg.common.support.facade.model.question.Question; | ||
import se.inera.intyg.common.support.facade.model.question.QuestionType; | ||
import se.inera.intyg.webcert.web.csintegration.util.CertificateServiceProfile; | ||
import se.inera.intyg.webcert.web.service.facade.question.CreateQuestionFacadeService; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class CreateQuestionAggregator implements CreateQuestionFacadeService { | ||
|
||
private final CreateQuestionFacadeService createQuestionFromWC; | ||
private final CreateQuestionFacadeService createMessageFromCS; | ||
private final CertificateServiceProfile certificateServiceProfile; | ||
|
||
@Override | ||
public Question create(String certificateId, QuestionType type, String message) { | ||
if (!certificateServiceProfile.active()) { | ||
return createQuestionFromWC.create(certificateId, type, message); | ||
} | ||
|
||
final var responseFromCS = createMessageFromCS.create(certificateId, type, message); | ||
|
||
return responseFromCS != null ? responseFromCS : createQuestionFromWC.create(certificateId, type, message); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...ain/java/se/inera/intyg/webcert/web/csintegration/aggregate/DeleteQuestionAggregator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2024 Inera AB (http://www.inera.se) | ||
* | ||
* This file is part of sklintyg (https://github.com/sklintyg). | ||
* | ||
* sklintyg is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* sklintyg is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package se.inera.intyg.webcert.web.csintegration.aggregate; | ||
|
||
import org.springframework.stereotype.Service; | ||
import se.inera.intyg.webcert.web.csintegration.integration.CSIntegrationService; | ||
import se.inera.intyg.webcert.web.csintegration.util.CertificateServiceProfile; | ||
import se.inera.intyg.webcert.web.service.facade.question.DeleteQuestionFacadeService; | ||
|
||
@Service("deleteQuestionAggregator") | ||
public class DeleteQuestionAggregator implements DeleteQuestionFacadeService { | ||
|
||
private final DeleteQuestionFacadeService deleteQuestionFromWC; | ||
private final DeleteQuestionFacadeService deleteQuestionFromCS; | ||
private final CertificateServiceProfile certificateServiceProfile; | ||
private final CSIntegrationService csIntegrationService; | ||
|
||
public DeleteQuestionAggregator( | ||
DeleteQuestionFacadeService deleteQuestionFromWC, DeleteQuestionFacadeService deleteQuestionFromCS, | ||
CertificateServiceProfile certificateServiceProfile, CSIntegrationService csIntegrationService) { | ||
this.deleteQuestionFromWC = deleteQuestionFromWC; | ||
this.deleteQuestionFromCS = deleteQuestionFromCS; | ||
this.certificateServiceProfile = certificateServiceProfile; | ||
this.csIntegrationService = csIntegrationService; | ||
} | ||
|
||
@Override | ||
public void delete(String questionId) { | ||
if (!certificateServiceProfile.active()) { | ||
deleteQuestionFromWC.delete(questionId); | ||
return; | ||
} | ||
|
||
if (Boolean.TRUE.equals(csIntegrationService.messageExists(questionId))) { | ||
deleteQuestionFromCS.delete(questionId); | ||
return; | ||
} | ||
|
||
deleteQuestionFromWC.delete(questionId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
.../main/java/se/inera/intyg/webcert/web/csintegration/aggregate/SaveQuestionAggregator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (C) 2024 Inera AB (http://www.inera.se) | ||
* | ||
* This file is part of sklintyg (https://github.com/sklintyg). | ||
* | ||
* sklintyg is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* sklintyg is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package se.inera.intyg.webcert.web.csintegration.aggregate; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import se.inera.intyg.common.support.facade.model.question.Question; | ||
import se.inera.intyg.webcert.web.csintegration.util.CertificateServiceProfile; | ||
import se.inera.intyg.webcert.web.service.facade.question.SaveQuestionFacadeService; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class SaveQuestionAggregator implements SaveQuestionFacadeService { | ||
|
||
private final SaveQuestionFacadeService saveQuestionFromWC; | ||
private final SaveQuestionFacadeService saveMessageFromCS; | ||
private final CertificateServiceProfile certificateServiceProfile; | ||
|
||
@Override | ||
public Question save(Question question) { | ||
if (!certificateServiceProfile.active()) { | ||
return saveQuestionFromWC.save(question); | ||
} | ||
|
||
final var responseFromCS = saveMessageFromCS.save(question); | ||
|
||
return responseFromCS != null ? responseFromCS : saveQuestionFromWC.save(question); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
.../main/java/se/inera/intyg/webcert/web/csintegration/aggregate/SendQuestionAggregator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (C) 2024 Inera AB (http://www.inera.se) | ||
* | ||
* This file is part of sklintyg (https://github.com/sklintyg). | ||
* | ||
* sklintyg is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* sklintyg is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package se.inera.intyg.webcert.web.csintegration.aggregate; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import se.inera.intyg.common.support.facade.model.question.Question; | ||
import se.inera.intyg.webcert.web.csintegration.util.CertificateServiceProfile; | ||
import se.inera.intyg.webcert.web.service.facade.question.SendQuestionFacadeService; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class SendQuestionAggregator implements SendQuestionFacadeService { | ||
|
||
private final SendQuestionFacadeService sendQuestionFromWC; | ||
private final SendQuestionFacadeService sendMessageFromCS; | ||
private final CertificateServiceProfile certificateServiceProfile; | ||
|
||
@Override | ||
public Question send(Question question) { | ||
if (!certificateServiceProfile.active()) { | ||
return sendQuestionFromWC.send(question); | ||
} | ||
|
||
final var responseFromCS = sendMessageFromCS.send(question); | ||
|
||
return responseFromCS != null ? responseFromCS : sendQuestionFromWC.send(question); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.