kounta_rest 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .DS_Store
1
2
  *.gem
2
3
  *.rbc
3
4
  .bundle
@@ -16,4 +17,4 @@ test/tmp
16
17
  test/version_tmp
17
18
  tmp
18
19
  .rspec
19
- tokens.yml
20
+ tokens.yml
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Kounta
2
2
 
3
- TODO: Write a gem description
3
+ Allows easy access to the Kounta POS RESTful API.
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,7 +18,51 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ require 'kounta'
22
+
23
+ Then add your API details / other configuration options
24
+
25
+ Kounta.configure do |config|
26
+ config.client_id = "abcd1234"
27
+ config.client_secret = "abcd1234"
28
+ config.client_token = "abcd1234"
29
+ config.client_refresh_token = "abcd1234"
30
+ end
31
+
32
+ You may also enable / disable logging (disabled by default)
33
+
34
+ config.enable_logging = true
35
+
36
+ Use the gem by creating a Kounta company object:
37
+
38
+ company = Kounta::Company.new
39
+
40
+ This will automatically download data about the company associated with your authentication details.
41
+
42
+ From here you can start to fetch relationships of that data, e.g. for all the sites belonging to your company
43
+
44
+ sites = company.sites
45
+
46
+ For the products belonging to a site
47
+
48
+ sites.first.products
49
+
50
+ Please see the test sweet for full details of these.
51
+
52
+ ### Console
53
+
54
+ To aid debugging their is an interactive console. To get started, you'll need to create a "tokens.yml" file in the root of gem, like:
55
+
56
+ client_id: abcd1234
57
+ client_secret: abcd1234
58
+ client_token: abcd1234
59
+ client_refresh_token: abcd1234
60
+
61
+ Then run:
62
+
63
+ ruby console.rb
64
+
65
+ Get started by creating a Kounta::Company object (see above for detailed usage).
22
66
 
23
67
  ## Contributing
24
68
 
data/kounta.gemspec CHANGED
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Kounta::VERSION
9
9
  spec.authors = ["Samuel Richardson"]
10
10
  spec.email = ["sam@richardson.co.nz"]
11
- spec.description = %q{Library for accessing Kountas RESTful API}
12
- spec.summary = %q{Will write this}
13
- spec.homepage = "http://www.richardson.co.nz"
11
+ spec.description = %q{Library for accessing Kounta's RESTful API}
12
+ spec.summary = %q{A wrapper around Kounta's RESTful API}
13
+ spec.homepage = "https://github.com/Rodeoclash/Kounta"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -1,3 +1,3 @@
1
1
  module Kounta
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": 198109,
3
+ "people_id": 701892,
4
+ "lines": [
5
+ "Suite 5, Level 12",
6
+ "44 Mutton Street"
7
+ ],
8
+ "city": "Beeftown",
9
+ "zone": "NSW",
10
+ "postal_code": "2112",
11
+ "country": "AU"
12
+ }
@@ -0,0 +1,25 @@
1
+ [
2
+ {
3
+ "id": 198109,
4
+ "people_id": 701892,
5
+ "lines": [
6
+ "Suite 5, Level 12",
7
+ "44 Mutton Street"
8
+ ],
9
+ "city": "Beeftown",
10
+ "zone": "NSW",
11
+ "postal_code": "2112",
12
+ "country": "AU"
13
+ },
14
+ {
15
+ "id": 198770,
16
+ "people_id": 701892,
17
+ "lines": [
18
+ "PO Box 828"
19
+ ],
20
+ "city": "Sydney",
21
+ "zone": "NSW",
22
+ "postal_code": "2000",
23
+ "country": "AU"
24
+ }
25
+ ]
@@ -0,0 +1,52 @@
1
+ {
2
+ "id": 236,
3
+ "name": "VIP Prices",
4
+ "parent_id": 201,
5
+ "products": [
6
+ {
7
+ "id": 1,
8
+ "name": "Test",
9
+ "unit_price": 10.25
10
+ },
11
+ {
12
+ "id": 2,
13
+ "name": "Caffè Latte",
14
+ "unit_price": 14.45
15
+ },
16
+ {
17
+ "id": 3,
18
+ "name": "Caffè Latte",
19
+ "unit_price": 13.15
20
+ },
21
+ {
22
+ "id": 4,
23
+ "name": "Caffè Latte",
24
+ "unit_price": 16.80
25
+ },
26
+ {
27
+ "id": 5,
28
+ "name": "Caffè Latte",
29
+ "unit_price": 8.90
30
+ },
31
+ {
32
+ "id": 6,
33
+ "name": "Caffè Latte",
34
+ "unit_price": 4.45
35
+ },
36
+ {
37
+ "id": 7,
38
+ "name": "Caffè Latte",
39
+ "unit_price": 10004.41
40
+ },
41
+ {
42
+ "id": 8,
43
+ "name": "Caffè Latte",
44
+ "unit_price": 999.99
45
+ },
46
+ {
47
+ "id": 9,
48
+ "name": "Caffè Latte",
49
+ "unit_price": 142.33
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,217 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "company_id": 162,
5
+ "name": "France"
6
+ },
7
+ {
8
+ "id": 2,
9
+ "company_id": 162,
10
+ "name": "Italy"
11
+ },
12
+ {
13
+ "id": 3,
14
+ "company_id": 162,
15
+ "name": "Australia"
16
+ },
17
+ {
18
+ "id": 4,
19
+ "company_id": 162,
20
+ "name": "Germany"
21
+ },
22
+ {
23
+ "id": 5,
24
+ "company_id": 162,
25
+ "name": "Spain"
26
+ },
27
+ {
28
+ "id": 6,
29
+ "company_id": 162,
30
+ "name": "Austria"
31
+ },
32
+ {
33
+ "id": 7,
34
+ "company_id": 162,
35
+ "name": "New Zealand"
36
+ },
37
+ {
38
+ "id": 8,
39
+ "company_id": 162,
40
+ "name": "USA"
41
+ },
42
+ {
43
+ "id": 9,
44
+ "company_id": 162,
45
+ "name": "Chille"
46
+ },
47
+ {
48
+ "id": 10,
49
+ "company_id": 162,
50
+ "name": "Argentina"
51
+ },
52
+ {
53
+ "id": 11,
54
+ "company_id": 162,
55
+ "name": "Other Country"
56
+ },
57
+ {
58
+ "id": 12,
59
+ "company_id": 162,
60
+ "name": "Sparkling"
61
+ },
62
+ {
63
+ "id": 13,
64
+ "company_id": 162,
65
+ "name": "White"
66
+ },
67
+ {
68
+ "id": 14,
69
+ "company_id": 162,
70
+ "name": "Rose"
71
+ },
72
+ {
73
+ "id": 15,
74
+ "company_id": 162,
75
+ "name": "Red"
76
+ },
77
+ {
78
+ "id": 16,
79
+ "company_id": 162,
80
+ "name": "Sweet"
81
+ },
82
+ {
83
+ "id": 17,
84
+ "company_id": 162,
85
+ "name": "Fortified"
86
+ },
87
+ {
88
+ "id": 18,
89
+ "company_id": 162,
90
+ "name": "Beer and Cider"
91
+ },
92
+ {
93
+ "id": 19,
94
+ "company_id": 162,
95
+ "name": "Sparkling White"
96
+ },
97
+ {
98
+ "id": 20,
99
+ "company_id": 162,
100
+ "name": "Sparkling Rose"
101
+ },
102
+ {
103
+ "id": 21,
104
+ "company_id": 162,
105
+ "name": "Sparkling Red"
106
+ },
107
+ {
108
+ "id": 22,
109
+ "company_id": 162,
110
+ "name": "Sparkling Sweet"
111
+ },
112
+ {
113
+ "id": 23,
114
+ "company_id": 162,
115
+ "name": "Other Sparkling"
116
+ },
117
+ {
118
+ "id": 24,
119
+ "company_id": 162,
120
+ "name": "Chardonnay"
121
+ },
122
+ {
123
+ "id": 25,
124
+ "company_id": 162,
125
+ "name": "Riesling"
126
+ },
127
+ {
128
+ "id": 26,
129
+ "company_id": 162,
130
+ "name": "Sav Blanc"
131
+ },
132
+ {
133
+ "id": 27,
134
+ "company_id": 162,
135
+ "name": "Semilion"
136
+ },
137
+ {
138
+ "id": 28,
139
+ "company_id": 162,
140
+ "name": "Pinot Gris"
141
+ },
142
+ {
143
+ "id": 29,
144
+ "company_id": 162,
145
+ "name": "Other White"
146
+ },
147
+ {
148
+ "id": 30,
149
+ "company_id": 162,
150
+ "name": "Pinot"
151
+ },
152
+ {
153
+ "id": 31,
154
+ "company_id": 162,
155
+ "name": "Shiraz"
156
+ },
157
+ {
158
+ "id": 32,
159
+ "company_id": 162,
160
+ "name": "Cap Sav & Friends"
161
+ },
162
+ {
163
+ "id": 33,
164
+ "company_id": 162,
165
+ "name": "Grenache & Friends"
166
+ },
167
+ {
168
+ "id": 34,
169
+ "company_id": 162,
170
+ "name": "Nebiolo"
171
+ },
172
+ {
173
+ "id": 35,
174
+ "company_id": 162,
175
+ "name": "Other Red"
176
+ },
177
+ {
178
+ "id": 36,
179
+ "company_id": 162,
180
+ "name": "Sherry"
181
+ },
182
+ {
183
+ "id": 37,
184
+ "company_id": 162,
185
+ "name": "Port"
186
+ },
187
+ {
188
+ "id": 38,
189
+ "company_id": 162,
190
+ "name": "Madeira"
191
+ },
192
+ {
193
+ "id": 39,
194
+ "company_id": 162,
195
+ "name": "Australian Fortifieds"
196
+ },
197
+ {
198
+ "id": 40,
199
+ "company_id": 162,
200
+ "name": "Other Fortified"
201
+ },
202
+ {
203
+ "id": 41,
204
+ "company_id": 162,
205
+ "name": "Lager"
206
+ },
207
+ {
208
+ "id": 42,
209
+ "company_id": 162,
210
+ "name": "Ales"
211
+ },
212
+ {
213
+ "id": 43,
214
+ "company_id": 162,
215
+ "name": "Cider"
216
+ }
217
+ ]
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": 1,
3
+ "company_id": 162,
4
+ "name": "France",
5
+ "description": "Wine from the country of France",
6
+ "image": null,
7
+ "products": {
8
+ "count": 34,
9
+ "updated_at": "2013-05-29T15:22:32+10:00"
10
+ }
11
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "id": 162,
3
+ "name": "Rockin’ & Rollin’ Again",
4
+ "shipping_address": null,
5
+ "postal_address": {
6
+ "id": 198109,
7
+ "lines": [
8
+ "Suite 5, Level 12",
9
+ "44 Mutton Street"
10
+ ],
11
+ "city": "Beeftown",
12
+ "zone": "VIC",
13
+ "postal_code": "6112",
14
+ "country": "AU"
15
+ },
16
+ "addresses": {
17
+ "count": 3,
18
+ "updated_at": "2013-05-22T16:21:40+10:00"
19
+ },
20
+ "business_number": "63 987 012 468",
21
+ "contact_staff_member": {
22
+ "id": 92402,
23
+ "first_name": "Ricky",
24
+ "last_name": "McDonald",
25
+ "email": "rocky@rara.kom"
26
+ },
27
+ "image": "http://www.gravatar.com/avatar/b8e42a8b1eb5967f80bf085adb97d613.jpg",
28
+ "website": "http://rara.kom",
29
+ "currency": "AUD",
30
+ "timezone": {
31
+ "offset": "+10:00",
32
+ "name": "Australia/Melbourne"
33
+ },
34
+ "sites": {
35
+ "count": 3,
36
+ "updated_at": "2013-05-24T16:24:13+10:00"
37
+ },
38
+ "registers": {
39
+ "count": 12,
40
+ "limit": 15,
41
+ "updated_at": "2013-05-22T12:18:44+10:00"
42
+ },
43
+ "created_at": "2013-05-08T13:56:02+10:00",
44
+ "updated_at": "2013-05-22T16:21:40+10:00"
45
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "id": 389427,
3
+ "company_id": 162,
4
+ "people_id": 701892,
5
+ "first_name": "Samuel",
6
+ "last_name": "Richardson",
7
+ "description": "The cyclist who comes in every Thursday for a muffin.",
8
+ "primary_email_address": "sam@richardson.co.nz",
9
+ "email_addresses": [
10
+ "jamie@kounta.kom",
11
+ "jamie112783@hotmail.kom"
12
+ ],
13
+ "phone": "+612 8765 4321",
14
+ "mobile": "0405 060 708",
15
+ "fax": null,
16
+ "shipping_address": {
17
+ "id": 198109,
18
+ "lines": [
19
+ "Suite 5, Level 12",
20
+ "44 Mutton Street"
21
+ ],
22
+ "city": "Beeftown",
23
+ "zone": "NSW",
24
+ "postal_code": "2112",
25
+ "country": "AU"
26
+ },
27
+ "postal_address": null,
28
+ "addresses": {
29
+ "count": 3,
30
+ "updated_at": "2013-05-22T16:21:40+10:00"
31
+ },
32
+ "image": "http://www.gravatar.com/avatar/cc6f3f16c233257d437ea5163787645e.jpg",
33
+ "tags": [
34
+ "Gold Member",
35
+ "Newsletter"
36
+ ],
37
+ "created_at": "2013-05-08T13:56:02+10:00",
38
+ "updated_at": "2013-05-22T16:21:40+10:00"
39
+ }
@@ -0,0 +1,26 @@
1
+ [
2
+ {
3
+ "id": 389427,
4
+ "company_id": 162,
5
+ "first_name": "Jamie",
6
+ "last_name": "McDonald",
7
+ "primary_email_address": "jamie@kounta.kom",
8
+ "image": "http://www.gravatar.com/avatar/cc6f3f16c233257d437ea5163787645e.jpg"
9
+ },
10
+ {
11
+ "id": 389428,
12
+ "company_id": 162,
13
+ "first_name": "Sam",
14
+ "last_name": "Flanders",
15
+ "primary_email_address": "sam@kounta.kom",
16
+ "image": null
17
+ },
18
+ {
19
+ "id": 389426,
20
+ "company_id": 162,
21
+ "first_name": "Samuel",
22
+ "last_name": "Richardson",
23
+ "primary_email_address": "disco16@gmail.com",
24
+ "image": "http://www.gravatar.com/avatar/cc6f3f16c233257d437ea5163787645e.jpg"
25
+ }
26
+ ]
@@ -0,0 +1,7 @@
1
+ {
2
+ "number": 1,
3
+ "product_id": 8710,
4
+ "quantity": 1,
5
+ "notes": "15% surcharge for public holiday",
6
+ "price_variation": 1.15
7
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "id": 93824701,
3
+ "company_id": 162,
4
+ "status": "ON_HOLD",
5
+ "notes": "Take away, gold member",
6
+ "customer": {
7
+ "id": 3842,
8
+ "first_name": "Lucy",
9
+ "last_name": "Lavender",
10
+ "email": "lucy@kounta.com",
11
+ "image": "http://www.gravatar.com/avatar/cb9532c3d6f3f835d2253b5fcaa68340.jpg"
12
+ },
13
+ "register_id": 409,
14
+ "site_id": 2301,
15
+ "lines": [
16
+ {
17
+ "id": 37864193203,
18
+ "number": 1,
19
+ "product": {
20
+ "id": 7302,
21
+ "name": "Caffé Latte"
22
+ },
23
+ "quantity": 6,
24
+ "notes": "Extra sugar please",
25
+ "unit_price": 1.36,
26
+ "unit_tax": 0.14
27
+ },
28
+ {
29
+ "id": 37864193204,
30
+ "number": 2,
31
+ "product": {
32
+ "id": 5312,
33
+ "name": "Salmon Sandwich"
34
+ },
35
+ "quantity": 1,
36
+ "price_variation": 0.9,
37
+ "unit_price": 9.09,
38
+ "unit_tax": 0.91
39
+ }
40
+ ],
41
+ "payments": [
42
+ {
43
+ "id": 19230990,
44
+ "method": {
45
+ "id": 1,
46
+ "name": "Cash"
47
+ },
48
+ "amount": 5.5,
49
+ "created_at": "2013-05-29T11:14:06+10:00"
50
+ },
51
+ {
52
+ "id": 19230996,
53
+ "method": {
54
+ "id": 12,
55
+ "name": "PayPal"
56
+ },
57
+ "amount": 13.5,
58
+ "created_at": "2013-05-29T13:00:00+10:00",
59
+ "ref": "INV2-8M9F-B8UN-YQ5S-2G7K"
60
+ }
61
+ ],
62
+ "callback_uri": "http://third-party.com/update_order_status.json?id=123582936748",
63
+ "placed_at": "2013-05-29T11:14:06+10:00",
64
+ "fulfil_at": "2013-05-29T13:00:00+10:00",
65
+ "created_at": "2013-05-29T11:14:06+10:00",
66
+ "updated_at": "2013-05-29T11:14:06+10:00"
67
+ }
@@ -0,0 +1,134 @@
1
+ [
2
+ {
3
+ "id": 912387093,
4
+ "company_id": 162,
5
+ "status": "PENDING",
6
+ "total": 45.65,
7
+ "paid": 0,
8
+ "notes": "Take away, gold member",
9
+ "created_at": "2013-06-02T14:22:08+10:00",
10
+ "updated_at": "2013-06-02T14:22:08+10:00",
11
+ "placed_at": "2013-05-29T11:14:06+10:00",
12
+ "fulfil_at": "2013-05-29T13:00:00+10:00",
13
+ "customer": {
14
+ "id": 389426,
15
+ "first_name": "Lucy",
16
+ "last_name": "Lavender",
17
+ "email": "lucy@kounta.com",
18
+ "image": "http://www.gravatar.com/avatar/cb9532c3d6f3f835d2253b5fcaa68340.jpg"
19
+ },
20
+ "lines": [
21
+ {
22
+ "id": 37864193203,
23
+ "number": 1,
24
+ "product": {
25
+ "id": 7302,
26
+ "name": "Caffé Latte"
27
+ },
28
+ "quantity": 6,
29
+ "notes": "Extra sugar please",
30
+ "unit_price": 1.36,
31
+ "unit_tax": 0.14
32
+ },
33
+ {
34
+ "id": 37864193204,
35
+ "number": 2,
36
+ "product": {
37
+ "id": 5312,
38
+ "name": "Salmon Sandwich"
39
+ },
40
+ "quantity": 1,
41
+ "price_variation": 0.9,
42
+ "unit_price": 9.09,
43
+ "unit_tax": 0.91
44
+ }
45
+ ],
46
+ "payments": [
47
+ {
48
+ "id": 19230990,
49
+ "method": {
50
+ "id": 1,
51
+ "name": "Cash"
52
+ },
53
+ "amount": 5.5,
54
+ "created_at": "2013-05-29T11:14:06+10:00"
55
+ },
56
+ {
57
+ "id": 19230996,
58
+ "method": {
59
+ "id": 12,
60
+ "name": "PayPal"
61
+ },
62
+ "amount": 13.5,
63
+ "created_at": "2013-05-29T13:00:00+10:00",
64
+ "ref": "INV2-8M9F-B8UN-YQ5S-2G7K"
65
+ }
66
+ ]
67
+ },
68
+ {
69
+ "id": 912387401,
70
+ "company_id": 162,
71
+ "status": "COMPLETED",
72
+ "total": 30.25,
73
+ "paid": 30.25,
74
+ "notes": "Take away, gold member",
75
+ "created_at": "2013-06-02T14:22:55+10:00",
76
+ "updated_at": "2013-06-02T14:22:55+10:00",
77
+ "placed_at": "2013-05-29T11:14:06+10:00",
78
+ "fulfil_at": "2013-05-29T13:00:00+10:00",
79
+ "customer": {
80
+ "id": 389427,
81
+ "first_name": "Lucy",
82
+ "last_name": "Lavender",
83
+ "email": "lucy@kounta.com",
84
+ "image": "http://www.gravatar.com/avatar/cb9532c3d6f3f835d2253b5fcaa68340.jpg"
85
+ },
86
+ "lines": [
87
+ {
88
+ "id": 37864193203,
89
+ "number": 1,
90
+ "product": {
91
+ "id": 7302,
92
+ "name": "Caffé Latte"
93
+ },
94
+ "quantity": 6,
95
+ "notes": "Extra sugar please",
96
+ "unit_price": 1.36,
97
+ "unit_tax": 0.14
98
+ },
99
+ {
100
+ "id": 37864193204,
101
+ "number": 2,
102
+ "product": {
103
+ "id": 5312,
104
+ "name": "Salmon Sandwich"
105
+ },
106
+ "quantity": 1,
107
+ "price_variation": 0.9,
108
+ "unit_price": 9.09,
109
+ "unit_tax": 0.91
110
+ }
111
+ ],
112
+ "payments": [
113
+ {
114
+ "id": 19230990,
115
+ "method": {
116
+ "id": 1,
117
+ "name": "Cash"
118
+ },
119
+ "amount": 5.5,
120
+ "created_at": "2013-05-29T11:14:06+10:00"
121
+ },
122
+ {
123
+ "id": 19230996,
124
+ "method": {
125
+ "id": 12,
126
+ "name": "PayPal"
127
+ },
128
+ "amount": 13.5,
129
+ "created_at": "2013-05-29T13:00:00+10:00",
130
+ "ref": "INV2-8M9F-B8UN-YQ5S-2G7K"
131
+ }
132
+ ]
133
+ }
134
+ ]
@@ -0,0 +1,6 @@
1
+ {
2
+ "id": 44,
3
+ "method_id": 12,
4
+ "amount": 14.25,
5
+ "ref": "INV2-8M9F-B8UN-YQ5S-2G7K"
6
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "id": 236,
3
+ "name": "VIP Prices",
4
+ "parent_id": 201,
5
+ "products": [
6
+ {
7
+ "id": 1,
8
+ "name": "Test",
9
+ "unit_price": 10.25
10
+ },
11
+ {
12
+ "id": 2,
13
+ "name": "Caffè Latte",
14
+ "unit_price": 14.45
15
+ },
16
+ {
17
+ "id": 3,
18
+ "name": "Caffè Latte",
19
+ "unit_price": 13.15
20
+ },
21
+ {
22
+ "id": 4,
23
+ "name": "Caffè Latte",
24
+ "unit_price": 16.80
25
+ },
26
+ {
27
+ "id": 5,
28
+ "name": "Caffè Latte",
29
+ "unit_price": 8.90
30
+ },
31
+ {
32
+ "id": 6,
33
+ "name": "Caffè Latte",
34
+ "unit_price": 4.45
35
+ },
36
+ {
37
+ "id": 7,
38
+ "name": "Caffè Latte",
39
+ "unit_price": 10004.41
40
+ },
41
+ {
42
+ "id": 8,
43
+ "name": "Caffè Latte",
44
+ "unit_price": 999.99
45
+ },
46
+ {
47
+ "id": 9,
48
+ "name": "Caffè Latte",
49
+ "unit_price": 142.33
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,12 @@
1
+ [
2
+ {
3
+ "id": 201,
4
+ "name": "Store Prices",
5
+ "parent_id": null
6
+ },
7
+ {
8
+ "id": 236,
9
+ "name": "Online Prices",
10
+ "parent_id": 201
11
+ }
12
+ ]
@@ -0,0 +1,25 @@
1
+ {
2
+ "id": 1,
3
+ "company_id": 162,
4
+ "name": "Salomon Undhof Wieden & Berg Gruner Veltliner",
5
+ "code": "wine298",
6
+ "description": "Pale-coloured, with a rich nose of fresh herbs and peppery cucumber varietal character. Soft, rounded and nicely balanced with a clean, dry palate and some opulence.",
7
+ "barcode": "1234567890",
8
+ "image": "http://danmurphys.com.au/media/DM/Product/750x2000/332012_0_9999_v1_m56577569853958110.jpg",
9
+ "tags": [
10
+ "Fresh Food",
11
+ "Fragile",
12
+ "Organic"
13
+ ],
14
+ "unit_price": 6.8,
15
+ "cost_price": 4,
16
+ "stock": 21,
17
+ "taxes": [
18
+ {
19
+ "id": 829,
20
+ "code": "GST",
21
+ "name": "GST",
22
+ "rate": 0.1
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,119 @@
1
+ [
2
+ {
3
+ "company_id": 162,
4
+ "id": 1,
5
+ "name": "Salomon Undhof Wieden & Berg Gruner Veltliner",
6
+ "description": "Pale-coloured, with a rich nose of fresh herbs and peppery cucumber varietal character. Soft, rounded and nicely balanced with a clean, dry palate and some opulence.",
7
+ "tags": [
8
+ "Website"
9
+ ],
10
+ "image": "http://danmurphys.com.au/media/DM/Product/750x2000/332012_0_9999_v1_m56577569853958110.jpg",
11
+ "cost_price": 4,
12
+ "unit_price": 50.00,
13
+ "stock": 21
14
+ },
15
+ {
16
+ "company_id": 162,
17
+ "id": 2,
18
+ "name": "Hahndorf Hill Gruner Veltliner",
19
+ "description": "Aromas of salad leaf, a hint of stone fruit. Crisp and bracing, with pepper and spice flavours, and mouth-watering acidity.",
20
+ "tags": [
21
+ "Website"
22
+ ],
23
+ "image": "http://danmurphys.com.au/media/DM/Product/750x2000/344099_0_9999_v1_m56577569853952360.jpg",
24
+ "cost_price": 4,
25
+ "unit_price": 25.45,
26
+ "stock": 21
27
+ },
28
+ {
29
+ "company_id": 162,
30
+ "id": 3,
31
+ "name": "Berton Vineyards Vermentino",
32
+ "description": "Crisp, crunchy and lightly herbal, this is a fresh, simple, unwooded dry white that shocked the NSW Wine Awards judges with its quality and price. Fruity palate and a near-dry finish: satisfying yet refreshing.",
33
+ "tags": [
34
+ "Website"
35
+ ],
36
+ "image": "http://danmurphys.com.au/media/DM/Product/750x2000/368428_0_9999_v1_m56577569853952366.jpg",
37
+ "cost_price": 4,
38
+ "unit_price": 78.00,
39
+ "stock": 21
40
+ },
41
+ {
42
+ "company_id": 162,
43
+ "id": 4,
44
+ "name": "Ulithorne Corsus Vermentinu",
45
+ "description": "That's how they spell it in Corsica. Pale-hued, with a lightly peppery aroma, hints of talc, fresh herbs and other, more savoury notes. Delicate in the mouth; light-bodied and dry, lean and savoury, not fruity. Fairly simple but well made: it's an adaptable food wine.",
46
+ "tags": [
47
+ "Website"
48
+ ],
49
+ "image": "http://danmurphys.com.au/media/DM/Product/750x2000/380851_0_9999_v1_m56577569846600429.jpg",
50
+ "cost_price": 4,
51
+ "unit_price": 5.00,
52
+ "stock": 21
53
+ },
54
+ {
55
+ "company_id": 162,
56
+ "id": 5,
57
+ "name": "By Farr",
58
+ "description": "The flavour is voluminous and gorgeously smooth, with a pillowy roundness, yet it's not even remotely fat, oily or lacking acidity. A great viognier, as good as any from France.",
59
+ "tags": [
60
+ "Website"
61
+ ],
62
+ "image": "http://danmurphys.com.au/media/DM/Product/750x2000/383118_0_9999_v1_m56577569853988110.jpg",
63
+ "cost_price": 4,
64
+ "unit_price": 5.00,
65
+ "stock": 21
66
+ },
67
+ {
68
+ "company_id": 162,
69
+ "id": 6,
70
+ "name": "Clusel-Roch Condrieu Verchery",
71
+ "description": "Condrieu is the appellation and this one is classy. Very complex, with honeysuckle, spice and stone-fruit aromas. Fragrant, rich, full-bodied and dense, but without the heaviness or tannin grip that viognier can display - it remains light on its feet.",
72
+ "tags": [
73
+ "Website"
74
+ ],
75
+ "image": "http://danmurphys.com.au/media/DM/Product/750x2000/717348_0_9999_v1_m56577569853956898.jpg",
76
+ "cost_price": 4,
77
+ "unit_price": 4.99,
78
+ "stock": 21
79
+ },
80
+ {
81
+ "company_id": 162,
82
+ "id": 7,
83
+ "name": "Hoddles Creek Estate 1er",
84
+ "description": "Possibly Australia's only commercial pinot blanc, this has a whiff of sulfides when first poured, underneath an intriguing pear and honey flavour. Decant it, if you like, to aerate before serving.",
85
+ "tags": [
86
+ "Website"
87
+ ],
88
+ "image": "http://danmurphys.com.au/media/DM/Product/750x2000/720488_0_9999_v1_m56577569853963049.jpg",
89
+ "cost_price": 4,
90
+ "unit_price": 10.99,
91
+ "stock": 21
92
+ },
93
+ {
94
+ "company_id": 162,
95
+ "id": 8,
96
+ "name": "Albert Mann Pinot Blanc Auxerrois",
97
+ "description": "A full-yellow colour and buttered-toast bouquet indicate some bottle age. Smoky development plus peach, spices and honeydew melon. Soft, light, fruity flavour that is off-dry, finishing with good balance.",
98
+ "tags": [
99
+ "Website"
100
+ ],
101
+ "image": "http://danmurphys.com.au/media/DM/Product/750x2000/757992_0_9999_v1_m56577569853630814.jpg",
102
+ "cost_price": 4,
103
+ "unit_price": 45.12,
104
+ "stock": 21
105
+ },
106
+ {
107
+ "company_id": 162,
108
+ "id": 9,
109
+ "name": "Adriano Adami Bosco di Gica Brut Prosecco di Valdobbiadene DOC non-vintage",
110
+ "description": "Pale colour with a vigorous, frothy mousse of bubbles. Aromas are peppery and creamy with some fresh yeasty notes. It's straightforward, with a touch of well-balanced sweetness and a fluffy, creamy texture.",
111
+ "tags": [
112
+ "Website"
113
+ ],
114
+ "image": "http://danmurphys.com.au/media/DM/Product/750x2000/384219_0_9999_v1_m56577569852341202.jpg",
115
+ "cost_price": 4,
116
+ "unit_price": 0.56,
117
+ "stock": 21
118
+ }
119
+ ]
@@ -0,0 +1,6 @@
1
+ {
2
+ "company_id": 162,
3
+ "id": 923,
4
+ "name": "Online Store",
5
+ "code": "Online"
6
+ }
@@ -0,0 +1,14 @@
1
+ [
2
+ {
3
+ "company_id": 162,
4
+ "id": 923,
5
+ "name": "Port Melbourne Store",
6
+ "code": "PM"
7
+ },
8
+ {
9
+ "company_id": 162,
10
+ "id": 985,
11
+ "name": "Online Store",
12
+ "code": "Online"
13
+ }
14
+ ]
@@ -0,0 +1,7 @@
1
+ {
2
+ "company_id": 162,
3
+ "id": 829,
4
+ "code": "GST",
5
+ "name": "Goods & Services Tax",
6
+ "rate": 0.1
7
+ }
@@ -0,0 +1,16 @@
1
+ [
2
+ {
3
+ "company_id": 162,
4
+ "id": 829,
5
+ "code": "GST",
6
+ "name": "Goods & Services Tax",
7
+ "rate": 0.1
8
+ },
9
+ {
10
+ "company_id": 162,
11
+ "id": 844,
12
+ "code": "WET",
13
+ "name": "Wine Equalisation Tax",
14
+ "rate": 0.29
15
+ }
16
+ ]
@@ -8,7 +8,7 @@ describe Kounta::Order do
8
8
  new_order = Kounta::Order.new
9
9
  new_order.payments << Kounta::Payment.new(:amount => 50.00)
10
10
  new_order.to_hash[:payments].length.should be(1)
11
- new_order.to_hash[:payments][0][:amount].should be(50.00)
11
+ new_order.to_hash[:payments][0][:amount].should eq(50.00)
12
12
  end
13
13
 
14
14
  it "should be able to add lines to new orders" do
@@ -21,7 +21,7 @@ describe Kounta::Order do
21
21
  it "should be able to add and serialise payments to created orders" do
22
22
  subject.payments << Kounta::Payment.new(:amount => 50.00)
23
23
  subject.to_hash[:payments].length.should be(3)
24
- subject.to_hash[:payments][2][:amount].should be(50.00)
24
+ subject.to_hash[:payments][2][:amount].should eq(50.00)
25
25
  end
26
26
 
27
27
  it "should be able to add and serialise lines to created orders" do
@@ -58,8 +58,8 @@ describe Kounta::Resource do
58
58
  end
59
59
 
60
60
  it "should be able to serialise itself to a hash" do
61
- @instance.to_hash.should eq({:id => 345})
62
- @instance.to_hash({:merge => "me"}).should eq({:id => 345, :merge => "me"})
61
+ @instance.to_hash.class.should be(Hash)
62
+ @instance.to_hash(:merge => "me").should eq(:merge => "me")
63
63
  end
64
64
 
65
65
  it "should raise an error when presented with an unknown attribute" do
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kounta_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Samuel Richardson
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-11-03 00:00:00.000000000 Z
12
+ date: 2013-11-04 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,20 +30,23 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - '>='
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0'
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - '>='
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rspec
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: simplecov
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - '='
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - '='
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: webmock
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - '='
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - '='
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: oj
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ~>
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :runtime
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - ~>
95
108
  - !ruby/object:Gem::Version
@@ -97,6 +110,7 @@ dependencies:
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: hashie
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
115
  - - ~>
102
116
  - !ruby/object:Gem::Version
@@ -104,6 +118,7 @@ dependencies:
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
123
  - - ~>
109
124
  - !ruby/object:Gem::Version
@@ -111,6 +126,7 @@ dependencies:
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: oauth2
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
131
  - - '='
116
132
  - !ruby/object:Gem::Version
@@ -118,6 +134,7 @@ dependencies:
118
134
  type: :runtime
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
139
  - - '='
123
140
  - !ruby/object:Gem::Version
@@ -125,6 +142,7 @@ dependencies:
125
142
  - !ruby/object:Gem::Dependency
126
143
  name: pry
127
144
  requirement: !ruby/object:Gem::Requirement
145
+ none: false
128
146
  requirements:
129
147
  - - '='
130
148
  - !ruby/object:Gem::Version
@@ -132,6 +150,7 @@ dependencies:
132
150
  type: :runtime
133
151
  prerelease: false
134
152
  version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
135
154
  requirements:
136
155
  - - '='
137
156
  - !ruby/object:Gem::Version
@@ -139,6 +158,7 @@ dependencies:
139
158
  - !ruby/object:Gem::Dependency
140
159
  name: yell
141
160
  requirement: !ruby/object:Gem::Requirement
161
+ none: false
142
162
  requirements:
143
163
  - - '='
144
164
  - !ruby/object:Gem::Version
@@ -146,11 +166,12 @@ dependencies:
146
166
  type: :runtime
147
167
  prerelease: false
148
168
  version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
149
170
  requirements:
150
171
  - - '='
151
172
  - !ruby/object:Gem::Version
152
173
  version: 1.5.1
153
- description: Library for accessing Kountas RESTful API
174
+ description: Library for accessing Kounta's RESTful API
154
175
  email:
155
176
  - sam@richardson.co.nz
156
177
  executables: []
@@ -181,6 +202,26 @@ files:
181
202
  - lib/kounta/site.rb
182
203
  - lib/kounta/tax.rb
183
204
  - lib/kounta/version.rb
205
+ - spec/fixtures/address.json
206
+ - spec/fixtures/addresses.json
207
+ - spec/fixtures/base_price_list.json
208
+ - spec/fixtures/categories.json
209
+ - spec/fixtures/category.json
210
+ - spec/fixtures/companies_me.json
211
+ - spec/fixtures/customer.json
212
+ - spec/fixtures/customers.json
213
+ - spec/fixtures/line.json
214
+ - spec/fixtures/order.json
215
+ - spec/fixtures/orders.json
216
+ - spec/fixtures/payment.json
217
+ - spec/fixtures/price_list.json
218
+ - spec/fixtures/price_lists.json
219
+ - spec/fixtures/product.json
220
+ - spec/fixtures/products.json
221
+ - spec/fixtures/site.json
222
+ - spec/fixtures/sites.json
223
+ - spec/fixtures/tax.json
224
+ - spec/fixtures/taxes.json
184
225
  - spec/helper.rb
185
226
  - spec/kounta/address_spec.rb
186
227
  - spec/kounta/category_spec.rb
@@ -195,31 +236,52 @@ files:
195
236
  - spec/kounta/rest/client_spec.rb
196
237
  - spec/kounta/site_spec.rb
197
238
  - spec/support/endpoints.rb
198
- homepage: http://www.richardson.co.nz
239
+ homepage: https://github.com/Rodeoclash/Kounta
199
240
  licenses:
200
241
  - MIT
201
- metadata: {}
202
242
  post_install_message:
203
243
  rdoc_options: []
204
244
  require_paths:
205
245
  - lib
206
246
  required_ruby_version: !ruby/object:Gem::Requirement
247
+ none: false
207
248
  requirements:
208
- - - '>='
249
+ - - ! '>='
209
250
  - !ruby/object:Gem::Version
210
251
  version: '0'
211
252
  required_rubygems_version: !ruby/object:Gem::Requirement
253
+ none: false
212
254
  requirements:
213
- - - '>='
255
+ - - ! '>='
214
256
  - !ruby/object:Gem::Version
215
257
  version: '0'
216
258
  requirements: []
217
259
  rubyforge_project:
218
- rubygems_version: 2.0.3
260
+ rubygems_version: 1.8.23
219
261
  signing_key:
220
- specification_version: 4
221
- summary: Will write this
262
+ specification_version: 3
263
+ summary: A wrapper around Kounta's RESTful API
222
264
  test_files:
265
+ - spec/fixtures/address.json
266
+ - spec/fixtures/addresses.json
267
+ - spec/fixtures/base_price_list.json
268
+ - spec/fixtures/categories.json
269
+ - spec/fixtures/category.json
270
+ - spec/fixtures/companies_me.json
271
+ - spec/fixtures/customer.json
272
+ - spec/fixtures/customers.json
273
+ - spec/fixtures/line.json
274
+ - spec/fixtures/order.json
275
+ - spec/fixtures/orders.json
276
+ - spec/fixtures/payment.json
277
+ - spec/fixtures/price_list.json
278
+ - spec/fixtures/price_lists.json
279
+ - spec/fixtures/product.json
280
+ - spec/fixtures/products.json
281
+ - spec/fixtures/site.json
282
+ - spec/fixtures/sites.json
283
+ - spec/fixtures/tax.json
284
+ - spec/fixtures/taxes.json
223
285
  - spec/helper.rb
224
286
  - spec/kounta/address_spec.rb
225
287
  - spec/kounta/category_spec.rb
@@ -234,3 +296,4 @@ test_files:
234
296
  - spec/kounta/rest/client_spec.rb
235
297
  - spec/kounta/site_spec.rb
236
298
  - spec/support/endpoints.rb
299
+ has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: a86362b8399c86197ffcd71ede44e6a9ed012680
4
- data.tar.gz: 33815307b4c2fca7f892c79344afeb4749ae996f
5
- SHA512:
6
- metadata.gz: e0c96a9de798ae9e9260619d48317bc5a6ddfdc2c7f583e84ffb9f342c3e0e64412d543bb3be04fbbc71a93df60ec9af4c016591cf0ac617e4b194a4ebab5b33
7
- data.tar.gz: 006705116209f1457a137720359cc156e7d6c287a9815ec54f9333674cd5516e56f7348d9459575d3f5157ae4fb54e08a1f4c7d1aadfdf10e41a83198b73e259