File tree 1 file changed +9
-6
lines changed
form-flow/src/main/kotlin/com/ritense/formflow/domain/definition/configuration
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ data class FormFlowStep(
46
46
if (key != other.id.key) return false
47
47
if (title != other.title) return false
48
48
49
+ val nextSteps = getAllNextSteps()
49
50
if (nextSteps.size != other.nextSteps.size) return false
50
51
if (nextSteps.any { nextStep ->
51
52
other.nextSteps.none { otherNextStep ->
@@ -62,12 +63,7 @@ data class FormFlowStep(
62
63
}
63
64
64
65
fun toDefinition (): FormFlowStepEntity {
65
- val nextSteps =
66
- if (this .nextStep != null )
67
- listOf (FormFlowNextStep (step = this .nextStep).toDefinition())
68
- else
69
- this .nextSteps.map(FormFlowNextStep ::toDefinition)
70
-
66
+ val nextSteps = getAllNextSteps().map(FormFlowNextStep ::toDefinition)
71
67
72
68
return FormFlowStepEntity (
73
69
FormFlowStepId .create(key),
@@ -80,6 +76,13 @@ data class FormFlowStep(
80
76
)
81
77
}
82
78
79
+ private fun getAllNextSteps (): List <FormFlowNextStep > {
80
+ return if (this .nextStep != null )
81
+ listOf (FormFlowNextStep (step = this .nextStep))
82
+ else
83
+ this .nextSteps
84
+ }
85
+
83
86
companion object {
84
87
fun fromEntity (entity : FormFlowStepEntity ): FormFlowStep {
85
88
return FormFlowStep (
You can’t perform that action at this time.
0 commit comments