I'm new to scala and I'm trying to get to construct a list from another one which I get from a scala object this is my model:
case class Session(
_id: Option[String],
participants: Option[Seq[Participant]])
case class Participant(
contact: Contact,
participantStatus: Option[String])
Contact.scala
case class Contact(
firstName: Option[FirstName],
lastName: Option[LastName],
address: Option[Address])
Address.scala
case class Address(
email: Option[String])
using this loop:
for (s <- session.participants) println(s)
I get :
List(Participant(Contact(Some(FirstName(5m,Some(5),Some(5))),Some(LastName(5,Some(5),Some(5))),Some(Address(None,None,None,None,None,Some(5),Some(5),Some(5),Some([email protected]),None)),None,None),None), Participant(Contact(Some(FirstName(contact1,Some(contact1),Some(contact1))),Some(LastName(contact1,Some(contact1),Some(contact1))),Some(Address(None,None,None,None,None,Some(1),Some(1),Some(1),Some([email protected]),None)),None,None),None))
when I try : println(s.contact)
I get : value contact is not a member of Seq[models.Session.Participant]