Skip to content

CDA-140: Enforce default row limit and validation for AccountingCatalogControl… - #1999

Open
RyanM-RMA wants to merge 2 commits into
USACE:developfrom
RyanM-RMA:bugfix/CDA-140
Open

RyanM-RMA wants to merge 2 commits into
USACE:developfrom
RyanM-RMA:bugfix/CDA-140

Conversation

@RyanM-RMA

@RyanM-RMA RyanM-RMA commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adding check for row limit, changing default to 500, and updating documentation for default row limit of 500.

Related Issue

Closes #1920
Jira Ticket: https://jira.hecdev.net/browse/CDA-140

Validation

I'll be adding another change for integration tests on row limits.

Checklist

  • AI tools used

@RyanM-RMA RyanM-RMA changed the title Enforce default row limit and validation for AccountingCatalogControl… CDA-140: Enforce default row limit and validation for AccountingCatalogControl… Oct 9, 2026
@RyanM-RMA
RyanM-RMA marked this pull request as ready for review October 16, 2026 23:10
@@ -117,7 +118,7 @@ protected WaterSupplyAccountingDao getWaterSupplyAccountingDao(DSLContext dsl) {
@OpenApiParam(name = ASCENDING, description = "Whether or not the entries should be returned "
+ "in ascending order. Defaults to TRUE.", type = Boolean.class),
@OpenApiParam(name = ROW_LIMIT, description = "The maximum number of rows to return. "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we want to use -1 for "no limit" ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's what's used for time series.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We were modelling this behavior off the way turbines and gate changes work. Negative row limit is used to say how many rows before the end date, vs positive row limit where it's how many rows after the start date.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Gates, turbines, and water supply treat the row limit as follows:

  • negative values limit rows off of head
  • positive values limit rows off of tail
  • to not have a row limit, Integer.MAX_VALUE is specified (yes, this is an annoyingly large value).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@MikeNeilson @rma-bryson -- do you have any additional feedback on this PR or can it be approved?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we want to keep the head/tail behavior, I suggest we create additional parameters.

@rma-bryson

Copy link
Copy Markdown
Collaborator

@rma-psmorris - you were going to follow up on this PR with a question in regards to granularity of water supply accounting retrieval being to the pump or contract

@rma-psmorris

Copy link
Copy Markdown
Collaborator

@rma-psmorris - you were going to follow up on this PR with a question in regards to granularity of water supply accounting retrieval being to the pump or contract

Retrieval granularity is to the project, water user, contract. Pump is not included, so accounting retrieved would be all pumps associated with this contract (pump in, pump out, pump out below).

@MikeNeilson MikeNeilson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generally looks reasonable. I just forced a rebase since I merged in #1985, will likely need some minor corrections to imports.

@@ -117,7 +118,7 @@ protected WaterSupplyAccountingDao getWaterSupplyAccountingDao(DSLContext dsl) {
@OpenApiParam(name = ASCENDING, description = "Whether or not the entries should be returned "
+ "in ascending order. Defaults to TRUE.", type = Boolean.class),
@OpenApiParam(name = ROW_LIMIT, description = "The maximum number of rows to return. "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we want to keep the head/tail behavior, I suggest we create additional parameters.

@RyanM-RMA

Copy link
Copy Markdown
Collaborator Author

Generally looks reasonable. I just forced a rebase since I merged in #1985, will likely need some minor corrections to imports.

What additional parameters are you thinking? Also, given that this is the only parameter in the other endpoints, how would we adjust those endpoints to be consistent? Would those endpoints need to be backwards compatible as well?

Also, I'm not sure how to reply to the other comment about creating additional parameters...it doesn't let me quote reply.

This branch has not been deployed

No deployments
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.

[Bug]: Water Supply Accounting catalog endpoint not respecting default row limit

4 participants