# Where does the implementation of a command / domainLogic go?

  • Commands must be implementated inside the respective CommandSetCode class inside the domain module's src folder.

    For example: create command defined inside Lottery command set will need to be implemented inside LotteryCommandSetCode.scala

    class LotteryCommandSetCode(domainLogicRef:DomainLogicRef) extends LotteryCommandSetCommands {
          override def create = CreateCommand {
              import CreateCommand._
              input: Input =>
              //todo: command logic goes here
          }
    }
    
  • Domain Logic function must be implementated inside the generated DomainLogicCode class inside the domain module's src folder.

    For example: lotteryNameExists function defined inside Lottery domain logic will need to be implemented inside LotteryDomainLogicCode.scala

    class LotteryDomainLogicCode extends LotteryDomainLogic {
      override def lotteryNameExists(lotteryName: String): Boolean = {
        LotteryQuery().lotteryName.equalsIgnoreCase(lotteryName).exists
      }
    	...
    }