-
Notifications
You must be signed in to change notification settings - Fork 17
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
fix: Use createDate as secundary order param [DHIS2-18093] #139
Conversation
val value = currentEventValues[field] | ||
val optionValue = if (useCodeForOptionSet) value!!.value else getOptionName(value!!.value)!! | ||
RuleVariableValue( | ||
fieldType, optionValue, | ||
listOf(optionValue), getLastUpdateDate(listOf(value)) | ||
) | ||
listOf(optionValue), ruleEvent!!.eventDate.toLocalDateTime(TimeZone.currentSystemDefault()).date.toString()) |
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.
Just a comment, not necessarily something to change now. In general, I will try to avoid the use of !!
because it just throws a NPE without any other information. Something such as
requireNotNull(ruleEvent) { "Event must not be null in CurrentEvent variables" }
might be more meaningful.
I would say the right version should be |
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 don't know enough about RE to judge the semantics of this change but on the code level this looks good 👍
I would go with |
About format plugins, the android sdk uses two plugins that could be easily added in this repo, not necessarily both of them (actually they overlap a little bit):
|
eventDate
andprogramStage
fields fromRuleDataValue
. These values are deduced fromRuleEvent
createdDate
field inRuleEvent
.Refactor
RuleVariableValueMapBuilder
to remove most ofMutableMap
s and!!
operator.@vgarciabnz Would be difficult to add a formatted plugin to the repository?
The correct version should be
3.1.0
? As we introduced breaking changes?