Alkaar / resy-booking-bot

🔫 Helps to snipe hard to get reservations at restaurants that use resy
409 stars 215 forks source link

Getting some errors when running the build #27

Closed EddiOS42 closed 2 years ago

EddiOS42 commented 2 years ago

I've added all the values in but when I type "sbt run" and enter, it shows these errors.

Screen Shot 2022-08-14 at 4 26 00 PM

Alkaar commented 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.

EddiOS42 commented 2 years ago

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. Screen Shot 2022-08-14 at 8 59 48 PM

Alkaar commented 2 years ago

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"))
EddiOS42 commented 2 years ago

Thank you for explaining it in detail!

Alkaar commented 2 years ago

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