SHARE
TWEET

Codecs for circee

mitrakov Mar 26th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // see https://pastebin.com/6QWecwUA
  2.  
  3. import com.elama.bidmanager.settings.db.JsonMeta
  4. import doobie.util.meta.Meta
  5. import io.circe.{Decoder, Encoder}
  6.  
  7. case class OldBidmanagerSchedule(Mo: Option[Seq[Int]],
  8.                                  Tu: Option[Seq[Int]],
  9.                                  We: Option[Seq[Int]],
  10.                                  Th: Option[Seq[Int]],
  11.                                  Fr: Option[Seq[Int]],
  12.                                  Sa: Option[Seq[Int]],
  13.                                  Su: Option[Seq[Int]])
  14.  
  15. trait OldBidmanagerScheduleCodecs {
  16.   import io.circe.generic.extras._
  17.   import io.circe.generic.extras.semiauto._
  18.  
  19.   implicit val oldBidmanagerScheduleConfig: Configuration = Configuration.default
  20.  
  21.   implicit val oldBidmanagerScheduleDecoder: Decoder[OldBidmanagerSchedule] = deriveDecoder
  22.   implicit val oldBidmanagerScheduleEncoder: Encoder[OldBidmanagerSchedule] = deriveEncoder
  23. }
  24.  
  25. trait OldBidmanagerScheduleMeta extends OldBidmanagerScheduleCodecs with JsonMeta {
  26.   implicit val oldBidmanagerScheduleMeta: Meta[OldBidmanagerSchedule] = codecMeta[OldBidmanagerSchedule]
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top