Skip to content

Instantly share code, notes, and snippets.

@akehoyayoi
Last active July 17, 2019 21:57
Show Gist options
  • Save akehoyayoi/a65e4b9f2aaac264eceade8622fa89e8 to your computer and use it in GitHub Desktop.
Save akehoyayoi/a65e4b9f2aaac264eceade8622fa89e8 to your computer and use it in GitHub Desktop.
// under construction ...
sealed trait BusinessDaySpec
case object WorkDay extends BusinessDaySpec
case object Holiday extends BusinessDaySpec
sealed trait MovieDaySpec
case object MovieDay extends MovieDaySpec
sealed trait TimeSpec
case object NormalTime extends TimeSpec
case object LateshowTime extends TimeSpec
sealed trait HaveSpec
case object HaveCinemaCitizen extends HaveSpec
case object HaveID extends HaveSpec
case object HaveStudentLicense extends HaveSpec
case object HaveStudentNote extends HaveSpec
case object HaveHandicapped extends HaveSpec
case object HaveMIcard extends HaveSpec
case object HaveParking extends HaveSpec
case class Customer(has: HaveSpec)
case class TicketFee(customer: Customer,
businessDaySpec: BusinessDaySpec,
timeSpec: TimeSpec,
movieDaySpec: Option[MovieDaySpec],
fee: Int)
val a = TicketFee(
customer = Customer(has = HaveCinemaCitizen),
businessDaySpec = WorkDay,
timeSpec = NormalTime,
movieDaySpec = None,
fee = 1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment