diff --git a/.idea/compiler.xml b/.idea/compiler.xml index d93132f55c..c143811a70 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -7,7 +7,21 @@ + + + + + + + + + + + + + + @@ -17,6 +31,7 @@ + @@ -25,6 +40,10 @@ + + + + diff --git a/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/DispatchFunc.kt b/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/DispatchFunc.kt index 90ae127777..6ae18a23c1 100644 --- a/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/DispatchFunc.kt +++ b/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/DispatchFunc.kt @@ -11,7 +11,7 @@ interface DispatchFunc { operator fun invoke( commandFunc: () -> C, - fireCommand: suspend ActionCannon.(C) -> R, + fireFunc: suspend ActionCannon.(C) -> R, response: (R) -> Unit, ): () -> Unit } diff --git a/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/pairassignments/CurrentPairAssignmentsPanel.kt b/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/pairassignments/CurrentPairAssignmentsPanel.kt index 0653d00c2c..a6d6423ec7 100644 --- a/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/pairassignments/CurrentPairAssignmentsPanel.kt +++ b/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/pairassignments/CurrentPairAssignmentsPanel.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.client.components.pairassignments import com.zegreatrob.coupling.action.pairassignmentdocument.DeletePairAssignmentsCommand -import com.zegreatrob.coupling.action.pairassignmentdocument.fire +import com.zegreatrob.coupling.action.pairassignmentdocument.perform import com.zegreatrob.coupling.client.components.CouplingButton import com.zegreatrob.coupling.client.components.DispatchFunc import com.zegreatrob.coupling.client.components.Paths.currentPairsPage @@ -42,7 +42,7 @@ val CurrentPairAssignmentsPanel by nfc { props val redirectToCurrentFunc = { setRedirectUrl(party.id.currentPairsPage()) } val onCancel = dispatchFunc( commandFunc = { DeletePairAssignmentsCommand(party.id, pairAssignments.id) }, - fireCommand = ::fire, + fireFunc = ::perform, response = { redirectToCurrentFunc() }, ) if (redirectUrl != null) { diff --git a/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/pairassignments/PairAssignmentRow.kt b/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/pairassignments/PairAssignmentRow.kt index 1d21e1e2d5..7c87199dff 100644 --- a/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/pairassignments/PairAssignmentRow.kt +++ b/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/pairassignments/PairAssignmentRow.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.client.components.pairassignments import com.zegreatrob.coupling.action.pairassignmentdocument.DeletePairAssignmentsCommand -import com.zegreatrob.coupling.action.pairassignmentdocument.fire +import com.zegreatrob.coupling.action.pairassignmentdocument.perform import com.zegreatrob.coupling.client.components.Controls import com.zegreatrob.coupling.client.components.CouplingButton import com.zegreatrob.coupling.client.components.external.w3c.WindowFunctions @@ -58,7 +58,7 @@ val PairAssignmentRow by nfc { props -> val onDeleteClick: () -> Unit = useCallback { val deleteFunc = dispatchFunc( commandFunc = { DeletePairAssignmentsCommand(party.id, document.id) }, - fireCommand = ::fire, + fireFunc = ::perform, response = { reload() }, ) if (windowFuncs.window.confirm("Are you sure you want to delete these pair assignments?")) { diff --git a/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/pin/PinConfig.kt b/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/pin/PinConfig.kt index 71af5ed423..6a59bc9b42 100644 --- a/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/pin/PinConfig.kt +++ b/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/pin/PinConfig.kt @@ -2,7 +2,7 @@ package com.zegreatrob.coupling.client.components.pin import com.zegreatrob.coupling.action.pin.DeletePinCommand import com.zegreatrob.coupling.action.pin.SavePinCommand -import com.zegreatrob.coupling.action.pin.fire +import com.zegreatrob.coupling.action.pin.perform import com.zegreatrob.coupling.client.components.DispatchFunc import com.zegreatrob.coupling.client.components.Paths.pinListPath import com.zegreatrob.coupling.client.components.external.w3c.requireConfirmation @@ -40,13 +40,13 @@ val PinConfig by nfc> { props -> val (redirectUrl, setRedirectUrl) = useState(null) val onSubmit = dispatchFunc( commandFunc = { SavePinCommand(party.id, updatedPin) }, - fireCommand = ::fire, + fireFunc = ::perform, response = { reload() }, ) val onRemove = pin.id?.let { pinId -> dispatchFunc( commandFunc = { DeletePinCommand(party.id, pinId) }, - fireCommand = ::fire, + fireFunc = ::perform, response = { setRedirectUrl(party.id.pinListPath()) }, ) .requireConfirmation("Are you sure you want to delete this pin?") diff --git a/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/slack/SlackConnectPageContent.kt b/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/slack/SlackConnectPageContent.kt index cef395f3d7..7c1f8e41be 100644 --- a/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/slack/SlackConnectPageContent.kt +++ b/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/slack/SlackConnectPageContent.kt @@ -3,7 +3,7 @@ package com.zegreatrob.coupling.client.components.slack import com.benasher44.uuid.uuid4 import com.zegreatrob.coupling.action.VoidResult import com.zegreatrob.coupling.action.party.SaveSlackIntegrationCommand -import com.zegreatrob.coupling.action.party.fire +import com.zegreatrob.coupling.action.party.perform import com.zegreatrob.coupling.client.components.ConfigForm import com.zegreatrob.coupling.client.components.CouplingButton import com.zegreatrob.coupling.client.components.DispatchFunc @@ -52,7 +52,7 @@ val SlackConnectPageContent by nfc { props -> var result by useState(null) val onSave = props.dispatchFunc( commandFunc = { command }, - fireCommand = ::fire, + fireFunc = ::perform, response = { result = it }, ) diff --git a/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/spin/PrepareSpin.kt b/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/spin/PrepareSpin.kt index 3c83cd053d..7a32807b00 100644 --- a/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/spin/PrepareSpin.kt +++ b/client/components/src/jsMain/kotlin/com/zegreatrob/coupling/client/components/spin/PrepareSpin.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.client.components.spin import com.zegreatrob.coupling.action.pairassignmentdocument.SpinCommand -import com.zegreatrob.coupling.action.pairassignmentdocument.fire +import com.zegreatrob.coupling.action.pairassignmentdocument.perform import com.zegreatrob.coupling.client.components.DispatchFunc import com.zegreatrob.coupling.client.components.Paths.newPairAssignmentsPath import com.zegreatrob.coupling.model.pairassignmentdocument.PairAssignmentDocument @@ -69,6 +69,6 @@ private fun onSpin( setRedirectUrl: (String) -> Unit, ) = dispatchFunc( commandFunc = { SpinCommand(party.id, playerSelections.playerIds(), pinSelections.filterNotNull()) }, - fireCommand = ::fire, + fireFunc = ::perform, response = { setRedirectUrl(party.newPairAssignmentsPath()) }, ) diff --git a/client/components/src/jsTest/kotlin/com/zegreatrob/coupling/client/components/StubDispatchFunc.kt b/client/components/src/jsTest/kotlin/com/zegreatrob/coupling/client/components/StubDispatchFunc.kt index 660ab23e97..6ae11238f3 100644 --- a/client/components/src/jsTest/kotlin/com/zegreatrob/coupling/client/components/StubDispatchFunc.kt +++ b/client/components/src/jsTest/kotlin/com/zegreatrob/coupling/client/components/StubDispatchFunc.kt @@ -46,7 +46,7 @@ class StubDispatchFunc(private val stubber: StubDispatcher = StubDispatcher() override fun invoke( commandFunc: () -> C, - fireCommand: suspend ActionCannon.(C) -> R, + fireFunc: suspend ActionCannon.(C) -> R, response: (R) -> Unit, ): () -> Unit = { stubber.dispatchList.add(DispatchedFunc(commandFunc(), response)) diff --git a/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/DecoratedDispatchFunc.kt b/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/DecoratedDispatchFunc.kt index 422f420702..a8c7778f3c 100644 --- a/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/DecoratedDispatchFunc.kt +++ b/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/DecoratedDispatchFunc.kt @@ -22,13 +22,13 @@ class DecoratedDispatchFunc( override fun invoke( commandFunc: () -> C, - fireCommand: suspend ActionCannon.(C) -> R, + fireFunc: suspend ActionCannon.(C) -> R, response: (R) -> Unit, ): () -> Unit = fun() { val cannon = cannonFunc() val command = commandFunc() tools.performAsyncWork( - { fireCommand(cannon, command) }, + { fireFunc(cannon, command) }, { handler: Throwable -> throw handler }, response, ) diff --git a/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/demo/DemoPageFrame.kt b/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/demo/DemoPageFrame.kt index de8fb43f40..d5bcc22da3 100644 --- a/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/demo/DemoPageFrame.kt +++ b/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/demo/DemoPageFrame.kt @@ -139,7 +139,7 @@ class NoOpDispatcherDispatchFunc : DispatchFunc { override fun invoke( commandFunc: () -> C, - fireCommand: suspend ActionCannon.(C) -> R, + fireFunc: suspend ActionCannon.(C) -> R, response: (R) -> Unit, ) = {} } diff --git a/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/pairassignments/SocketedPairAssignments.kt b/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/pairassignments/SocketedPairAssignments.kt index 45a83dfdf7..52b97f2180 100644 --- a/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/pairassignments/SocketedPairAssignments.kt +++ b/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/pairassignments/SocketedPairAssignments.kt @@ -2,7 +2,7 @@ package com.zegreatrob.coupling.client.pairassignments import com.zegreatrob.coupling.action.pairassignmentdocument.DeletePairAssignmentsCommand import com.zegreatrob.coupling.action.pairassignmentdocument.SavePairAssignmentsCommand -import com.zegreatrob.coupling.action.pairassignmentdocument.fire +import com.zegreatrob.coupling.action.pairassignmentdocument.perform import com.zegreatrob.coupling.client.components.Controls import com.zegreatrob.coupling.client.components.CouplingWebsocket import com.zegreatrob.coupling.client.components.disconnectedMessage @@ -44,7 +44,7 @@ val SocketedPairAssignments by nfc> { (party, pl setPairAssignments(new) controls.dispatchFunc( commandFunc = { SavePairAssignmentsCommand(party.id, new) }, - fireCommand = ::fire, + fireFunc = ::perform, response = {}, ).invoke() } diff --git a/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/slack/SlackCallbackPage.kt b/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/slack/SlackCallbackPage.kt index e8b7336fa7..ec82bd9808 100644 --- a/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/slack/SlackCallbackPage.kt +++ b/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/slack/SlackCallbackPage.kt @@ -29,10 +29,8 @@ val SlackCallbackPage by nfc { props -> } else { DataLoader( getDataAsync = { - fire( - props.commander.tracingDispatcher().sdk, - GrantSlackAccessCommand(code, state), - ) + props.commander.tracingDispatcher().sdk + .fire(GrantSlackAccessCommand(code, state)) }, errorData = { VoidResult.Rejected }, child = SlackCallbackLoadContent::create, diff --git a/coupling-plugins/gradle/libs.versions.toml b/coupling-plugins/gradle/libs.versions.toml index 50a63e0e80..790e41403f 100644 --- a/coupling-plugins/gradle/libs.versions.toml +++ b/coupling-plugins/gradle/libs.versions.toml @@ -9,7 +9,7 @@ com-fasterxml-jackson-core-jackson-databind = "com.fasterxml.jackson.core:jackso com-github-ben-manes-gradle-versions-plugin = "com.github.ben-manes:gradle-versions-plugin:0.47.0" com-soywiz-korlibs-klock = "com.soywiz.korlibs.klock:klock:4.0.8" com-zegreatrob-jsmints-jsmints-bom = "com.zegreatrob.jsmints:jsmints-bom:4.3.13" -com-zegreatrob-testmints-testmints-bom = "com.zegreatrob.testmints:testmints-bom:10.0.20" +com-zegreatrob-testmints-testmints-bom = "com.zegreatrob.testmints:testmints-bom:10.1.0" com-zegreatrob-tools-tools-bom = "com.zegreatrob.tools:tools-bom:0.5.4" org-ajoberstar-grgit-gradle-plugin = "org.ajoberstar.grgit:org.ajoberstar.grgit.gradle.plugin:5.0.0" org-apache-logging-log4j-log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "org-apache-logging-log4j" } diff --git a/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/HistoryPageE2ETest.kt b/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/HistoryPageE2ETest.kt index e25e2f2f3d..96304ef880 100644 --- a/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/HistoryPageE2ETest.kt +++ b/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/HistoryPageE2ETest.kt @@ -69,7 +69,7 @@ class HistoryPageE2ETest { ), ), ), - ).onEach { fire(sdk, SavePairAssignmentsCommand(party.id, it)) } + ).onEach { sdk.fire(SavePairAssignmentsCommand(party.id, it)) } private fun buildPairAssignmentDocument(number: Int, pairs: List) = PairAssignmentDocument( PairAssignmentDocumentId("${DateTime.now().milliseconds}-HistoryPageE2ETest-$number"), diff --git a/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/PairAssignmentsPageE2ETest.kt b/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/PairAssignmentsPageE2ETest.kt index 2786afbb35..6bdf26c987 100644 --- a/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/PairAssignmentsPageE2ETest.kt +++ b/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/PairAssignmentsPageE2ETest.kt @@ -185,7 +185,7 @@ class PairAssignmentsPageE2ETest { fire(SavePartyCommand(party)) coroutineScope { launch { players.forEach { fire(SavePlayerCommand(party.id, it)) } } - launch { fire(sdk.await(), SavePairAssignmentsCommand(party.id, pairAssignmentDocument)) } + launch { sdk.await().fire(SavePairAssignmentsCommand(party.id, pairAssignmentDocument)) } } } }) diff --git a/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/PinConfigE2ETest.kt b/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/PinConfigE2ETest.kt index 6a5ca04157..5df87407fa 100644 --- a/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/PinConfigE2ETest.kt +++ b/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/PinConfigE2ETest.kt @@ -73,7 +73,7 @@ class PinConfigE2ETest { val pin = randomPin() }.attachParty(), ) { - fire(sdk, SavePinCommand(party.id, pin)) + sdk.fire(SavePinCommand(party.id, pin)) } exercise { PinConfigPage.goTo(party.id, pin.id) } verify { @@ -91,7 +91,7 @@ class PinConfigE2ETest { val pin = randomPin() }.attachParty(), ) { - fire(sdk, SavePinCommand(party.id, pin)) + sdk.fire(SavePinCommand(party.id, pin)) PinConfigPage.goTo(party.id, pin.id) } exercise { getDeleteButton().click() diff --git a/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/PrepareToSpinPageE2ETest.kt b/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/PrepareToSpinPageE2ETest.kt index 29cbdaafd3..c02b1d3a55 100644 --- a/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/PrepareToSpinPageE2ETest.kt +++ b/e2e/src/jsE2eTest/kotlin/com/zegreatrob/coupling/e2e/test/PrepareToSpinPageE2ETest.kt @@ -31,7 +31,7 @@ class PrepareToSpinPageE2ETest { val sdk = sdk.await().apply { fire(SavePartyCommand(party)) players.forEach { fire(SavePlayerCommand(party.id, it)) } - fire(sdk.await(), SavePinCommand(party.id, pin)) + sdk.await().fire(SavePinCommand(party.id, pin)) } FullPartyData(players, listOf(pin), party, sdk) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f664172f26..7a2360b030 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ com-fasterxml-jackson-core-jackson-databind = "com.fasterxml.jackson.core:jackso com-github-ajalt-clikt-clikt = "com.github.ajalt.clikt:clikt:4.0.0" com-soywiz-korlibs-klock = "com.soywiz.korlibs.klock:klock:4.0.9" com-zegreatrob-jsmints-jsmints-bom = "com.zegreatrob.jsmints:jsmints-bom:4.3.14" -com-zegreatrob-testmints-testmints-bom = "com.zegreatrob.testmints:testmints-bom:10.0.20" +com-zegreatrob-testmints-testmints-bom = "com.zegreatrob.testmints:testmints-bom:10.1.0" io-github-microutils-kotlin-logging = "io.github.microutils:kotlin-logging:3.0.5" io-ktor-ktor-bom = "io.ktor:ktor-bom:2.3.2" org-jetbrains-kotlin-wrappers-kotlin-wrappers-bom = "org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:1.0.0-pre.597" diff --git a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/RequestCombineEndpointTest.kt b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/RequestCombineEndpointTest.kt index 461195f785..22c6680211 100644 --- a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/RequestCombineEndpointTest.kt +++ b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/RequestCombineEndpointTest.kt @@ -36,7 +36,7 @@ class RequestCombineEndpointTest { } }) { sdk.fire(SavePartyCommand(party)) - pinsToSave.forEach { fire(cannon = sdk, action = SavePinCommand(party.id, it)) } + pinsToSave.forEach { sdk.fire(SavePinCommand(party.id, it)) } playersToSave.forEach { sdk.fire(SavePlayerCommand(party.id, it)) } } exercise { coroutineScope { diff --git a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkBoostTest.kt b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkBoostTest.kt index 697ae0d191..5edc810b55 100644 --- a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkBoostTest.kt +++ b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkBoostTest.kt @@ -29,19 +29,19 @@ class SdkBoostTest { @Test fun deleteWillMakeBoostNotRecoverableThroughGet() = setupWithUser { } exercise { - fire(sdk, SaveBoostCommand(setOf(PartyId("${uuid4()}"), PartyId("${uuid4()}")))) - fire(sdk, DeleteBoostCommand()) + sdk.fire(SaveBoostCommand(setOf(PartyId("${uuid4()}"), PartyId("${uuid4()}")))) + sdk.fire(DeleteBoostCommand()) } verifyWithWait { - fire(sdk, BoostQuery()) + sdk.fire(BoostQuery()) .assertIsEqualTo(null) } @Test fun getBoostWhenThereIsNoneReturnsNull() = setupWithUser { } exercise { - fire(sdk, DeleteBoostCommand()) + sdk.fire(DeleteBoostCommand()) } verifyWithWait { - fire(sdk, BoostQuery()) + sdk.fire(BoostQuery()) .assertIsEqualTo(null) } @@ -53,9 +53,9 @@ class SdkBoostTest { val partyIds = setOf(PartyId("${uuid4()}"), PartyId("${uuid4()}")) } }) exercise { - fire(sdk, SaveBoostCommand(partyIds)) + sdk.fire(SaveBoostCommand(partyIds)) } verifyWithWait { - fire(sdk, BoostQuery()) + sdk.fire(BoostQuery()) ?.data .assertIsEqualTo( Boost( @@ -75,11 +75,11 @@ class SdkBoostTest { val updatedBoostParties2 = setOf(PartyId("${uuid4()}")) } }) exercise { - fire(sdk, SaveBoostCommand(initialBoostParties)) - fire(sdk, SaveBoostCommand(updatedBoostParties1)) - fire(sdk, SaveBoostCommand(updatedBoostParties2)) + sdk.fire(SaveBoostCommand(initialBoostParties)) + sdk.fire(SaveBoostCommand(updatedBoostParties1)) + sdk.fire(SaveBoostCommand(updatedBoostParties2)) } verifyWithWait { - fire(sdk, BoostQuery()) + sdk.fire(BoostQuery()) ?.data .assertIsEqualTo( Boost( diff --git a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkGlobalStatsTest.kt b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkGlobalStatsTest.kt index 43ccaee1dc..e16fa3af30 100644 --- a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkGlobalStatsTest.kt +++ b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkGlobalStatsTest.kt @@ -20,15 +20,13 @@ class SdkGlobalStatsTest { val party = stubPartyDetails() }) { sdk().fire(SavePartyCommand(party)) - fire( - sdk(), + sdk().fire( SavePairAssignmentsCommand( partyId = party.id, pairAssignments = stubPairAssignmentDoc().copy(date = DateTime.now().minus(2.days)), ), ) - fire( - sdk(), + sdk().fire( SavePairAssignmentsCommand( partyId = party.id, pairAssignments = stubPairAssignmentDoc().copy(date = DateTime.now()), diff --git a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkPairAssignmentDocumentTest.kt b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkPairAssignmentDocumentTest.kt index bfbf55ae6d..4261a75eba 100644 --- a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkPairAssignmentDocumentTest.kt +++ b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkPairAssignmentDocumentTest.kt @@ -52,9 +52,9 @@ class SdkPairAssignmentDocumentTest { val updatedDocument = pairAssignmentDocument.copy(date = updatedDateTime) } }) { - fire(sdk, SavePairAssignmentsCommand(party.id, pairAssignmentDocument)) + sdk.fire(SavePairAssignmentsCommand(party.id, pairAssignmentDocument)) } exercise { - fire(sdk, SavePairAssignmentsCommand(party.id, updatedDocument)) + sdk.fire(SavePairAssignmentsCommand(party.id, updatedDocument)) } verifyWithWait { sdk.fire(graphQuery { party(party.id) { pairAssignmentDocumentList() } }) ?.party @@ -67,7 +67,7 @@ class SdkPairAssignmentDocumentTest { @Test fun deleteWhenDocumentDoesNotExistWillNotExplode() = repositorySetup().exercise { - runCatching { fire(sdk, DeletePairAssignmentsCommand(party.id, PairAssignmentDocumentId("${uuid4()}"))) } + runCatching { sdk.fire(DeletePairAssignmentsCommand(party.id, PairAssignmentDocumentId("${uuid4()}"))) } } verify { result -> result.exceptionOrNull() .assertIsEqualTo(null) @@ -84,7 +84,7 @@ class SdkPairAssignmentDocumentTest { } }) { listOf(middle, oldest, newest) - .forEach { fire(sdk, SavePairAssignmentsCommand(partyId, it)) } + .forEach { sdk.fire(SavePairAssignmentsCommand(partyId, it)) } } exercise { sdk.fire(graphQuery { party(partyId) { currentPairAssignments() } }) ?.party @@ -101,9 +101,9 @@ class SdkPairAssignmentDocumentTest { val document = stubPairAssignmentDoc() } }) { - fire(sdk, SavePairAssignmentsCommand(partyId, document)) + sdk.fire(SavePairAssignmentsCommand(partyId, document)) } exercise { - fire(sdk, DeletePairAssignmentsCommand(partyId, document.id)) + sdk.fire(DeletePairAssignmentsCommand(partyId, document.id)) } verifyWithWait { sdk.fire(graphQuery { party(partyId) { pairAssignmentDocumentList() } }) ?.party @@ -125,7 +125,7 @@ class SdkPairAssignmentDocumentTest { } }) { listOf(middle, oldest, newest) - .forEach { fire(sdk, SavePairAssignmentsCommand(partyId, it)) } + .forEach { sdk.fire(SavePairAssignmentsCommand(partyId, it)) } } exercise { sdk.fire(graphQuery { party(partyId) { pairAssignmentDocumentList() } }) ?.party @@ -160,7 +160,7 @@ class SdkPairAssignmentDocumentTest { } }) { otherSdk.fire(SavePartyCommand(otherParty)) - fire(otherSdk, SavePairAssignmentsCommand(otherParty.id, stubPairAssignmentDoc())) + otherSdk.fire(SavePairAssignmentsCommand(otherParty.id, stubPairAssignmentDoc())) } exercise { sdk.fire(graphQuery { party(PartyId("someoneElseParty")) { pairAssignmentDocumentList() } }) ?.party @@ -180,7 +180,7 @@ class SdkPairAssignmentDocumentTest { val pairAssignmentDoc = stubPairAssignmentDoc() } }) { - fire(sdk, SavePairAssignmentsCommand(partyId, pairAssignmentDoc)) + sdk.fire(SavePairAssignmentsCommand(partyId, pairAssignmentDoc)) } exercise { sdk.fire(graphQuery { party(partyId) { pairAssignmentDocumentList() } }) ?.party diff --git a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkPartyTest.kt b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkPartyTest.kt index 7e18aab8f1..c99f0442dd 100644 --- a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkPartyTest.kt +++ b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkPartyTest.kt @@ -171,7 +171,7 @@ class SdkPartyTest { }) { sdk().fire(SavePartyCommand(party)) } exercise { - fire(sdk(), SaveSlackIntegrationCommand(partyId = party.id, team = slackTeam, channel = slackChannel)) + sdk().fire(SaveSlackIntegrationCommand(partyId = party.id, team = slackTeam, channel = slackChannel)) } verifyAnd { result -> result.assertIsEqualTo(VoidResult.Accepted) val queryResult = sdk().fire(graphQuery { party(party.id) { integration() } }) @@ -194,7 +194,7 @@ class SdkPartyTest { val slackTeam = uuidString() val slackChannel = uuidString() }) exercise { - fire(sdk(), SaveSlackIntegrationCommand(partyId = party.id, team = slackTeam, channel = slackChannel)) + sdk().fire(SaveSlackIntegrationCommand(partyId = party.id, team = slackTeam, channel = slackChannel)) } verify { result -> result.assertIsEqualTo(CommandResult.Unauthorized) sdk().fire(graphQuery { party(party.id) { integration() } }) diff --git a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkPinTest.kt b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkPinTest.kt index 10be81886a..8e93f1069f 100644 --- a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkPinTest.kt +++ b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkPinTest.kt @@ -48,7 +48,7 @@ class SdkPinTest { } }, ) exercise { - pins.forEach { fire(sdk, SavePinCommand(party.id, it)) } + pins.forEach { sdk.fire(SavePinCommand(party.id, it)) } } verifyWithWait { sdk.fire(graphQuery { party(party.id) { pinList() } }) ?.party @@ -60,7 +60,7 @@ class SdkPinTest { @Test fun whenPinDoesNotExistDeleteWillDoNothing() = partySetup() exercise { - runCatching { fire(sdk, DeletePinCommand(party.id, "${uuid4()}")) } + runCatching { sdk.fire(DeletePinCommand(party.id, "${uuid4()}")) } } verify { result -> result.exceptionOrNull() .assertIsEqualTo(null) @@ -87,8 +87,8 @@ class SdkPinTest { ) } }) exercise { - pins.forEach { fire(sdk, SavePinCommand(party.id, it)) } - fire(sdk, DeletePinCommand(party.id, this.pins[1].id!!)) + pins.forEach { sdk.fire(SavePinCommand(party.id, it)) } + sdk.fire(DeletePinCommand(party.id, this.pins[1].id!!)) } verifyWithWait { sdk.fire(graphQuery { party(party.id) { pinList() } }) ?.party @@ -113,7 +113,7 @@ class SdkPinTest { ) } }) exercise { - fire(sdk, SavePinCommand(partyId, pin)) + sdk.fire(SavePinCommand(partyId, pin)) } verifyWithWait { sdk.fire(graphQuery { party(partyId) { pinList() } }) ?.party @@ -135,7 +135,7 @@ class SdkPinTest { suspend fun otherSdk() = altAuthorizedSdkDeferred.await() }) { otherSdk().fire(SavePartyCommand(otherParty)) - fire(otherSdk(), SavePinCommand(otherParty.id, stubPin())) + otherSdk().fire(SavePinCommand(otherParty.id, stubPin())) } exercise { sdk().fire(graphQuery { party(otherParty.id) { pinList() } }) ?.party @@ -154,7 +154,7 @@ class SdkPinTest { }) { sdk = sdk() sdk.fire(SavePartyCommand(party)) - fire(sdk, SavePinCommand(party.id, pin)) + sdk.fire(SavePinCommand(party.id, pin)) } exercise { sdk.fire(graphQuery { party(party.id) { pinList() } }) ?.party diff --git a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkSecretTest.kt b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkSecretTest.kt index f9fac2d597..3c35fb9474 100644 --- a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkSecretTest.kt +++ b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SdkSecretTest.kt @@ -32,7 +32,7 @@ class SdkSecretTest { }) { sdk().fire(SavePartyCommand(party)) } exercise { - fire(sdk(), CreateSecretCommand(party.id)) + sdk().fire(CreateSecretCommand(party.id)) } verify { result -> val (secret, token) = result!! secret.assertIsNotEqualTo(null) @@ -58,11 +58,11 @@ class SdkSecretTest { lateinit var token: String }) { sdk().fire(SavePartyCommand(party)) - val result = fire(sdk(), CreateSecretCommand(party.id))!! + val result = sdk().fire(CreateSecretCommand(party.id))!! secret = result.first token = result.second } exercise { - fire(sdk(), DeleteSecretCommand(party.id, secret)) + sdk().fire(DeleteSecretCommand(party.id, secret)) } verify { sdk().fire(graphQuery { party(party.id) { secretList() } }) ?.party @@ -85,7 +85,7 @@ class SdkSecretTest { .map { SavePartyCommand(it) } .forEach { sdk().fire(it) } } exercise { - fire(sdk(), CreateSecretCommand(party1.id)) + sdk().fire(CreateSecretCommand(party1.id)) } verify { result -> val (_, token) = result!! val tokenSdk = couplingSdk({ token }, buildClient()) @@ -107,7 +107,7 @@ class SdkSecretTest { fun canNotGenerateSecretForArbitraryParty() = asyncSetup(object { val partyId = stubPartyId() }) exercise { - fire(sdk(), CreateSecretCommand(partyId)) + sdk().fire(CreateSecretCommand(partyId)) } verify { result -> result.assertIsEqualTo(null) } diff --git a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SpinTest.kt b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SpinTest.kt index 3e426375c6..b803d94262 100644 --- a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SpinTest.kt +++ b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/SpinTest.kt @@ -54,7 +54,7 @@ class SpinTest { sdk.fire(SavePartyCommand(party)) players.forEach { sdk.fire(SavePlayerCommand(party.id, it)) } } exercise { - fire(sdk, SpinCommand(party.id, players.map { it.id }, emptyList())) + sdk.fire(SpinCommand(party.id, players.map { it.id }, emptyList())) } verifyAnd { result -> result.assertIsEqualTo(VoidResult.Accepted) queryCurrentPairs(party.id, sdk) @@ -96,7 +96,7 @@ class SpinTest { }) { setupScenario(sdk, party, players, history) } exercise { - fire(sdk, SpinCommand(party.id, players.map { it.id }, emptyList())) + sdk.fire(SpinCommand(party.id, players.map { it.id }, emptyList())) } verifyAnd { result -> result.assertIsEqualTo(VoidResult.Accepted) queryCurrentPairs(party.id, sdk) @@ -137,7 +137,7 @@ class SpinTest { }) { setupScenario(sdk.await(), party, players, history) } exercise { - fire(sdk.await(), SpinCommand(party.id, players.map { it.id }, emptyList())) + sdk.await().fire(SpinCommand(party.id, players.map { it.id }, emptyList())) } verifyAnd { result -> result.assertIsEqualTo(VoidResult.Accepted) queryCurrentPairs(party.id, sdk.await()) @@ -167,7 +167,7 @@ class SpinTest { fun whenAPinExistsWillAssignOnePinToPair() = asyncSetup.with({ pinExistsSetup(it) }) { setupScenario(sdk, party, players, pins = listOf(pin)) } exercise { - fire(sdk, SpinCommand(party.id, players.map { it.id }, listOf(pin.id!!))) + sdk.fire(SpinCommand(party.id, players.map { it.id }, listOf(pin.id!!))) } verifyAnd { result -> result.assertIsEqualTo(VoidResult.Accepted) queryCurrentPairs(party.id, sdk) @@ -183,7 +183,7 @@ class SpinTest { fun whenAPinExistsButIsDeselectedWillNotAssign() = asyncSetup.with({ pinExistsSetup(it) }) { setupScenario(sdk, party, players, pins = listOf(pin)) } exercise { - fire(sdk, SpinCommand(party.id, players.map { it.id }, emptyList())) + sdk.fire(SpinCommand(party.id, players.map { it.id }, emptyList())) } verifyAnd { result -> result.assertIsEqualTo(VoidResult.Accepted) queryCurrentPairs(party.id, sdk) @@ -214,8 +214,8 @@ class SpinTest { with(sdk) { fire(SavePartyCommand(party)) players.forEach { fire(SavePlayerCommand(party.id, it)) } - history.forEach { launch { fire(sdk, SavePairAssignmentsCommand(party.id, it)) } } - pins.forEach { launch { fire(sdk, SavePinCommand(party.id, it)) } } + history.forEach { launch { sdk.fire(SavePairAssignmentsCommand(party.id, it)) } } + pins.forEach { launch { sdk.fire(SavePinCommand(party.id, it)) } } } } } diff --git a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/WebsocketTest.kt b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/WebsocketTest.kt index cab5345bb8..2c8596bdf4 100644 --- a/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/WebsocketTest.kt +++ b/sdk/src/commonTest/kotlin/com/zegreatrob/coupling/sdk/WebsocketTest.kt @@ -133,7 +133,7 @@ class WebsocketTest { sdk.fire(SavePartyCommand(party)) sockets.add(couplingSocketSession(party.id).alsoWaitForFirstFrame()) } exercise { - fire(sdk, SavePairAssignmentsCommand(party.id, expectedPairDoc)) + sdk.fire(SavePairAssignmentsCommand(party.id, expectedPairDoc)) } verifyAnd { sockets.first() .readTextFrame() diff --git a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/boost/BoostResolver.kt b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/boost/BoostResolver.kt index 4a8da462b1..18ac44feed 100644 --- a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/boost/BoostResolver.kt +++ b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/boost/BoostResolver.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.server.entity.boost import com.zegreatrob.coupling.action.boost.BoostQuery -import com.zegreatrob.coupling.action.boost.fire +import com.zegreatrob.coupling.action.boost.perform import com.zegreatrob.coupling.json.JsonParty import com.zegreatrob.coupling.json.toSerializable import com.zegreatrob.coupling.model.Boost @@ -13,7 +13,7 @@ import kotlinx.serialization.json.JsonNull val boostResolver = dispatchAction( dispatcherFunc = prereleaseCommand(), commandFunc = { _: JsonParty, _: JsonNull -> BoostQuery() }, - fireFunc = ::fire, + fireFunc = ::perform, toSerializable = ::jsonBoostRecord, ) diff --git a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/boost/DeleteBoostResolver.kt b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/boost/DeleteBoostResolver.kt index 6bc755c811..b287ab7da2 100644 --- a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/boost/DeleteBoostResolver.kt +++ b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/boost/DeleteBoostResolver.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.server.entity.boost import com.zegreatrob.coupling.action.boost.DeleteBoostCommand -import com.zegreatrob.coupling.action.boost.fire +import com.zegreatrob.coupling.action.boost.perform import com.zegreatrob.coupling.server.graphql.DispatcherProviders.prereleaseCommand import com.zegreatrob.coupling.server.graphql.dispatchAction import kotlinx.serialization.json.JsonNull @@ -9,6 +9,6 @@ import kotlinx.serialization.json.JsonNull val deleteBoostResolver = dispatchAction( dispatcherFunc = prereleaseCommand(), commandFunc = { _: JsonNull, _: JsonNull -> DeleteBoostCommand() }, - fireFunc = ::fire, + fireFunc = ::perform, toSerializable = { true }, ) diff --git a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/boost/SaveBoostResolver.kt b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/boost/SaveBoostResolver.kt index 6a15915340..49f36eb337 100644 --- a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/boost/SaveBoostResolver.kt +++ b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/boost/SaveBoostResolver.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.server.entity.boost import com.zegreatrob.coupling.action.boost.SaveBoostCommand -import com.zegreatrob.coupling.action.boost.fire +import com.zegreatrob.coupling.action.boost.perform import com.zegreatrob.coupling.json.SaveBoostInput import com.zegreatrob.coupling.server.graphql.DispatcherProviders.prereleaseCommand import com.zegreatrob.coupling.server.graphql.dispatchAction @@ -10,6 +10,6 @@ import kotlinx.serialization.json.JsonNull val saveBoostResolver = dispatchAction( dispatcherFunc = prereleaseCommand(), commandFunc = { _: JsonNull, args: SaveBoostInput -> SaveBoostCommand(args.partyIds) }, - fireFunc = ::fire, + fireFunc = ::perform, toSerializable = { true }, ) diff --git a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pairassignment/DeletePairsResolver.kt b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pairassignment/DeletePairsResolver.kt index 688f608568..38a1e94e0e 100644 --- a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pairassignment/DeletePairsResolver.kt +++ b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pairassignment/DeletePairsResolver.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.server.entity.pairassignment import com.zegreatrob.coupling.action.pairassignmentdocument.DeletePairAssignmentsCommand -import com.zegreatrob.coupling.action.pairassignmentdocument.fire +import com.zegreatrob.coupling.action.pairassignmentdocument.perform import com.zegreatrob.coupling.json.DeletePairAssignmentsInput import com.zegreatrob.coupling.model.pairassignmentdocument.PairAssignmentDocumentId import com.zegreatrob.coupling.server.graphql.DispatcherProviders.authorizedPartyDispatcher @@ -11,7 +11,7 @@ import kotlinx.serialization.json.JsonNull val deletePairsResolver = dispatchAction( dispatcherFunc = { request, _: JsonNull, args -> authorizedPartyDispatcher(request, args.partyId.value) }, commandFunc = { _, entity: DeletePairAssignmentsInput -> entity.toModel() }, - fireFunc = ::fire, + fireFunc = ::perform, toSerializable = { true }, ) diff --git a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pairassignment/SavePairResolver.kt b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pairassignment/SavePairResolver.kt index c0fe2374b2..b7fce967bc 100644 --- a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pairassignment/SavePairResolver.kt +++ b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pairassignment/SavePairResolver.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.server.entity.pairassignment import com.zegreatrob.coupling.action.pairassignmentdocument.SavePairAssignmentsCommand -import com.zegreatrob.coupling.action.pairassignmentdocument.fire +import com.zegreatrob.coupling.action.pairassignmentdocument.perform import com.zegreatrob.coupling.json.SavePairAssignmentsInput import com.zegreatrob.coupling.json.toModel import com.zegreatrob.coupling.server.graphql.DispatcherProviders.authorizedPartyDispatcher @@ -16,7 +16,7 @@ val savePairsResolver = dispatchAction( ) }, commandFunc = { _, input: SavePairAssignmentsInput -> input.command() }, - fireFunc = ::fire, + fireFunc = ::perform, toSerializable = { true }, ) diff --git a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pairassignment/SpinResolver.kt b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pairassignment/SpinResolver.kt index 63f720fdde..1de8a8de5b 100644 --- a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pairassignment/SpinResolver.kt +++ b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pairassignment/SpinResolver.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.server.entity.pairassignment import com.zegreatrob.coupling.action.pairassignmentdocument.SpinCommand -import com.zegreatrob.coupling.action.pairassignmentdocument.fire +import com.zegreatrob.coupling.action.pairassignmentdocument.perform import com.zegreatrob.coupling.json.SpinInput import com.zegreatrob.coupling.server.external.graphql.Resolver import com.zegreatrob.coupling.server.graphql.DispatcherProviders.authorizedPartyDispatcher @@ -16,7 +16,7 @@ val spinResolver: Resolver = dispatchAction( ) }, commandFunc = { _, args: SpinInput -> args.command() }, - fireFunc = ::fire, + fireFunc = ::perform, toSerializable = { true }, ) diff --git a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/party/SaveSlackIntegrationResolver.kt b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/party/SaveSlackIntegrationResolver.kt index 9486a9b903..d1c6b2e055 100644 --- a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/party/SaveSlackIntegrationResolver.kt +++ b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/party/SaveSlackIntegrationResolver.kt @@ -2,7 +2,7 @@ package com.zegreatrob.coupling.server.entity.party import com.zegreatrob.coupling.action.VoidResult import com.zegreatrob.coupling.action.party.SaveSlackIntegrationCommand -import com.zegreatrob.coupling.action.party.fire +import com.zegreatrob.coupling.action.party.perform import com.zegreatrob.coupling.json.SaveSlackIntegrationInput import com.zegreatrob.coupling.model.party.PartyId import com.zegreatrob.coupling.server.entity.toJson @@ -13,7 +13,7 @@ import kotlinx.serialization.json.JsonNull val saveSlackIntegrationResolver = dispatchAction( dispatcherFunc = { request, _: JsonNull, args -> authorizedPartyDispatcher(request, args.partyId) }, commandFunc = { _, input: SaveSlackIntegrationInput -> input.toCommand() }, - fireFunc = ::fire, + fireFunc = ::perform, toSerializable = VoidResult::toJson, ) diff --git a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pin/DeletePinResolver.kt b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pin/DeletePinResolver.kt index 621cd01f14..56408cf7fa 100644 --- a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pin/DeletePinResolver.kt +++ b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pin/DeletePinResolver.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.server.entity.pin import com.zegreatrob.coupling.action.pin.DeletePinCommand -import com.zegreatrob.coupling.action.pin.fire +import com.zegreatrob.coupling.action.pin.perform import com.zegreatrob.coupling.json.DeletePinInput import com.zegreatrob.coupling.server.graphql.DispatcherProviders.authorizedPartyDispatcher import com.zegreatrob.coupling.server.graphql.dispatchAction @@ -15,7 +15,7 @@ val deletePinResolver = dispatchAction( ) }, commandFunc = { _, input -> input.toCommand() }, - fireFunc = ::fire, + fireFunc = ::perform, toSerializable = { true }, ) diff --git a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pin/SavePinResolver.kt b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pin/SavePinResolver.kt index f36afe2fb0..ead0559d2d 100644 --- a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pin/SavePinResolver.kt +++ b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/pin/SavePinResolver.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.server.entity.pin import com.zegreatrob.coupling.action.pin.SavePinCommand -import com.zegreatrob.coupling.action.pin.fire +import com.zegreatrob.coupling.action.pin.perform import com.zegreatrob.coupling.json.SavePinInput import com.zegreatrob.coupling.model.pin.Pin import com.zegreatrob.coupling.server.graphql.DispatcherProviders.authorizedPartyDispatcher @@ -16,7 +16,7 @@ val savePinResolver = dispatchAction( ) }, commandFunc = { _, input -> input.toCommand() }, - fireFunc = ::fire, + fireFunc = ::perform, toSerializable = { true }, ) diff --git a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/secret/CreateSecretResolver.kt b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/secret/CreateSecretResolver.kt index d4143687ac..011b833a85 100644 --- a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/secret/CreateSecretResolver.kt +++ b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/secret/CreateSecretResolver.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.server.entity.secret import com.zegreatrob.coupling.action.secret.CreateSecretCommand -import com.zegreatrob.coupling.action.secret.fire +import com.zegreatrob.coupling.action.secret.perform import com.zegreatrob.coupling.json.CreateSecretInput import com.zegreatrob.coupling.json.toModel import com.zegreatrob.coupling.model.party.PartyId @@ -12,7 +12,7 @@ import kotlinx.serialization.json.JsonNull val createSecretResolver = dispatchAction( dispatcherFunc = { request, _: JsonNull, args -> authorizedPartyDispatcher(request, args.partyId) }, commandFunc = { _, input: CreateSecretInput -> input.toCommand() }, - fireFunc = ::fire, + fireFunc = ::perform, toSerializable = { it?.toModel() }, ) diff --git a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/secret/DeleteSecretResolver.kt b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/secret/DeleteSecretResolver.kt index 5e3d8c79ae..764bf19e70 100644 --- a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/secret/DeleteSecretResolver.kt +++ b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/secret/DeleteSecretResolver.kt @@ -1,7 +1,7 @@ package com.zegreatrob.coupling.server.entity.secret import com.zegreatrob.coupling.action.secret.DeleteSecretCommand -import com.zegreatrob.coupling.action.secret.fire +import com.zegreatrob.coupling.action.secret.perform import com.zegreatrob.coupling.json.DeleteSecretInput import com.zegreatrob.coupling.model.party.PartyId import com.zegreatrob.coupling.model.party.Secret @@ -17,6 +17,6 @@ val deleteSecretResolver = dispatchAction( ) }, commandFunc = { _, args: DeleteSecretInput -> DeleteSecretCommand(PartyId(args.partyId), Secret(args.secretId)) }, - fireFunc = ::fire, + fireFunc = ::perform, toSerializable = { true }, ) diff --git a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/slackaccess/GrantSlackAccessResolver.kt b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/slackaccess/GrantSlackAccessResolver.kt index 44180feb94..4d932ab7f6 100644 --- a/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/slackaccess/GrantSlackAccessResolver.kt +++ b/server/src/jsMain/kotlin/com/zegreatrob/coupling/server/entity/slackaccess/GrantSlackAccessResolver.kt @@ -2,7 +2,7 @@ package com.zegreatrob.coupling.server.entity.slackaccess import com.zegreatrob.coupling.action.GrantSlackAccessCommand import com.zegreatrob.coupling.action.VoidResult -import com.zegreatrob.coupling.action.fire +import com.zegreatrob.coupling.action.perform import com.zegreatrob.coupling.json.GrantSlackAccessInput import com.zegreatrob.coupling.server.entity.toJson import com.zegreatrob.coupling.server.external.graphql.Resolver @@ -13,7 +13,7 @@ import kotlinx.serialization.json.JsonNull val grantSlackAccessResolver: Resolver = dispatchAction( DispatcherProviders.command(), commandFunc = { _: JsonNull, input: GrantSlackAccessInput -> input.command() }, - fireFunc = ::fire, + fireFunc = ::perform, toSerializable = VoidResult::toJson, )