diff --git a/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/CreatePortfolioCommand.java b/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/CreatePortfolioCommand.java deleted file mode 100644 index 8c05854..0000000 --- a/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/CreatePortfolioCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2010-2012. Axon Framework - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.axonframework.samples.trader.api.portfolio; - -import org.axonframework.samples.trader.api.orders.trades.PortfolioId; -import org.axonframework.samples.trader.api.users.UserId; - -/** - * @author Jettro Coenradie - */ -public class CreatePortfolioCommand { - - private PortfolioId portfolioId; - private UserId userId; - - public CreatePortfolioCommand(PortfolioId portfolioId, UserId userId) { - this.portfolioId = portfolioId; - this.userId = userId; - } - - public UserId getUserId() { - return userId; - } - - public PortfolioId getPortfolioId() { - return portfolioId; - } -} diff --git a/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/PortfolioCreatedEvent.java b/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/PortfolioCreatedEvent.java deleted file mode 100644 index 699a620..0000000 --- a/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/PortfolioCreatedEvent.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2010-2012. Axon Framework - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.axonframework.samples.trader.api.portfolio; - -import org.axonframework.samples.trader.api.orders.trades.PortfolioId; -import org.axonframework.samples.trader.api.users.UserId; - -/** - * @author Jettro Coenradie - */ -public class PortfolioCreatedEvent { - - private PortfolioId portfolioId; - private UserId userId; - - public PortfolioCreatedEvent(PortfolioId portfolioId, UserId userId) { - this.portfolioId = portfolioId; - this.userId = userId; - } - - public UserId getUserId() { - return this.userId; - } - - public PortfolioId getPortfolioId() { - return this.portfolioId; - } -} diff --git a/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/commands.kt b/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/commands.kt index 8b8e43b..0e28b13 100644 --- a/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/commands.kt +++ b/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/commands.kt @@ -1,12 +1,10 @@ package org.axonframework.samples.trader.api.portfolio.cash -import org.axonframework.commandhandling.TargetAggregateIdentifier import org.axonframework.samples.trader.api.orders.transaction.TransactionId +import org.axonframework.samples.trader.api.portfolio.PortfolioCommand import org.axonframework.samples.trader.api.portfolio.PortfolioId import javax.validation.constraints.Min -abstract class PortfolioCommand(@TargetAggregateIdentifier open val portfolioId: PortfolioId) - data class CancelCashReservationCommand( override val portfolioId: PortfolioId, val transactionId: TransactionId, diff --git a/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/events.kt b/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/events.kt index cdfdd88..5f52747 100644 --- a/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/events.kt +++ b/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/cash/events.kt @@ -1,9 +1,8 @@ package org.axonframework.samples.trader.api.portfolio.cash -import org.axonframework.samples.trader.api.orders.trades.PortfolioId import org.axonframework.samples.trader.api.orders.transaction.TransactionId - -abstract class PortfolioEvent(open val portfolioId: PortfolioId) +import org.axonframework.samples.trader.api.portfolio.PortfolioEvent +import org.axonframework.samples.trader.api.portfolio.PortfolioId data class CashDepositedEvent( override val portfolioId: PortfolioId, diff --git a/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/commands.kt b/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/commands.kt new file mode 100644 index 0000000..66097a5 --- /dev/null +++ b/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/commands.kt @@ -0,0 +1,11 @@ +package org.axonframework.samples.trader.api.portfolio + +import org.axonframework.commandhandling.TargetAggregateIdentifier +import org.axonframework.samples.trader.api.users.UserId + +abstract class PortfolioCommand(@TargetAggregateIdentifier open val portfolioId: PortfolioId) + +data class CreatePortfolioCommand( + override val portfolioId: PortfolioId, + val userId: UserId +) : PortfolioCommand(portfolioId) diff --git a/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/events.kt b/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/events.kt new file mode 100644 index 0000000..64285e3 --- /dev/null +++ b/core-api/src/main/java/org/axonframework/samples/trader/api/portfolio/events.kt @@ -0,0 +1,10 @@ +package org.axonframework.samples.trader.api.portfolio + +import org.axonframework.samples.trader.api.users.UserId + +abstract class PortfolioEvent(open val portfolioId: PortfolioId) + +class PortfolioCreatedEvent( + override val portfolioId: PortfolioId, + val userId: UserId +) : PortfolioEvent(portfolioId)