Skip to content

Commit

Permalink
refactor rule effects to kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
enricocolasante committed Dec 6, 2023
1 parent cfeccb0 commit acb01d5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 30 deletions.
12 changes: 0 additions & 12 deletions src/main/java/org/hisp/dhis/rules/models/RuleEffect.java

This file was deleted.

18 changes: 18 additions & 0 deletions src/main/java/org/hisp/dhis/rules/models/RuleEffect.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.hisp.dhis.rules.models

import javax.annotation.Nonnull

data class RuleEffect(
val ruleId: String,
val ruleAction: RuleAction,
val data: String = ""
)
{
fun data() : String {
return data
}

fun ruleAction() : RuleAction {
return ruleAction
}
}
18 changes: 0 additions & 18 deletions src/main/java/org/hisp/dhis/rules/models/RuleEffects.java

This file was deleted.

19 changes: 19 additions & 0 deletions src/main/java/org/hisp/dhis/rules/models/RuleEffects.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.hisp.dhis.rules.models
data class RuleEffects(
val trackerObjectType: TrackerObjectType,
val trackerObjectUid: String,
val ruleEffects: List<RuleEffect>
) {
val isEnrollment: Boolean
get() = trackerObjectType == TrackerObjectType.ENROLLMENT
val isEvent: Boolean
get() = trackerObjectType == TrackerObjectType.EVENT

fun ruleEffects(): List<RuleEffect> {
return ruleEffects
}

fun trackerObjectUid(): String {
return trackerObjectUid
}
}

0 comments on commit acb01d5

Please sign in to comment.