Skip to content
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

CTO-118 Updated Gate Change Controller and DAO #904

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

zack-rma
Copy link
Collaborator

@zack-rma zack-rma commented Oct 7, 2024

Updated Gate Change Controller and DAO to support operation changes store/delete functionality

Copy link
Contributor

@MikeNeilson MikeNeilson left a comment

Choose a reason for hiding this comment

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

Generally looks good. Some changes for clarity required.

CWMS_OUTLET_PACKAGE.call_DELETE_OUTLET(DSL.using(conn).configuration(), locationId,
deleteRule.getRule(), officeId);
} catch (IntegrityConstraintViolationException e) {
throw new NotFoundException(e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not found doesn't make sense given the parent exception. 409 Conflict https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409 makes more sense.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Swapped for a DeleteConflictException. The error code received by HCDA isn't the most useful, ("Data already exists for this request"). Maybe there's another exception that will provide more detail?

Copy link
Contributor

Choose a reason for hiding this comment

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

It should send basically what the constraint is "something depends on it." We'll have to look into that later.

@@ -199,6 +199,7 @@ static GateChange buildTestGateChange(CwmsId projectId, Instant changeDate, Gate
.withNotes(notes)
.withChangeDate(changeDate)
.withSettings(settings)
// .withType("gate-change")
Copy link
Contributor

Choose a reason for hiding this comment

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

Either delete if not needed, or provide explanation of why it's sitting here commented out (in the comment itself.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Deleted unnecessary comment

"type" : "gate-change",
"project-id" : {
"office-id" : "SPK",
"name" : "PROJECT1"
Copy link
Contributor

Choose a reason for hiding this comment

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

use a "real" project name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Swapped for a project name used in other Outlet testing

"type" : "gate-setting",
"location-id" : {
"office-id" : "SPK",
"name" : "PROJECT1-CG100"
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above comment, use a "real" name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Swapped for a project name used in other Outlet testing

@MikeNeilson
Copy link
Contributor

There are failing tests, but they look unrelated to this PR so I'm merging in anyways.

@MikeNeilson MikeNeilson merged commit 2d9877f into USACE:develop Oct 8, 2024
4 of 5 checks passed
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.

2 participants