Reorder correspondent person suggestion based on org relationship

This commit is contained in:
Eike Kettner
2020-12-01 21:57:01 +01:00
parent d4470ab5fd
commit 290989f67f
3 changed files with 82 additions and 13 deletions

View File

@ -0,0 +1,18 @@
package docspell.common
import io.circe._
import io.circe.generic.semiauto._
case class PersonRef(id: Ident, name: String, organization: Option[Ident]) {
def toIdRef: IdRef =
IdRef(id, name)
}
object PersonRef {
implicit val jsonEncoder: Encoder[PersonRef] =
deriveEncoder[PersonRef]
implicit val jsonDecoder: Decoder[PersonRef] =
deriveDecoder[PersonRef]
}