Closed EddiOS42 closed 2 years ago
It looks like it failed on compile. My guess is while you were adding the values in, you must have missed a brace or something which is why it's complaining.
Thanks, I figured it was some syntax issues. The last error it's throwing me is for the resTimeTypes. I'm not quite sure what's the correct format for the sequence.
The implementation of the case class can be found in ResyBookingBot.scala
at the bottom which will give you some hint.
final case class ReservationDetails(
date: String,
partySize: Int,
venueId: Int,
resTimeTypes: Seq[ReservationTimeType]
)
final case class ReservationTimeType(reservationTime: String, tableType: Option[String] = None)
As you can see, it's a Seq
of ReservationTimeType
which takes two parameters, a String and an Option of String. So you would have to pass something like the following...
Seq(ReservationTimeType("18:00:00", Some("Patio")))
One other tiny tip though. I made a convenience function (see below) so that you don't have to pass a Some
or None
for the tableType.
object ReservationTimeType {
def apply(reservationTime: String, tableType: String): ReservationTimeType = {
ReservationTimeType(reservationTime, Some(tableType))
}
}
So with the above convience function, you can just do...
Seq(ReservationTimeType("18:00:00", "Patio"))
Thank you for explaining it in detail!
FYI since a lot of people had some confusion around how to set the reservation time and table type, I made a change to hopefully make this a little bit more clear 👉 https://github.com/Alkaar/resy-booking-bot/pull/54
I've added all the values in but when I type "sbt run" and enter, it shows these errors.