-
Notifications
You must be signed in to change notification settings - Fork 14
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
Water Supply Accounting DTO #800
base: develop
Are you sure you want to change the base?
Water Supply Accounting DTO #800
Conversation
703dc80
to
e9f2cf9
Compare
13a2e8a
to
5ac239a
Compare
bc4642b
to
e8e85ba
Compare
…table tags to water user
…on ID input parameter
e7f8914
to
950e791
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback on code, mainly about how accounting needs to scale and is a time series.
private final String contractName; | ||
@JsonProperty(required = true) | ||
private final WaterUser waterUser; | ||
private final List<PumpAccounting> pumpAccounting; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This data structure should be better defined. It should account for the different pumps and then the accounting times for a given pump. It should be able to easily answer without doing a full list scan whether a given pump has accounting, and what the given pump's start and end times are for the accounting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restructured for less repeated data and better scaling
}, | ||
"water-right": "Test Water Right" | ||
}, | ||
"pump-accounting": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a lot of repeated data here w/in the pump accounting JSON. Accounting is a time series, and this portion of the data structure will need to scale.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrote for better scaling
"transfer-date": 10000012648000, | ||
"comment": "Test Comment" | ||
}, | ||
"2286-11-20T21:17:29Z": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between this date, "2286-11-20T21:17:29Z": { and the value in "transfer-date". Also, I'm not sure if these dates resolve down to the second w/in the database. You should check that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dates are the same - it's duplicate data. It should be removed in the next iteration of the DTO based on the timeseries-style JSON format currently being tested
@JsonProperty(required = true) | ||
private final CwmsId pumpLocation; | ||
@JsonProperty(required = true) | ||
private final Map<Instant, PumpTransfer> pumpTransfers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid repeated dates, you could drop this date (stop using a Map) and use a navigable set with a comparator on the pump transfer date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll consider doing that with the new DTO structure.
Implements Water Supply Accounting DTO with tests