package models.services
import forms._
import models._
import org.squeryl._
import org.squeryl.PrimitiveTypeMode._

case class ReplyManager() {
  def insert(reply: ReplyForm, replyUser: User, notifyId: Long, replyId: Long) = {
    PartsListDb.replies.insert(Reply(reply.message, replyUser.id, notifyId, replyId, reply.atach))
  }
  
  def getById(id: Long):Reply = {
    PartsListDb.replies.where(tr => tr.id === id).head
  }

}