super(PurchaseTicketCommand.class);
this.repository = repository;
}
public void handleMessage(PurchaseTicketCommand command) {
Lottery lottery = repository.getByVersionedId(Lottery.class, command.getLotteryId());
Customer customer = repository.getByVersionedId(Customer.class, command.getCustomerId());
lottery.purchaseTicketForCustomer(customer);
}