rkoti-monster / employer-account-service

First version of employer account service
0 stars 1 forks source link

some minor comment #1

Open amywong-monster opened 4 years ago

amywong-monster commented 4 years ago

@rkoti-monster Sorry for my late reply. I didn't do anything over the weekend. It looks good and I learned a lot. Some comment

rkoti-monster commented 4 years ago

Thanks @amywong-monster for the review.

Incorporated your first two comments.

The service layer is already in traits. The "accessors" are defined in a package object as suggested in https://zio.dev/docs/howto/howto_use_layers

trait UserService {
    def get(id: Long): Task[User]

    def getAll: Task[List[User]]

    def create(user: User): Task[User]

    def delete(id: Long): Task[Boolean]

    def update(user: User): Task[Boolean]
  }

  trait AccountService {
    def getAccount(id: String): Task[Account]

    def getAllAccounts: Task[List[Account]]

    def createAccount(account: Account): Task[Account]

    def deleteAccount(id: String): Task[Boolean]

    def updateAccount(account: Account): Task[Boolean]
  }