diff --git a/ktx-radix-adapter/ktx-radix-adapter-shared/pom.xml b/ktx-radix-adapter/ktx-radix-adapter-shared/pom.xml index 43442e3..1e842f3 100644 --- a/ktx-radix-adapter/ktx-radix-adapter-shared/pom.xml +++ b/ktx-radix-adapter/ktx-radix-adapter-shared/pom.xml @@ -5,7 +5,7 @@ ktx-radix-adapter io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-adapter/pom.xml b/ktx-radix-adapter/pom.xml index 4d84940..1397559 100644 --- a/ktx-radix-adapter/pom.xml +++ b/ktx-radix-adapter/pom.xml @@ -5,7 +5,7 @@ ktx-radix io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-dependencies/pom.xml b/ktx-radix-dependencies/pom.xml index 962ff9b..e3dd076 100644 --- a/ktx-radix-dependencies/pom.xml +++ b/ktx-radix-dependencies/pom.xml @@ -5,7 +5,7 @@ ktx-radix io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 pom diff --git a/ktx-radix-development/ktx-radix-development-identity/pom.xml b/ktx-radix-development/ktx-radix-development-identity/pom.xml index 53076fb..1a6c30c 100644 --- a/ktx-radix-development/ktx-radix-development-identity/pom.xml +++ b/ktx-radix-development/ktx-radix-development-identity/pom.xml @@ -5,7 +5,7 @@ ktx-radix-development io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-development/ktx-radix-development-operation/pom.xml b/ktx-radix-development/ktx-radix-development-operation/pom.xml index ea41d59..e6d1951 100644 --- a/ktx-radix-development/ktx-radix-development-operation/pom.xml +++ b/ktx-radix-development/ktx-radix-development-operation/pom.xml @@ -5,7 +5,7 @@ ktx-radix-development io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-development/ktx-radix-development-operation/src/main/java/io/quee/ktx/radix/develop/operation/operation-definition.kt b/ktx-radix-development/ktx-radix-development-operation/src/main/java/io/quee/ktx/radix/develop/operation/operation-definition.kt index 37c6ae0..e030db0 100644 --- a/ktx-radix-development/ktx-radix-development-operation/src/main/java/io/quee/ktx/radix/develop/operation/operation-definition.kt +++ b/ktx-radix-development/ktx-radix-development-operation/src/main/java/io/quee/ktx/radix/develop/operation/operation-definition.kt @@ -17,19 +17,20 @@ interface Operator { fun RQ.operate(response: RS) } -infix fun Operation.operationBuilder( +infix fun Operation.runOperation(request: RQ) = request.operate() + +fun operationBuilder( builder: OperationBuilder.() -> Unit, ): Operation = - OperationBuilder(this) + OperationBuilder() .apply { builder() } -class OperationBuilder( - private val mainOperation: Operation, -) : Operation { +class OperationBuilder : Operation { private val roles: MutableList> = mutableListOf() private val afterOperators: MutableList> = mutableListOf() + private lateinit var mainOperation: Operation private fun RQ.before() = roles.forEach { it.run { operateRole() } } @@ -46,6 +47,10 @@ class OperationBuilder( this.afterOperators.add(operator) } + infix fun mainOperation(operation: Operation) { + this.mainOperation = operation + } + infix fun after(operator: RQ.(RS) -> Unit) { this.afterOperators.add(object : Operator { override fun RQ.operate(response: RS) { diff --git a/ktx-radix-development/ktx-radix-development-shared/pom.xml b/ktx-radix-development/ktx-radix-development-shared/pom.xml index 9c6e170..f68bfdb 100644 --- a/ktx-radix-development/ktx-radix-development-shared/pom.xml +++ b/ktx-radix-development/ktx-radix-development-shared/pom.xml @@ -5,7 +5,7 @@ ktx-radix-development io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-development/ktx-radix-development-store/pom.xml b/ktx-radix-development/ktx-radix-development-store/pom.xml index b1d07d1..3a7609d 100644 --- a/ktx-radix-development/ktx-radix-development-store/pom.xml +++ b/ktx-radix-development/ktx-radix-development-store/pom.xml @@ -5,7 +5,7 @@ ktx-radix-development io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-development/ktx-radix-development-usecase-action/pom.xml b/ktx-radix-development/ktx-radix-development-usecase-action/pom.xml index b6c5ff3..63bdfba 100644 --- a/ktx-radix-development/ktx-radix-development-usecase-action/pom.xml +++ b/ktx-radix-development/ktx-radix-development-usecase-action/pom.xml @@ -5,7 +5,7 @@ ktx-radix-development io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-development/ktx-radix-development-usecase-adapter/pom.xml b/ktx-radix-development/ktx-radix-development-usecase-adapter/pom.xml index 8f65745..4c3f819 100644 --- a/ktx-radix-development/ktx-radix-development-usecase-adapter/pom.xml +++ b/ktx-radix-development/ktx-radix-development-usecase-adapter/pom.xml @@ -5,7 +5,7 @@ ktx-radix-development io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-development/ktx-radix-development-usecase-ext/pom.xml b/ktx-radix-development/ktx-radix-development-usecase-ext/pom.xml index 865c541..9e935df 100644 --- a/ktx-radix-development/ktx-radix-development-usecase-ext/pom.xml +++ b/ktx-radix-development/ktx-radix-development-usecase-ext/pom.xml @@ -5,7 +5,7 @@ ktx-radix-development io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 @@ -17,5 +17,10 @@ ktx-radix-development-usecase-validation ${project.parent.version} + + ${project.parent.groupId} + ktx-radix-development-operation + ${project.parent.version} + \ No newline at end of file diff --git a/ktx-radix-development/ktx-radix-development-usecase-ext/src/main/java/io/quee/ktx/radix/develop/usecase/opration-usecase-ext.kt b/ktx-radix-development/ktx-radix-development-usecase-ext/src/main/java/io/quee/ktx/radix/develop/usecase/opration-usecase-ext.kt new file mode 100644 index 0000000..c407d83 --- /dev/null +++ b/ktx-radix-development/ktx-radix-development-usecase-ext/src/main/java/io/quee/ktx/radix/develop/usecase/opration-usecase-ext.kt @@ -0,0 +1,26 @@ +package io.quee.ktx.radix.develop.usecase + +import io.quee.ktx.radix.develop.operation.Operation +import io.quee.ktx.radix.develop.usecase.model.UseCaseRequest +import io.quee.ktx.radix.develop.usecase.model.UseCaseResponse + +/** + * Created By [*Ibrahim Al-Tamimi *](https://www.linkedin.com/in/iloom/) + * Created At 28, **Sun February, 2021** + * Project *ktx-radix* [Quee.IO] + */ +fun FunctionalUseCase.toOperation(): Operation = + UseCaseOperation { + process() + } + +fun CommandUseCase.toOperation(): Operation = + UseCaseOperation { + execute() + } + +private class UseCaseOperation( + private val function: RQ.() -> RS, +) : Operation { + override fun RQ.operate() = function() +} \ No newline at end of file diff --git a/ktx-radix-development/ktx-radix-development-usecase-reactive/pom.xml b/ktx-radix-development/ktx-radix-development-usecase-reactive/pom.xml index 527de48..c27ed80 100644 --- a/ktx-radix-development/ktx-radix-development-usecase-reactive/pom.xml +++ b/ktx-radix-development/ktx-radix-development-usecase-reactive/pom.xml @@ -5,7 +5,7 @@ ktx-radix-development io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-development/ktx-radix-development-usecase-validation/pom.xml b/ktx-radix-development/ktx-radix-development-usecase-validation/pom.xml index dc40264..6ad009f 100644 --- a/ktx-radix-development/ktx-radix-development-usecase-validation/pom.xml +++ b/ktx-radix-development/ktx-radix-development-usecase-validation/pom.xml @@ -5,7 +5,7 @@ ktx-radix-development io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-development/ktx-radix-development-usecase/pom.xml b/ktx-radix-development/ktx-radix-development-usecase/pom.xml index 016c5ed..21cb60e 100644 --- a/ktx-radix-development/ktx-radix-development-usecase/pom.xml +++ b/ktx-radix-development/ktx-radix-development-usecase/pom.xml @@ -5,7 +5,7 @@ ktx-radix-development io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-development/pom.xml b/ktx-radix-development/pom.xml index fd55d9d..3e454c9 100644 --- a/ktx-radix-development/pom.xml +++ b/ktx-radix-development/pom.xml @@ -5,7 +5,7 @@ ktx-radix io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-port/ktx-radix-port-logger/pom.xml b/ktx-radix-port/ktx-radix-port-logger/pom.xml index aa75a1f..5eabcbc 100644 --- a/ktx-radix-port/ktx-radix-port-logger/pom.xml +++ b/ktx-radix-port/ktx-radix-port-logger/pom.xml @@ -5,7 +5,7 @@ ktx-radix-port io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-port/pom.xml b/ktx-radix-port/pom.xml index d6fcd4c..dbdf609 100644 --- a/ktx-radix-port/pom.xml +++ b/ktx-radix-port/pom.xml @@ -5,7 +5,7 @@ ktx-radix io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-starter/ktx-radix-starter-logger-webflux/pom.xml b/ktx-radix-starter/ktx-radix-starter-logger-webflux/pom.xml index 6eb77ec..86d7c4d 100644 --- a/ktx-radix-starter/ktx-radix-starter-logger-webflux/pom.xml +++ b/ktx-radix-starter/ktx-radix-starter-logger-webflux/pom.xml @@ -5,7 +5,7 @@ ktx-radix-starter io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-starter/ktx-radix-starter-logger/pom.xml b/ktx-radix-starter/ktx-radix-starter-logger/pom.xml index f6b92f3..4dcf62e 100644 --- a/ktx-radix-starter/ktx-radix-starter-logger/pom.xml +++ b/ktx-radix-starter/ktx-radix-starter-logger/pom.xml @@ -5,7 +5,7 @@ ktx-radix-starter io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-starter/ktx-radix-starter-tracker/pom.xml b/ktx-radix-starter/ktx-radix-starter-tracker/pom.xml index befd808..6a498f9 100644 --- a/ktx-radix-starter/ktx-radix-starter-tracker/pom.xml +++ b/ktx-radix-starter/ktx-radix-starter-tracker/pom.xml @@ -5,7 +5,7 @@ ktx-radix-starter io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-starter/pom.xml b/ktx-radix-starter/pom.xml index bc9c9fa..4bc3bfd 100644 --- a/ktx-radix-starter/pom.xml +++ b/ktx-radix-starter/pom.xml @@ -5,7 +5,7 @@ ktx-radix io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-tool/ktx-radix-tool-http/pom.xml b/ktx-radix-tool/ktx-radix-tool-http/pom.xml index cee89b4..566fe89 100644 --- a/ktx-radix-tool/ktx-radix-tool-http/pom.xml +++ b/ktx-radix-tool/ktx-radix-tool-http/pom.xml @@ -5,7 +5,7 @@ ktx-radix-tool io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-tool/ktx-radix-tool-json-dsl/pom.xml b/ktx-radix-tool/ktx-radix-tool-json-dsl/pom.xml index d97cad3..21bbde2 100644 --- a/ktx-radix-tool/ktx-radix-tool-json-dsl/pom.xml +++ b/ktx-radix-tool/ktx-radix-tool-json-dsl/pom.xml @@ -5,7 +5,7 @@ ktx-radix-tool io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-tool/ktx-radix-tool-test-dsl/pom.xml b/ktx-radix-tool/ktx-radix-tool-test-dsl/pom.xml index a77bec0..c535015 100644 --- a/ktx-radix-tool/ktx-radix-tool-test-dsl/pom.xml +++ b/ktx-radix-tool/ktx-radix-tool-test-dsl/pom.xml @@ -5,7 +5,7 @@ ktx-radix-tool io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-tool/ktx-radix-tool-test/pom.xml b/ktx-radix-tool/ktx-radix-tool-test/pom.xml index c4e8107..82da35b 100644 --- a/ktx-radix-tool/ktx-radix-tool-test/pom.xml +++ b/ktx-radix-tool/ktx-radix-tool-test/pom.xml @@ -5,7 +5,7 @@ ktx-radix-tool io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-tool/ktx-radix-tool-tracker/pom.xml b/ktx-radix-tool/ktx-radix-tool-tracker/pom.xml index 7bea40b..20162dd 100644 --- a/ktx-radix-tool/ktx-radix-tool-tracker/pom.xml +++ b/ktx-radix-tool/ktx-radix-tool-tracker/pom.xml @@ -5,7 +5,7 @@ ktx-radix-tool io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/ktx-radix-tool/pom.xml b/ktx-radix-tool/pom.xml index be7ab28..3e2710d 100644 --- a/ktx-radix-tool/pom.xml +++ b/ktx-radix-tool/pom.xml @@ -5,7 +5,7 @@ ktx-radix io.quee.ktx.radix - v1.2.2-RELEASE + v1.2.3-RELEASE 4.0.0 diff --git a/pom.xml b/pom.xml index 8b9cd69..2104a28 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ io.quee.ktx.radix ktx-radix pom - v1.2.2-RELEASE + v1.2.3-RELEASE ktx-radix-port ktx-radix-adapter