useless-wait-list 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acf3ad7bf2fd27f864f7ec9b3ab551c878bed013
4
- data.tar.gz: e99e8e1c64ba5b4f2ae0988966657f3c6abb26aa
3
+ metadata.gz: 53d5029e8f1334b1d10735161db301e1d98ed3e0
4
+ data.tar.gz: a84e1cec60ccd925e0a9dba00beffeee9a4c4b2d
5
5
  SHA512:
6
- metadata.gz: 2787c9e01b6bb479429a8d379a07efff3bbb79d6cbafae815a51df274bfae50ba82974693d2f6e7a8cc7b07ffdf643099c4933f09b10a68046fa0dae02a6164f
7
- data.tar.gz: a39141772f80efc93a58bec013e7dc004470a2adba18a6252ad79eaec4a05871922bee92a4b5c4b3d1c4c697f9142e919c6d0c72f8a69bde7124ab7bb368657e
6
+ metadata.gz: edc115913a5955709667a9e645f32d3e49f34f9202c4626f55d1ab185ba468f28a85c2891765a282c81239e5b2aa8a74023f9e3706545be0b21a0caa807c6f61
7
+ data.tar.gz: d83b44b4dc30370efbe915ffaea2b88e4b6593010a5f0c5876b12eb29b5d06762eb8a078d4f515fba3bf1467b6f5604970454ddee036e6afc57f8c151a404828
@@ -14,55 +14,111 @@ module Useless
14
14
  implementation 'Pending', 'Kevin Hyland'
15
15
 
16
16
  description <<-DESC
17
- It is becoming increasingly common for restaurants, especially popular
18
- ones, to not accept reservations. Instead, they choose to maintain a
19
- first-come, first-served wait list.
20
-
21
- Algorithmically, this makes a lot of sense. The wait list can be
22
- modeled as a set of queues, one per available table size. The
23
- reservation, however, requires some scheduling algorithm. Queues, in
24
- general, are easier than scheduling.
25
-
26
- This is reflected in the real world. Reservations force the restaurant
27
- to commit to an explicit time that the table will be available, which
28
- is difficult to do accurately. The simplicity of the wait list, though,
29
- allows both patron and proprietor to better understand the real time
30
- that a table will be available.
31
-
32
- And although patrons appreciate more realistic expectations, the
33
- overall quality of their experience is decreased when compared to
34
- reservations. If you live in a neighborhood where most restaurants do
35
- not take reservations, and you're looking for a restaurant, it's not
36
- uncommon to walk to a bunch of places and then ultimately walk back to
37
- the one that had the shortest wait list. The best way to get a good
38
- spot on a particularly popular wait list is to show up in the early
39
- afternoon. But it doesn't have to be that way!
40
-
41
- The goal of the **Wait List API** is to make the process of getting and
42
- being on a wait list _better_ than that of making a reservation. The
43
- main idea, of course, is that if a wait list is represented as an
44
- intuitive JSON API, then there a few ways that the patron experience
45
- can be signifcantly improved:
46
-
47
- 1. A patron could browse all the wait lists of all the restaurants in
48
- his area, ordering them by the estimated time that a table will
49
- be available for his party size. He could then put himself on the
50
- wait list that works best.
51
-
52
- 2. Once on a wait list, the patron could have complete visibility into
53
- his position in line. He wouldn't have to arrive at the restaurant
54
- until exactly when his table was ready.
55
-
56
- 3. For popular restaurants, there could be a flash sale experience
57
- when the wait list opens for that night's dinner. A patron could
58
- contend for his position on a wait list from his office computer or
59
- on his phone.
60
-
61
- Restaurants would benefit as well. First of all, the task of managing
62
- the wait list is simplified since the patrons are doing it on their
63
- own. Secondly, they would have access to all the data captured by the
64
- API.
17
+ The **Wait List API** exposes a service that improves the wait list
18
+ experience for both restaurants and patrons. It was initially motivated
19
+ by a desire, as patrons, to browse and add ourselves to wait lists. It
20
+ also improves the process of managing wait lists for restaurants.
21
+
22
+ ### Restaurant
23
+
24
+ The top-level resource is the **restaurant**, which consists of a place
25
+ (from a supported place API, e.g. Foursquare), a group of users, and
26
+ some wait lists.
27
+
28
+ The users associated with the restaurant represent the staff and are
29
+ able to manage the restaurant's wait lists, i.e. create or cancel
30
+ reservations on behalf of other users or mark reservations as "seated",
31
+ "no show" or "bumped".
32
+
33
+ ### Wait List
34
+
35
+ The **wait list** is the primary resource. A wait list belongs to a
36
+ restaurant, has an ordered list of reservations, along with the
37
+ following attributes:
38
+
39
+ * _table_size_ - the number of people who can be seated at this
40
+ wait list's tables. A restaurant should have a wait list per
41
+ available table size per dining service.
42
+
43
+ * _reservations_start_ - when reservations can start being created
44
+ for this wait list. Once this time has passed, the wait list is
45
+ "open".
46
+
47
+ * _seating_start_ - when the first reservation on this wait list
48
+ will be seated. Once this time has passed, the wait list is
49
+ "active".
50
+
51
+ A wait list can be closed manually or automatically (based upon some
52
+ criteria, e.g. a reservation threshold). Once closed, reservations can
53
+ no longer be created for the wait list, and it will no longer show up in
54
+ search results.
55
+
56
+ ### Reservation
57
+
58
+ A **reservation** represents a patron's position on a wait list. A
59
+ reservation can have one of five states:
60
+
61
+ * _waiting_ - the patron has not yet been seated, or marked as a no
62
+ show.
63
+
64
+ * _cancelled_ - the patron has yet to be seated, but has removed
65
+ himself from the waitlist.
66
+
67
+ * _seated_ - the patron has been seated at his table.
68
+
69
+ * _no show_ - the patron did not show up for the meal.
70
+
71
+ * _bumped_ - the patron was on the wait list, but the restuarant
72
+ was unable to seat him, probably due to the end of service.
73
+
74
+ A patron can create a reservation for himself on any open wait
75
+ list, as long as he does not already have a reservation on another
76
+ wait list at "around the same time".
77
+
78
+ A patron can also remove himself from a wait list, causing his
79
+ reservation to be marked as either "cancelled" or "no show".
65
80
  DESC
66
81
  end
82
+
83
+ doc.get '/wait-lists' do
84
+ description 'Search by geolocation and party size'
85
+
86
+ authentication_required false
87
+
88
+ parameter 'latitude', 'The latitude near which the wait lists\' restaurants should be located',
89
+ type: 'number'
90
+ parameter 'longitude', 'The longitude near which the wait lists\' restaurants should be located',
91
+ type: 'number'
92
+ parameter 'table_size', 'The the number of people that the wait list\'s table accomodate',
93
+ type: 'integer'
94
+ parameter 'page', 'The page of results to be retrieved. 20 results are returned per page',
95
+ type: 'integer', required: false, default: 1
96
+
97
+ response 200, 'A list of wait lists was successfully returned' do
98
+ body do
99
+ content_type 'application/json'
100
+
101
+ attribute 'page', 'The page of results that was returned'
102
+ attribute 'total', 'The total number of wait lists matching the parameters'
103
+ attribute 'wait_lists', 'The list of wait lists matching the parameters, for the current page', type: 'array[object]' do
104
+ attribute 'restaurant', 'The restaurant associated with the wait list', type: 'object' do
105
+ attribute 'id', 'The unique ID of the restaurant', type: 'string'
106
+ attribute 'name', 'The name of the restaurant', type: 'string'
107
+ attribute 'latitude', 'The latitude of the restaurant', type: 'number'
108
+ attribute 'latitude', 'The longitude of the restaurant', type: 'number'
109
+ end
110
+ attribute 'reservations_start', 'The time that reservations can be created for this wait list', type: 'timestamp'
111
+ attribute 'estimated_seating_time', 'The time at which the next available reservation on the ' +
112
+ 'wait list is estimated to be seated', type: 'timestamp'
113
+ end
114
+ end
115
+ end
116
+
117
+ response 422, 'latitude, longitude or table_size was omitted'
118
+ response 422, 'Invalid latitude - must be a number between -90 and 90'
119
+ response 422, 'Invalid longitude - must be a number between -180 and 180'
120
+ response 422, 'Invalid table_size - must be an integer greater than zero'
121
+ response 422, 'Invalid page - must be an integer greater than zero'
122
+ end
67
123
  end
68
124
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'useless-wait-list'
7
- spec.version = '0.0.2'
7
+ spec.version = '0.0.3'
8
8
  spec.authors = ['Kevin Hyland']
9
9
  spec.email = ['khy@me.com']
10
10
  spec.summary = 'For restaurants that don\'t take reservations'
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.add_runtime_dependency 'sinatra', '~> 1.4.2'
20
20
  spec.add_runtime_dependency 'useless', '~> 0.2.0'
21
- spec.add_runtime_dependency 'useless-doc', '~> 0.6.4'
21
+ spec.add_runtime_dependency 'useless-doc', '~> 0.7'
22
22
 
23
23
  spec.add_development_dependency 'bundler', '~> 1.3'
24
24
  spec.add_development_dependency 'rake', '~> 0.9'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: useless-wait-list
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Hyland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-02 00:00:00.000000000 Z
11
+ date: 2013-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: 0.6.4
47
+ version: '0.7'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 0.6.4
54
+ version: '0.7'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement