package fr.rolandl.mymovies.bo

import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient

@Serializable
data class Film(val title: String,
                val releaseYear: Int,
                val directedBy: Int,
                val actors: List<Int>,
                val duration: Int,
                val genres: List<Genre>,
                @Transient private var directorPerson: Person? = null,
                @Transient private var actorsPerson: List<Person>? = null
)
{

  @Serializable
  enum class Genre
  {

    Action,
    Horror,
    Comedy,
    Documentary,
    Thriller,
    Melodrama,
    Animation,
    ScienceFiction
  }

  val id: Int
    get() = hashCode()

  override fun toString(): String
  {
    return "Film(title='$title', releaseYear=$releaseYear, duration=$duration, genres=$genres, directorPerson=$directorPerson, actorsPerson=$actorsPerson)"
  }

}