-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DSND-3113: Change delete operation order for pscs, add kind and delta…
…_at logic (strict) (#157) * DSND-3113: WIP - Adds kind property to the delete PSC delta Requires changes to use the `kind` argument from the DELETE request header * DSND-3113: WIP Implement Kind logic for delete deltas * kind logic for upsert is very different from for delete. * implemented kind logic coming from delta instead of being retrieved from mongo * implemented kind and delta_at headers within controller method * implemented delta_at check similar to filing history * fixed all compilation errors * DSND-3113: Implement chs-kafka-api call and fix any remaining test cases. * add needed exclusions to pom for test functionality * made kind variables more accurate across the project * added logic for even if document deleted chs-kafka is still called * added additional tests for kind and fixed any existing broken ones * DSND-3113: Unused imports and wildcard imports fixed. * DSND-3113: Address PR comments * DSND-3113: Upgrade versions in Pom * DSND-3113: Revert spring boot upgrade in the Pom * DSND-3113: Upgrade sdk version in pom to enable header handlers for kind and delta_at * DSND-3113: Address PR comments 2 * DSND-3113: Add additional iTest class for deltaAt conflict test case * DSND-3113: Upgrade springboot versions appropriately * DSND-3113: Address PR comment * use handmade exception * add unit testcase for deltaAt check * DSND-3113: Add ExceptionHandlerConfig case and relevant testcases * DSND-3113: Remove catch statement in the controller * DSND-3113: Address PR comment * some small test name changes * DSND-3113: Address PR comment * test name changes * string concatenation --------- Co-authored-by: johncookch <[email protected]>
- Loading branch information
1 parent
b807c82
commit 8b250dd
Showing
19 changed files
with
542 additions
and
182 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
234 changes: 156 additions & 78 deletions
234
src/itest/java/uk/gov/companieshouse/pscdataapi/steps/PscDataSteps.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
1 change: 0 additions & 1 deletion
1
...n/java/uk/gov/companieshouse/pscdataapi/controller/CompanyPscFullRecordGetController.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
8 changes: 8 additions & 0 deletions
8
src/main/java/uk/gov/companieshouse/pscdataapi/exceptions/ConflictException.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,8 @@ | ||
package uk.gov.companieshouse.pscdataapi.exceptions; | ||
|
||
public class ConflictException extends RuntimeException { | ||
|
||
public ConflictException(String message) { | ||
super(message); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/uk/gov/companieshouse/pscdataapi/models/PscDeleteRequest.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 @@ | ||
package uk.gov.companieshouse.pscdataapi.models; | ||
|
||
public record PscDeleteRequest (String companyNumber, String notificationId, String contextId, String kind, String deltaAt) { | ||
|
||
public static Builder builder() { return new Builder(); } | ||
|
||
public static final class Builder { | ||
|
||
private String companyNumber; | ||
private String notificationId; | ||
private String contextId; | ||
private String kind; | ||
private String deltaAt; | ||
|
||
private Builder() { | ||
} | ||
|
||
public Builder companyNumber(String companyNumber) { | ||
this.companyNumber = companyNumber; | ||
return this; | ||
} | ||
|
||
public Builder notificationId(String notificationId) { | ||
this.notificationId = notificationId; | ||
return this; | ||
} | ||
|
||
public Builder contextId(String contextId) { | ||
this.contextId = contextId; | ||
return this; | ||
} | ||
|
||
public Builder kind(String kind) { | ||
this.kind = kind; | ||
return this; | ||
} | ||
|
||
public Builder deltaAt(String deltaAt) { | ||
this.deltaAt = deltaAt; | ||
return this; | ||
} | ||
|
||
public PscDeleteRequest build() { | ||
return new PscDeleteRequest(companyNumber, notificationId, contextId, kind, deltaAt); | ||
} | ||
} | ||
} |
Oops, something went wrong.