1 /*
2  *  Make.org Core API
3  *  Copyright (C) 2020 Make.org
4  *
5  * This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU Affero General Public License as
7  *  published by the Free Software Foundation, either version 3 of the
8  *  License, or (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Affero General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Affero General Public License
16  *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  *
18  */
19 
20 package org.make.api.technical
21 
22 import cats.data.NonEmptyList
23 import enumeratum.values.{StringEnum, StringEnumEntry}
24 import enumeratum.{Enum, EnumEntry}
25 import eu.timepit.refined.api.{RefType, Refined, Validate}
26 import eu.timepit.refined.refineV
27 import io.circe.{KeyDecoder, KeyEncoder}
28 import scalikejdbc.{Binders, ParameterBinderFactory, TypeBinder}
29 import org.make.core.StringValue
30 import org.make.core.technical.Multilingual
31 import org.make.core.crmTemplate.{CrmLanguageTemplateId, CrmQuestionTemplateId, CrmTemplateKind, TemplateId}
32 import org.make.core.demographics.{DemographicsCard, DemographicsCardId, LabelsValue}
33 import org.make.core.feature.{ActiveFeatureId, FeatureId}
34 import org.make.core.operation.OperationId
35 import org.make.core.question.QuestionId
36 import org.make.core.reference.{Country, Language}
37 import org.make.core.sequence.{ExplorationSequenceConfigurationId, ExplorationSortAlgorithm, SequenceKind}
38 import org.make.core.tag.{TagId, TagTypeId}
39 import org.make.core.user.{OidcInfo, UserId, UserType}
40 import org.make.core.widget.{SourceId, Widget, WidgetId}
41 
42 import java.sql.{PreparedStatement, ResultSet}
43 
44 object ScalikeSupport {
45 
46   def enumBinders[A <: EnumEntry](implicit basicEnum: Enum[A]): Binders[A] =
47     Binders.string.xmap(basicEnum.withName, _.entryName)
48 
49   implicit val crmTemplateKindBinders: Binders[CrmTemplateKind] = enumBinders
50   implicit val demographicsCardLayoutBinders: Binders[DemographicsCard.Layout] = enumBinders
51   implicit val widgetVersionBinders: Binders[Widget.Version] = enumBinders
52   implicit val sequenceKindBinders: Binders[SequenceKind] = enumBinders
53 
54   implicit def stringEnumBinders[A <: StringEnumEntry](implicit stringEnum: StringEnum[A]): Binders[A] =
55     Binders.string.xmap(stringEnum.withValue, _.value)
56 
57   implicit def stringEnumEntryParameterBinderFactory[A <: StringEnumEntry, B <: A]: ParameterBinderFactory[B] =
58     ParameterBinderFactory.stringParameterBinderFactory.contramap(_.value)
59 
60   def stringValueBinders[A <: StringValue](f: String => A): Binders[A] = Binders.string.xmap(f, _.value)
61 
62   implicit val activeFeatureIdBinders: Binders[ActiveFeatureId] = stringValueBinders(ActiveFeatureId.apply)
63   implicit val crmLanguageTemplateIdBinders: Binders[CrmLanguageTemplateId] = stringValueBinders(
64     CrmLanguageTemplateId.apply
65   )
66   implicit val crmQuestionTemplateIdBinders: Binders[CrmQuestionTemplateId] = stringValueBinders(
67     CrmQuestionTemplateId.apply
68   )
69   implicit val countryBinders: Binders[Country] = stringValueBinders(Country.apply)
70   implicit val demographicsCardIdBinders: Binders[DemographicsCardId] = stringValueBinders(DemographicsCardId.apply)
71   implicit val featureIdBinders: Binders[FeatureId] = stringValueBinders(FeatureId.apply)
72   implicit val languageBinders: Binders[Language] = stringValueBinders(Language.apply)
73   implicit val operationIdBinders: Binders[OperationId] = stringValueBinders(OperationId.apply)
74   implicit val questionIdBinders: Binders[QuestionId] = stringValueBinders(QuestionId.apply)
75   implicit val sourceIdBinders: Binders[SourceId] = stringValueBinders(SourceId.apply)
76   implicit val tagIdBinders: Binders[TagId] = stringValueBinders(TagId.apply)
77   implicit val tagTypeIdBinders: Binders[TagTypeId] = stringValueBinders(TagTypeId.apply)
78   implicit val templateIdBinders: Binders[TemplateId] = stringValueBinders(TemplateId.apply)
79   implicit val userIdBinders: Binders[UserId] = stringValueBinders(UserId.apply)
80   implicit val widgetIdBinders: Binders[WidgetId] = stringValueBinders(WidgetId.apply)
81   implicit val ExplorationSequenceConfigurationIdBinders: Binders[ExplorationSequenceConfigurationId] =
82     stringValueBinders(ExplorationSequenceConfigurationId.apply)
83 
84   implicit val userTypeBinders: Binders[UserType] = stringEnumBinders[UserType]
85   implicit val explorationSortAlgorithmBinders: Binders[ExplorationSortAlgorithm] = {
86     stringEnumBinders[ExplorationSortAlgorithm]
87   }
88 
89   /*
90    * The following code is a copy-paste from https://github.com/katainaka0503/scalikejdbc-refined
91    **/
92   implicit def refinedParameterBinderFactory[T, P, F[_, _]](
93     implicit
94     based: ParameterBinderFactory[T],
95     refType: RefType[F]
96   ): ParameterBinderFactory[F[T, P]] =
97     based.contramap(refType.unwrap)
98 
99   implicit def refinedTypeBinder[T, P](
100     implicit validate: Validate[T, P],
101     based: TypeBinder[T]
102   ): TypeBinder[Refined[T, P]] =
103     based.map(refineV[P].unsafeFrom(_))
104 
105   import io.circe.{Decoder, Encoder}
106   import io.circe.parser.decode
107   import io.circe.syntax._
108 
109   @SuppressWarnings(Array("org.wartremover.warts.Throw", "org.wartremover.warts.TryPartial"))
110   def jsonNelBinder[T: Encoder: Decoder]: Binders[NonEmptyList[T]] =
111     Binders.string.xmap(decode[NonEmptyList[T]](_).toTry.get, _.asJson.noSpaces)
112 
113   @SuppressWarnings(Array("org.wartremover.warts.AsInstanceOf"))
114   implicit val languagesTypeBinder: TypeBinder[NonEmptyList[Language]] = new TypeBinder[NonEmptyList[Language]] {
115     def apply(rs: ResultSet, idx: Int): NonEmptyList[Language] =
116       NonEmptyList.fromListUnsafe(rs.getArray(idx).getArray.asInstanceOf[Array[String]].toList.map(Language.apply))
117 
118     def apply(rs: ResultSet, label: String): NonEmptyList[Language] =
119       NonEmptyList.fromListUnsafe(rs.getArray(label).getArray.asInstanceOf[Array[String]].toList.map(Language.apply))
120   }
121   implicit val languagesParameterBinder: ParameterBinderFactory[NonEmptyList[Language]] = ParameterBinderFactory {
122     value => (stmt, idx) =>
123       stmt.setArray(idx, stmt.getConnection.createArrayOf("VARCHAR", value.map(_.value).toList.toArray))
124   }
125 
126   implicit val mapConverter: Binders[Map[String, String]] =
127     Binders.string.xmap(decode[Map[String, String]](_).getOrElse(Map.empty), _.asJson.noSpaces)
128 
129   def optCustomMapConverter[K: KeyDecoder: KeyEncoder, V: Decoder: Encoder]: Binders[Option[Map[K, V]]] =
130     Binders.string.xmap(l => decode[Option[Map[K, V]]](l).toOption.flatten, _.asJson.noSpaces)
131 
132   implicit val oidcInfosParameterBinder: ParameterBinderFactory[Option[Map[OperationId, OidcInfo]]] =
133     ParameterBinderFactory { oidcInfos => (stmt: PreparedStatement, idx: Int) =>
134       stmt.setObject(idx, oidcInfos.asJson.noSpaces)
135     }
136 
137   implicit val labelValuesBinder: Binders[LabelsValue] =
138     Binders.string.xmap(decode[LabelsValue](_).getOrElse(LabelsValue(Multilingual.empty, "")), _.asJson.noSpaces)
139 }
Line Stmt Id Pos Tree Symbol Tests Code
47 20144 2000 - 2018 Apply enumeratum.Enum.withName basicEnum.withName(name)
47 21235 1980 - 2032 Apply scalikejdbc.Binders.xmap org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest scalikejdbc.Binders.string.xmap[A](((name: String) => basicEnum.withName(name)), ((x$1: A) => x$1.entryName))
47 21724 2020 - 2031 Select enumeratum.EnumEntry.entryName x$1.entryName
49 20337 2100 - 2111 ApplyToImplicitArgs org.make.api.technical.ScalikeSupport.enumBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.enumBinders[org.make.core.crmTemplate.CrmTemplateKind]((CrmTemplateKind: enumeratum.Enum[org.make.core.crmTemplate.CrmTemplateKind]))
50 21889 2193 - 2204 ApplyToImplicitArgs org.make.api.technical.ScalikeSupport.enumBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.enumBinders[org.make.core.demographics.DemographicsCard.Layout]((Layout: enumeratum.Enum[org.make.core.demographics.DemographicsCard.Layout]))
51 20934 2268 - 2279 ApplyToImplicitArgs org.make.api.technical.ScalikeSupport.enumBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.enumBinders[org.make.core.widget.Widget.Version]((Version: enumeratum.Enum[org.make.core.widget.Widget.Version]))
52 20093 2340 - 2351 ApplyToImplicitArgs org.make.api.technical.ScalikeSupport.enumBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.enumBinders[org.make.core.sequence.SequenceKind]((SequenceKind: enumeratum.Enum[org.make.core.sequence.SequenceKind]))
55 19476 2482 - 2502 Apply enumeratum.values.ValueEnum.withValue stringEnum.withValue(i)
55 20148 2462 - 2512 Apply scalikejdbc.Binders.xmap org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest scalikejdbc.Binders.string.xmap[A](((i: String) => stringEnum.withValue(i)), ((x$2: A) => x$2.value))
55 21156 2504 - 2511 Select enumeratum.values.ValueEnumEntry.value x$2.value
58 21711 2692 - 2699 Select enumeratum.values.ValueEnumEntry.value x$3.value
58 20894 2630 - 2700 Apply scalikejdbc.ParameterBinderFactory.contramap scalikejdbc.ParameterBinderFactory.stringParameterBinderFactory.contramap[B](((x$3: B) => x$3.value))
60 21849 2775 - 2806 Apply scalikejdbc.Binders.xmap org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest scalikejdbc.Binders.string.xmap[A](f, ((x$4: A) => x$4.value))
60 20290 2798 - 2805 Select org.make.core.StringValue.value x$4.value
62 20060 2874 - 2915 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.feature.ActiveFeatureId](((value: String) => org.make.core.feature.ActiveFeatureId.apply(value)))
62 20936 2893 - 2914 Apply org.make.core.feature.ActiveFeatureId.apply org.make.core.feature.ActiveFeatureId.apply(value)
63 21061 2994 - 3049 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.crmTemplate.CrmLanguageTemplateId](((value: String) => org.make.core.crmTemplate.CrmLanguageTemplateId.apply(value)))
64 19600 3018 - 3045 Apply org.make.core.crmTemplate.CrmLanguageTemplateId.apply org.make.core.crmTemplate.CrmLanguageTemplateId.apply(value)
66 21714 3128 - 3183 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.crmTemplate.CrmQuestionTemplateId](((value: String) => org.make.core.crmTemplate.CrmQuestionTemplateId.apply(value)))
67 20103 3152 - 3179 Apply org.make.core.crmTemplate.CrmQuestionTemplateId.apply org.make.core.crmTemplate.CrmQuestionTemplateId.apply(value)
69 20406 3234 - 3267 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.reference.Country](((id: String) => org.make.core.reference.Country.apply(id)))
69 20869 3253 - 3266 Apply org.make.core.reference.Country.apply org.make.core.reference.Country.apply(id)
70 21851 3359 - 3383 Apply org.make.core.demographics.DemographicsCardId.apply org.make.core.demographics.DemographicsCardId.apply(value)
70 20904 3340 - 3384 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.demographics.DemographicsCardId](((value: String) => org.make.core.demographics.DemographicsCardId.apply(value)))
71 20063 3458 - 3473 Apply org.make.core.feature.FeatureId.apply org.make.core.feature.FeatureId.apply(value)
71 19560 3439 - 3474 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.feature.FeatureId](((value: String) => org.make.core.feature.FeatureId.apply(value)))
72 20108 3527 - 3561 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.reference.Language](((id: String) => org.make.core.reference.Language.apply(id)))
72 21148 3546 - 3560 Apply org.make.core.reference.Language.apply org.make.core.reference.Language.apply(id)
73 20875 3620 - 3657 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.operation.OperationId](((value: String) => org.make.core.operation.OperationId.apply(value)))
73 21760 3639 - 3656 Apply org.make.core.operation.OperationId.apply org.make.core.operation.OperationId.apply(value)
74 21938 3714 - 3750 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.question.QuestionId](((value: String) => org.make.core.question.QuestionId.apply(value)))
74 20334 3733 - 3749 Apply org.make.core.question.QuestionId.apply org.make.core.question.QuestionId.apply(value)
75 20018 3803 - 3837 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.widget.SourceId](((value: String) => org.make.core.widget.SourceId.apply(value)))
75 20909 3822 - 3836 Apply org.make.core.widget.SourceId.apply org.make.core.widget.SourceId.apply(value)
76 21672 3903 - 3914 Apply org.make.core.tag.TagId.apply org.make.core.tag.TagId.apply(value)
76 21154 3884 - 3915 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.tag.TagId](((value: String) => org.make.core.tag.TagId.apply(value)))
77 21762 3970 - 4005 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.tag.TagTypeId](((value: String) => org.make.core.tag.TagTypeId.apply(value)))
77 20182 3989 - 4004 Apply org.make.core.tag.TagTypeId.apply org.make.core.tag.TagTypeId.apply(value)
78 20287 4062 - 4098 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.crmTemplate.TemplateId](((value: String) => org.make.core.crmTemplate.TemplateId.apply(value)))
78 20879 4081 - 4097 Apply org.make.core.crmTemplate.TemplateId.apply org.make.core.crmTemplate.TemplateId.apply(value)
79 21943 4166 - 4178 Apply org.make.core.user.UserId.apply org.make.core.user.UserId.apply(value)
79 21054 4147 - 4179 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.user.UserId](((value: String) => org.make.core.user.UserId.apply(value)))
80 21603 4232 - 4266 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.widget.WidgetId](((value: String) => org.make.core.widget.WidgetId.apply(value)))
80 20022 4251 - 4265 Apply org.make.core.widget.WidgetId.apply org.make.core.widget.WidgetId.apply(value)
82 21103 4394 - 4434 Apply org.make.core.sequence.ExplorationSequenceConfigurationId.apply org.make.core.sequence.ExplorationSequenceConfigurationId.apply(value)
82 20188 4375 - 4435 Apply org.make.api.technical.ScalikeSupport.stringValueBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringValueBinders[org.make.core.sequence.ExplorationSequenceConfigurationId](((value: String) => org.make.core.sequence.ExplorationSequenceConfigurationId.apply(value)))
84 21843 4489 - 4516 ApplyToImplicitArgs org.make.api.technical.ScalikeSupport.stringEnumBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringEnumBinders[org.make.core.user.UserType]((UserType: enumeratum.values.StringEnum[org.make.core.user.UserType]))
86 20840 4607 - 4650 ApplyToImplicitArgs org.make.api.technical.ScalikeSupport.stringEnumBinders org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest ScalikeSupport.this.stringEnumBinders[org.make.core.sequence.ExplorationSortAlgorithm]((ExplorationSortAlgorithm: enumeratum.values.StringEnum[org.make.core.sequence.ExplorationSortAlgorithm]))
97 21899 4945 - 4976 Apply scalikejdbc.ParameterBinderFactory.contramap based.contramap[F[T,P]](((tp: F[T,P]) => refType.unwrap[T, P](tp)))
97 19864 4961 - 4975 Apply eu.timepit.refined.api.RefType.unwrap refType.unwrap[T, P](tp)
103 20902 5129 - 5153 ApplyToImplicitArgs eu.timepit.refined.internal.RefinePartiallyApplied.unsafeFrom eu.timepit.refined.`package`.refineV[P].unsafeFrom[T](x$5)(validate)
103 19953 5119 - 5154 Apply scalikejdbc.TypeBinder.map based.map[eu.timepit.refined.api.Refined[T,P]](((x$5: T) => eu.timepit.refined.`package`.refineV[P].unsafeFrom[T](x$5)(validate)))
111 21113 5467 - 5467 TypeApply scala.<:<.refl scala.this.<:<.refl[io.circe.Error]
111 20871 5478 - 5495 Select io.circe.Json.noSpaces io.circe.syntax.`package`.EncoderOps[cats.data.NonEmptyList[T]](x$7).asJson(circe.this.Encoder.encodeNonEmptyList[T](evidence$1)).noSpaces
111 19824 5420 - 5496 Apply scalikejdbc.Binders.xmap scalikejdbc.Binders.string.xmap[cats.data.NonEmptyList[T]](((x$6: String) => io.circe.parser.`package`.decode[cats.data.NonEmptyList[T]](x$6)(circe.this.Decoder.decodeNonEmptyList[T](evidence$2)).toTry(scala.this.<:<.refl[io.circe.Error]).get), ((x$7: cats.data.NonEmptyList[T]) => io.circe.syntax.`package`.EncoderOps[cats.data.NonEmptyList[T]](x$7).asJson(circe.this.Encoder.encodeNonEmptyList[T](evidence$1)).noSpaces))
111 21694 5480 - 5480 ApplyToImplicitArgs io.circe.Encoder.encodeNonEmptyList circe.this.Encoder.encodeNonEmptyList[T](evidence$1)
111 20223 5440 - 5476 Select scala.util.Try.get io.circe.parser.`package`.decode[cats.data.NonEmptyList[T]](x$6)(circe.this.Decoder.decodeNonEmptyList[T](evidence$2)).toTry(scala.this.<:<.refl[io.circe.Error]).get
111 21565 5463 - 5463 ApplyToImplicitArgs io.circe.Decoder.decodeNonEmptyList circe.this.Decoder.decodeNonEmptyList[T](evidence$2)
114 19914 5636 - 5639 Apply org.make.api.technical.ScalikeSupport.$anon.<init> org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest new $anon()
116 19940 5776 - 5856 Apply scala.collection.immutable.List.map scala.Predef.wrapRefArray[String](rs.getArray(idx).getArray().asInstanceOf[Array[String]]).toList.map[org.make.core.reference.Language](((id: String) => org.make.core.reference.Language.apply(id)))
116 21908 5776 - 5829 TypeApply scala.Any.asInstanceOf rs.getArray(idx).getArray().asInstanceOf[Array[String]]
116 21670 5748 - 5857 Apply cats.data.NonEmptyList.fromListUnsafe cats.data.NonEmptyList.fromListUnsafe[org.make.core.reference.Language](scala.Predef.wrapRefArray[String](rs.getArray(idx).getArray().asInstanceOf[Array[String]]).toList.map[org.make.core.reference.Language](((id: String) => org.make.core.reference.Language.apply(id))))
116 21015 5841 - 5855 Apply org.make.core.reference.Language.apply org.make.core.reference.Language.apply(id)
119 20228 6030 - 6044 Apply org.make.core.reference.Language.apply org.make.core.reference.Language.apply(id)
119 21065 5963 - 6018 TypeApply scala.Any.asInstanceOf rs.getArray(label).getArray().asInstanceOf[Array[String]]
119 20831 5935 - 6046 Apply cats.data.NonEmptyList.fromListUnsafe cats.data.NonEmptyList.fromListUnsafe[org.make.core.reference.Language](scala.Predef.wrapRefArray[String](rs.getArray(label).getArray().asInstanceOf[Array[String]]).toList.map[org.make.core.reference.Language](((id: String) => org.make.core.reference.Language.apply(id))))
119 21697 5963 - 6045 Apply scala.collection.immutable.List.map scala.Predef.wrapRefArray[String](rs.getArray(label).getArray().asInstanceOf[Array[String]]).toList.map[org.make.core.reference.Language](((id: String) => org.make.core.reference.Language.apply(id)))
121 20232 6141 - 6302 Apply scalikejdbc.ParameterBinderFactory.apply org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest scalikejdbc.ParameterBinderFactory.apply[cats.data.NonEmptyList[org.make.core.reference.Language]](((value: cats.data.NonEmptyList[org.make.core.reference.Language]) => ((stmt: java.sql.PreparedStatement, idx: Int) => stmt.setArray(idx, stmt.getConnection().createArrayOf("VARCHAR", value.map[String](((x$8: org.make.core.reference.Language) => x$8.value)).toList.toArray[Object]((ClassTag.apply[Object](classOf[java.lang.Object]): scala.reflect.ClassTag[Object])))))))
123 21023 6273 - 6280 Select org.make.core.reference.Language.value x$8.value
123 21965 6252 - 6261 Literal <nosymbol> "VARCHAR"
123 21644 6219 - 6297 Apply java.sql.Connection.createArrayOf stmt.getConnection().createArrayOf("VARCHAR", value.map[String](((x$8: org.make.core.reference.Language) => x$8.value)).toList.toArray[Object]((ClassTag.apply[Object](classOf[java.lang.Object]): scala.reflect.ClassTag[Object])))
123 20699 6200 - 6298 Apply java.sql.PreparedStatement.setArray stmt.setArray(idx, stmt.getConnection().createArrayOf("VARCHAR", value.map[String](((x$8: org.make.core.reference.Language) => x$8.value)).toList.toArray[Object]((ClassTag.apply[Object](classOf[java.lang.Object]): scala.reflect.ClassTag[Object]))))
123 20019 6263 - 6296 ApplyToImplicitArgs scala.collection.IterableOnceOps.toArray value.map[String](((x$8: org.make.core.reference.Language) => x$8.value)).toList.toArray[Object]((ClassTag.apply[Object](classOf[java.lang.Object]): scala.reflect.ClassTag[Object]))
127 20838 6415 - 6415 Select io.circe.Decoder.decodeString circe.this.Decoder.decodeString
127 21824 6368 - 6459 Apply scalikejdbc.Binders.xmap org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest scalikejdbc.Binders.string.xmap[Map[String,String]](((x$9: String) => io.circe.parser.`package`.decode[Map[String,String]](x$9)(circe.this.Decoder.decodeMap[String, String](circe.this.KeyDecoder.decodeKeyString, circe.this.Decoder.decodeString)).getOrElse[Map[String,String]](scala.Predef.Map.empty[String, Nothing])), ((x$10: Map[String,String]) => io.circe.syntax.`package`.EncoderOps[Map[String,String]](x$10).asJson(circe.this.Encoder.encodeMap[String, String](circe.this.KeyEncoder.encodeKeyString, circe.this.Encoder.encodeString)).noSpaces))
127 21896 6429 - 6438 TypeApply scala.collection.immutable.Map.empty scala.Predef.Map.empty[String, Nothing]
127 19979 6443 - 6443 Select io.circe.KeyEncoder.encodeKeyString circe.this.KeyEncoder.encodeKeyString
127 20155 6441 - 6458 Select io.circe.Json.noSpaces io.circe.syntax.`package`.EncoderOps[Map[String,String]](x$10).asJson(circe.this.Encoder.encodeMap[String, String](circe.this.KeyEncoder.encodeKeyString, circe.this.Encoder.encodeString)).noSpaces
127 19895 6415 - 6415 ApplyToImplicitArgs io.circe.Decoder.decodeMap circe.this.Decoder.decodeMap[String, String](circe.this.KeyDecoder.decodeKeyString, circe.this.Decoder.decodeString)
127 21028 6388 - 6439 Apply scala.util.Either.getOrElse io.circe.parser.`package`.decode[Map[String,String]](x$9)(circe.this.Decoder.decodeMap[String, String](circe.this.KeyDecoder.decodeKeyString, circe.this.Decoder.decodeString)).getOrElse[Map[String,String]](scala.Predef.Map.empty[String, Nothing])
127 20624 6443 - 6443 ApplyToImplicitArgs io.circe.Encoder.encodeMap circe.this.Encoder.encodeMap[String, String](circe.this.KeyEncoder.encodeKeyString, circe.this.Encoder.encodeString)
127 21817 6415 - 6415 Select io.circe.KeyDecoder.decodeKeyString circe.this.KeyDecoder.decodeKeyString
127 21649 6443 - 6443 Select io.circe.Encoder.encodeString circe.this.Encoder.encodeString
130 19983 6645 - 6645 ApplyToImplicitArgs io.circe.Encoder.encodeMap circe.this.Encoder.encodeMap[K, V](evidence$4, evidence$6)
130 20790 6621 - 6621 ApplyToImplicitArgs io.circe.Decoder.decodeMap circe.this.Decoder.decodeMap[K, V](evidence$3, evidence$5)
130 20161 6571 - 6661 Apply scalikejdbc.Binders.xmap org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest scalikejdbc.Binders.string.xmap[Option[Map[K,V]]](((l: String) => io.circe.parser.`package`.decode[Option[Map[K,V]]](l)(circe.this.Decoder.decodeOption[Map[K,V]](circe.this.Decoder.decodeMap[K, V](evidence$3, evidence$5))).toOption.flatten[Map[K,V]](scala.this.<:<.refl[Option[Map[K,V]]])), ((x$11: Option[Map[K,V]]) => io.circe.syntax.`package`.EncoderOps[Option[Map[K,V]]](x$11).asJson(circe.this.Encoder.encodeOption[Map[K,V]](circe.this.Encoder.encodeMap[K, V](evidence$4, evidence$6))).noSpaces))
130 20941 6596 - 6641 ApplyToImplicitArgs scala.Option.flatten io.circe.parser.`package`.decode[Option[Map[K,V]]](l)(circe.this.Decoder.decodeOption[Map[K,V]](circe.this.Decoder.decodeMap[K, V](evidence$3, evidence$5))).toOption.flatten[Map[K,V]](scala.this.<:<.refl[Option[Map[K,V]]])
130 20630 6643 - 6660 Select io.circe.Json.noSpaces io.circe.syntax.`package`.EncoderOps[Option[Map[K,V]]](x$11).asJson(circe.this.Encoder.encodeOption[Map[K,V]](circe.this.Encoder.encodeMap[K, V](evidence$4, evidence$6))).noSpaces
130 21610 6645 - 6645 ApplyToImplicitArgs io.circe.Encoder.encodeOption circe.this.Encoder.encodeOption[Map[K,V]](circe.this.Encoder.encodeMap[K, V](evidence$4, evidence$6))
130 21906 6634 - 6634 TypeApply scala.<:<.refl scala.this.<:<.refl[Option[Map[K,V]]]
130 19899 6621 - 6621 ApplyToImplicitArgs io.circe.Decoder.decodeOption circe.this.Decoder.decodeOption[Map[K,V]](circe.this.Decoder.decodeMap[K, V](evidence$3, evidence$5))
133 20068 6769 - 6904 Apply scalikejdbc.ParameterBinderFactory.apply org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest scalikejdbc.ParameterBinderFactory.apply[Option[Map[org.make.core.operation.OperationId,org.make.core.user.OidcInfo]]](((oidcInfos: Option[Map[org.make.core.operation.OperationId,org.make.core.user.OidcInfo]]) => ((stmt: java.sql.PreparedStatement, idx: Int) => stmt.setObject(idx, io.circe.syntax.`package`.EncoderOps[Option[Map[org.make.core.operation.OperationId,org.make.core.user.OidcInfo]]](oidcInfos).asJson(circe.this.Encoder.encodeOption[Map[org.make.core.operation.OperationId,org.make.core.user.OidcInfo]](circe.this.Encoder.encodeMap[org.make.core.operation.OperationId, org.make.core.user.OidcInfo](operation.this.OperationId.operationIdKeyEncoder, user.this.OidcInfo.encoder))).noSpaces))))
134 21809 6882 - 6882 Select org.make.core.operation.OperationId.operationIdKeyEncoder operation.this.OperationId.operationIdKeyEncoder
134 21426 6872 - 6897 Select io.circe.Json.noSpaces io.circe.syntax.`package`.EncoderOps[Option[Map[org.make.core.operation.OperationId,org.make.core.user.OidcInfo]]](oidcInfos).asJson(circe.this.Encoder.encodeOption[Map[org.make.core.operation.OperationId,org.make.core.user.OidcInfo]](circe.this.Encoder.encodeMap[org.make.core.operation.OperationId, org.make.core.user.OidcInfo](operation.this.OperationId.operationIdKeyEncoder, user.this.OidcInfo.encoder))).noSpaces
134 20795 6882 - 6882 ApplyToImplicitArgs io.circe.Encoder.encodeMap circe.this.Encoder.encodeMap[org.make.core.operation.OperationId, org.make.core.user.OidcInfo](operation.this.OperationId.operationIdKeyEncoder, user.this.OidcInfo.encoder)
134 19828 6882 - 6882 ApplyToImplicitArgs io.circe.Encoder.encodeOption circe.this.Encoder.encodeOption[Map[org.make.core.operation.OperationId,org.make.core.user.OidcInfo]](circe.this.Encoder.encodeMap[org.make.core.operation.OperationId, org.make.core.user.OidcInfo](operation.this.OperationId.operationIdKeyEncoder, user.this.OidcInfo.encoder))
134 20946 6852 - 6898 Apply java.sql.PreparedStatement.setObject stmt.setObject(idx, io.circe.syntax.`package`.EncoderOps[Option[Map[org.make.core.operation.OperationId,org.make.core.user.OidcInfo]]](oidcInfos).asJson(circe.this.Encoder.encodeOption[Map[org.make.core.operation.OperationId,org.make.core.user.OidcInfo]](circe.this.Encoder.encodeMap[org.make.core.operation.OperationId, org.make.core.user.OidcInfo](operation.this.OperationId.operationIdKeyEncoder, user.this.OidcInfo.encoder))).noSpaces)
138 21430 7058 - 7075 Select io.circe.Json.noSpaces io.circe.syntax.`package`.EncoderOps[org.make.core.demographics.LabelsValue](x$13).asJson(demographics.this.LabelsValue.codec).noSpaces
138 21615 7006 - 7006 Select org.make.core.demographics.LabelsValue.codec demographics.this.LabelsValue.codec
138 20634 7032 - 7050 TypeApply org.make.core.technical.Multilingual.empty org.make.core.technical.Multilingual.empty[String]
138 20983 6967 - 7076 Apply scalikejdbc.Binders.xmap org.scalatest.testsuite,org.make.api.user.persistentuserservicecomponenttest scalikejdbc.Binders.string.xmap[org.make.core.demographics.LabelsValue](((x$12: String) => io.circe.parser.`package`.decode[org.make.core.demographics.LabelsValue](x$12)(demographics.this.LabelsValue.codec).getOrElse[org.make.core.demographics.LabelsValue](org.make.core.demographics.LabelsValue.apply(org.make.core.technical.Multilingual.empty[String], ""))), ((x$13: org.make.core.demographics.LabelsValue) => io.circe.syntax.`package`.EncoderOps[org.make.core.demographics.LabelsValue](x$13).asJson(demographics.this.LabelsValue.codec).noSpaces))
138 21814 7020 - 7055 Apply org.make.core.demographics.LabelsValue.apply org.make.core.demographics.LabelsValue.apply(org.make.core.technical.Multilingual.empty[String], "")
138 20115 7052 - 7054 Literal <nosymbol> ""
138 20878 6987 - 7056 Apply scala.util.Either.getOrElse io.circe.parser.`package`.decode[org.make.core.demographics.LabelsValue](x$12)(demographics.this.LabelsValue.codec).getOrElse[org.make.core.demographics.LabelsValue](org.make.core.demographics.LabelsValue.apply(org.make.core.technical.Multilingual.empty[String], ""))
138 19789 7060 - 7060 Select org.make.core.demographics.LabelsValue.codec demographics.this.LabelsValue.codec