/SendMoneyCommand.java Secret
Created
April 10, 2022 17:53
SendMoneyCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package buckpal.application.port.in; | |
import buckpal.common.SelfValidating; | |
import buckpal.domain.Account.AccountId; | |
import buckpal.domain.Money; | |
import lombok.EqualsAndHashCode; | |
import lombok.Getter; | |
import lombok.Value; | |
import javax.validation.constraints.NotNull; | |
@Value | |
@Getter | |
@EqualsAndHashCode(callSuper = false) | |
public class SendMoneyCommand extends SelfValidating<SendMoneyCommand> { | |
@NotNull | |
private final AccountId sourceAccountId; | |
@NotNull | |
private final AccountId targetAccountId; | |
@NotNull | |
private final Money money; | |
public SendMoneyCommand( | |
AccountId sourceAccountId, | |
AccountId targetAccountId, | |
Money money) { | |
this.sourceAccountId = sourceAccountId; | |
this.targetAccountId = targetAccountId; | |
this.money = money; | |
this.validateSelf(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment