-
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: create config file for reservation preferences (#54)
BREAKING CHANGE: The reservation config now lives in an actual config file separate from the code implementation
- Loading branch information
Showing
5 changed files
with
84 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
############ | ||
# ResyKeys # | ||
############ | ||
# Your user profile API key which can be found via your browser web console in your headers called "authorization" | ||
# e.g. | ||
# resyKeys.api-key="MY_API_KEY" | ||
resyKeys.api-key= | ||
# Your user profile authentication token which can be found via your browser web console in your headers called | ||
# "x-resy-auth-token" | ||
# e.g. | ||
# resyKeys.auth-token="MY_AUTH_TOKEN" | ||
resyKeys.auth-token= | ||
|
||
###################### | ||
# ReservationDetails # | ||
###################### | ||
# Date of the reservation in YYYY-MM-DD format | ||
# e.g. | ||
# resDetails.date="2099-01-30" | ||
resDetails.date= | ||
# Size of the party reservation | ||
# e.g. | ||
# resDetails.party-size=2 | ||
resDetails.party-size= | ||
# Unique identifier of the restaurant where you want to make the reservation | ||
# e.g. | ||
# resDetails.venue-id=123 | ||
resDetails.venue-id= | ||
# Priority list of reservation times and table types. Time is in military time HH:MM:SS format. If no preference on | ||
# table type, then simply don't set it. | ||
# e.g. | ||
# resDetails.res-time-types=[ | ||
# {reservation-time="18:00:00", table-type="Dining Room"}, | ||
# {reservation-time="18:00:00", table-type="Patio"}, | ||
# {reservation-time="18:15:00"} | ||
# ] | ||
resDetails.res-time-types= | ||
|
||
############# | ||
# SnipeTime # | ||
############# | ||
# Hour of the day when reservations become available and when you want to snipe | ||
# e.g. | ||
# snipeTime.hours=9 | ||
snipeTime.hours= | ||
# Minute of the day when reservations become available and when you want to snipe | ||
# e.g. | ||
# snipeTime.minutes=0 | ||
snipeTime.minutes= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,21 @@ | ||
package com.resy | ||
|
||
object ResyConfig { | ||
final case class ResyKeys(apiKey: String, authToken: String) | ||
|
||
val resyKeys: ResyKeys = ResyKeys( | ||
// Your user profile API key which can be found via your browser web console in your headers | ||
// called "authorization" | ||
apiKey = ???, | ||
// Your user profile authentication token which can be found via your browser web console in | ||
// your headers called "x-resy-auth-token" | ||
authToken = ??? | ||
) | ||
final case class ReservationDetails( | ||
date: String, | ||
partySize: Int, | ||
venueId: Int, | ||
resTimeTypes: Seq[ReservationTimeType] | ||
) | ||
|
||
val resDetails: ReservationDetails = ReservationDetails( | ||
// Date of the reservation in YYYY-MM-DD format | ||
date = ???, | ||
// Size of the party reservation | ||
partySize = ???, | ||
// Unique identifier of the restaurant where you want to make the reservation | ||
venueId = ???, | ||
// Priority list of reservation times and table types. Time is in military time HH:MM:SS format. | ||
// If no preference on table type, then simply don't set it. | ||
resTimeTypes = ??? | ||
) | ||
final case class ReservationTimeType(reservationTime: String, tableType: Option[String] = None) | ||
|
||
val snipeTime: SnipeTime = SnipeTime( | ||
// Hour of the day when reservations become available and when you want to snipe | ||
hours = ???, | ||
// Minute of the day when reservations become available and when you want to snipe | ||
minutes = ??? | ||
) | ||
object ReservationTimeType { | ||
|
||
def apply(reservationTime: String, tableType: String): ReservationTimeType = { | ||
ReservationTimeType(reservationTime, Some(tableType)) | ||
} | ||
} | ||
|
||
final case class SnipeTime(hours: Int, minutes: Int) |