-
Notifications
You must be signed in to change notification settings - Fork 5
[SNI-8773] update bundle logic for further documents #2487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
be244b5
[SNI-8773] update bundle logic for further documents
oleon23 564db19
Merge branch 'master' into SNI-8773
oleon23 2372296
[SNI-8773] fix checkstyle test
oleon23 6478065
Merge remote-tracking branch 'origin/SNI-8773' into SNI-8773
oleon23 6b9b2c4
[SNI-8773] temporarily ignore IT
oleon23 92b1bf4
add label check for ccd diff
oleon23 f795f25
[SNI-8773] fix checkstyle IT
oleon23 3d5d688
[SNI-8773] fix tests
oleon23 85c31c8
[SNI-8773] fix checkstyle test
oleon23 eb09ae2
edit ccd-diff.yml
oleon23 ed79664
[SNI-8773] temp fix tests
oleon23 ed1a137
Merge branch 'master' into SNI-8773
oleon23 dddadf9
[SNI-8773] update unit tests for further docs uploaded
oleon23 f032517
Merge remote-tracking branch 'origin/SNI-8773' into SNI-8773
oleon23 8ccc27a
[SNI-8773] test minor updates
oleon23 a377f80
[SNI-8773] fix checkstyle test
oleon23 bb28d22
Merge branch 'refs/heads/master' into SNI-8773
oleon23 3153ed4
[SNI-8773] revert back to document lists instead of dates
oleon23 eb753ca
[SNI-8773] update tests
oleon23 1b0666d
Merge branch 'master' into SNI-8773
oleon23 8668765
[SNI-8773] ensure further documents are sorted
oleon23 5d56732
Merge remote-tracking branch 'origin/SNI-8773' into SNI-8773
oleon23 48d93a7
[SNI-8773] update comments
oleon23 297861b
[SNI-8773] add task for cron to migrate data, revert field rename
oleon23 bb48462
[SNI-8773] add new tests for CaseEventRepository
oleon23 eacb9d6
[SNI-8773] fix checkstyleTest
oleon23 60b37d8
[SNI-8773] add system task/event tests
oleon23 a3bee3a
Merge branch 'master' into SNI-8773
oleon23 3069cb5
Merge branch 'master' into SNI-8773
oleon23 be27284
Merge branch 'master' into SNI-8773
oleon23 eff6f1a
[SNI-8773] Update event to be component and adjust naming (less than …
oleon23 85850de
[SNI-8773] Update event migration query to use date range
oleon23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
src/main/java/uk/gov/hmcts/sptribs/systemupdate/event/SystemMigrateInitialCaseDocuments.java
This file contains hidden or 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 @@ | ||
| package uk.gov.hmcts.sptribs.systemupdate.event; | ||
|
|
||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.stereotype.Component; | ||
| import uk.gov.hmcts.ccd.sdk.api.CCDConfig; | ||
| import uk.gov.hmcts.ccd.sdk.api.CaseDetails; | ||
| import uk.gov.hmcts.ccd.sdk.api.ConfigBuilder; | ||
| import uk.gov.hmcts.ccd.sdk.api.callback.AboutToStartOrSubmitResponse; | ||
| import uk.gov.hmcts.sptribs.ciccase.model.CaseData; | ||
| import uk.gov.hmcts.sptribs.ciccase.model.State; | ||
| import uk.gov.hmcts.sptribs.ciccase.model.UserRole; | ||
| import uk.gov.hmcts.sptribs.common.service.CaseDataRestoreService; | ||
|
|
||
| import static uk.gov.hmcts.sptribs.ciccase.model.UserRole.SYSTEM_UPDATE; | ||
| import static uk.gov.hmcts.sptribs.ciccase.model.access.Permissions.CREATE_READ_UPDATE_DELETE; | ||
|
|
||
| @RequiredArgsConstructor | ||
| @Component | ||
| public class SystemMigrateInitialCaseDocuments implements CCDConfig<CaseData, State, UserRole> { | ||
| public static final String SYSTEM_MIGRATE_INITIAL_CASE_DOCUMENTS = "migrate-initial-case-documents"; | ||
|
|
||
| private final CaseDataRestoreService caseDataRestoreService; | ||
|
|
||
| @Override | ||
| public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) { | ||
| configBuilder | ||
| .event(SYSTEM_MIGRATE_INITIAL_CASE_DOCUMENTS) | ||
| .forAllStates() | ||
| .name("System: Migrate initial docs") | ||
| .description("Migrate ") | ||
| .aboutToSubmitCallback(this::aboutToSubmit) | ||
| .grant(CREATE_READ_UPDATE_DELETE, SYSTEM_UPDATE); | ||
| } | ||
|
|
||
| public AboutToStartOrSubmitResponse<CaseData, State> aboutToSubmit(CaseDetails<CaseData, State> caseDetails, | ||
| CaseDetails<CaseData, State> beforeDetails) { | ||
| CaseData caseData = caseDetails.getData(); | ||
| Long reference = caseDetails.getId(); | ||
|
|
||
| caseDataRestoreService.updateInitialCaseDocuments(reference, caseData); | ||
|
|
||
| return AboutToStartOrSubmitResponse.<CaseData, State>builder() | ||
| .data(caseData) | ||
| .build(); | ||
| } | ||
| } |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.