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 +4 -4
- data/lib/useless/wait_list.rb +104 -48
- data/useless-wait-list.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53d5029e8f1334b1d10735161db301e1d98ed3e0
|
4
|
+
data.tar.gz: a84e1cec60ccd925e0a9dba00beffeee9a4c4b2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edc115913a5955709667a9e645f32d3e49f34f9202c4626f55d1ab185ba468f28a85c2891765a282c81239e5b2aa8a74023f9e3706545be0b21a0caa807c6f61
|
7
|
+
data.tar.gz: d83b44b4dc30370efbe915ffaea2b88e4b6593010a5f0c5876b12eb29b5d06762eb8a078d4f515fba3bf1467b6f5604970454ddee036e6afc57f8c151a404828
|
data/lib/useless/wait_list.rb
CHANGED
@@ -14,55 +14,111 @@ module Useless
|
|
14
14
|
implementation 'Pending', 'Kevin Hyland'
|
15
15
|
|
16
16
|
description <<-DESC
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
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
|
data/useless-wait-list.gemspec
CHANGED
@@ -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.
|
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.
|
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.
|
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-
|
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.
|
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.
|
54
|
+
version: '0.7'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|