myob-essentials-api 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/.document +5 -0
  3. data/.rspec +2 -0
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +12 -0
  6. data/Gemfile +14 -0
  7. data/Gemfile.lock +86 -0
  8. data/LICENSE +22 -0
  9. data/README.md +188 -0
  10. data/Rakefile +51 -0
  11. data/VERSION +1 -0
  12. data/lib/myob-essentials-api.rb +13 -0
  13. data/lib/myob/essentials/api/client.rb +86 -0
  14. data/lib/myob/essentials/api/helper.rb +29 -0
  15. data/lib/myob/essentials/api/model/account.rb +13 -0
  16. data/lib/myob/essentials/api/model/account_balance.rb +13 -0
  17. data/lib/myob/essentials/api/model/account_classification.rb +13 -0
  18. data/lib/myob/essentials/api/model/account_type.rb +13 -0
  19. data/lib/myob/essentials/api/model/base.rb +114 -0
  20. data/lib/myob/essentials/api/model/business.rb +13 -0
  21. data/lib/myob/essentials/api/model/contact.rb +13 -0
  22. data/lib/myob/essentials/api/model/inventory_item.rb +13 -0
  23. data/lib/myob/essentials/api/model/sale_invoice.rb +13 -0
  24. data/lib/myob/essentials/api/model/sale_payment.rb +13 -0
  25. data/lib/myob/essentials/api/model/tax_type.rb +13 -0
  26. data/myob-essentials-api.gemspec +102 -0
  27. data/spec/fixtures/account/classifications.json +104 -0
  28. data/spec/fixtures/account/classifications/1.json +11 -0
  29. data/spec/fixtures/account/types.json +170 -0
  30. data/spec/fixtures/account/types/1.json +11 -0
  31. data/spec/fixtures/base1.json +38 -0
  32. data/spec/fixtures/base2.json +42 -0
  33. data/spec/fixtures/base3.json +29 -0
  34. data/spec/fixtures/businesses.json +84 -0
  35. data/spec/fixtures/businesses/168254.json +34 -0
  36. data/spec/fixtures/businesses/168254/contacts.json +386 -0
  37. data/spec/fixtures/businesses/168254/contacts/3604150.json +37 -0
  38. data/spec/fixtures/businesses/168254/generalledger/accounts.json +1978 -0
  39. data/spec/fixtures/businesses/168254/generalledger/accounts/10108109.json +29 -0
  40. data/spec/fixtures/businesses/168254/inventory/items.json +331 -0
  41. data/spec/fixtures/businesses/168254/inventory/items/987816.json +45 -0
  42. data/spec/fixtures/businesses/168254/sale/invoices.json +131 -0
  43. data/spec/fixtures/businesses/168254/sale/invoices/35608735.json +55 -0
  44. data/spec/fixtures/tax/types.json +79 -0
  45. data/spec/fixtures/tax/types/5.json +7 -0
  46. data/spec/myob/essentials/api/client_spec.rb +78 -0
  47. data/spec/myob/essentials/api/model/account_classification_spec.rb +31 -0
  48. data/spec/myob/essentials/api/model/account_spec.rb +31 -0
  49. data/spec/myob/essentials/api/model/account_type_spec.rb +31 -0
  50. data/spec/myob/essentials/api/model/base_spec.rb +100 -0
  51. data/spec/myob/essentials/api/model/business_spec.rb +31 -0
  52. data/spec/myob/essentials/api/model/contact_spec.rb +32 -0
  53. data/spec/myob/essentials/api/model/inventory_item_spec.rb +32 -0
  54. data/spec/myob/essentials/api/model/sale_invoice_spec.rb +32 -0
  55. data/spec/myob/essentials/api/model/sale_payment_spec.rb +34 -0
  56. data/spec/myob/essentials/api/model/tax_type_spec.rb +31 -0
  57. data/spec/spec_helper.rb +94 -0
  58. metadata +143 -0
@@ -0,0 +1,29 @@
1
+ {
2
+ "uid": "10108109",
3
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108109",
4
+ "name": "Fee income",
5
+ "displayId": "4-1200",
6
+ "type": {
7
+ "uid": "9",
8
+ "uri": null,
9
+ "name": "Income",
10
+ "classification": {
11
+ "uid": "4",
12
+ "uri": null,
13
+ "name": "Income"
14
+ }
15
+ },
16
+ "taxType": {
17
+ "uid": "10",
18
+ "uri": null,
19
+ "code": "GST",
20
+ "name": "Goods & Services Tax"
21
+ },
22
+ "active": true,
23
+ "_links": [
24
+ {
25
+ "rel": "self",
26
+ "href": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108109"
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,331 @@
1
+ {
2
+ "_links": [
3
+ {
4
+ "rel": "self",
5
+ "href": "https://api.myob.com/au/essentials/businesses/168254/inventory/items"
6
+ }
7
+ ],
8
+ "items": [
9
+ {
10
+ "uid": "987816",
11
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987816",
12
+ "number": "BX22",
13
+ "name": "Business Cards",
14
+ "description": "",
15
+ "unitOfMeasure": "QTY",
16
+ "unitDescription": "",
17
+ "type": "Stock",
18
+ "active": true,
19
+ "salePrice": 88.5,
20
+ "purchasePrice": 80,
21
+ "saleAccount": {
22
+ "uid": "10108111",
23
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108111",
24
+ "name": "Sales 1",
25
+ "displayId": "4-2400"
26
+ },
27
+ "saleTaxType": {
28
+ "uid": "10",
29
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
30
+ "code": "GST",
31
+ "name": "Goods & Services Tax"
32
+ },
33
+ "purchaseAccount": {
34
+ "uid": "10108115",
35
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108115",
36
+ "name": "Purchases 1",
37
+ "displayId": "5-2800"
38
+ },
39
+ "purchaseTaxType": {
40
+ "uid": "10",
41
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
42
+ "code": "GST",
43
+ "name": "Goods & Services Tax"
44
+ },
45
+ "bought": true,
46
+ "sold": true,
47
+ "_links": [
48
+ {
49
+ "rel": "self",
50
+ "href": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987816"
51
+ }
52
+ ]
53
+ },
54
+ {
55
+ "uid": "987817",
56
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987817",
57
+ "number": "DE900",
58
+ "name": "Key Rings",
59
+ "description": "",
60
+ "unitOfMeasure": "QTY",
61
+ "unitDescription": "",
62
+ "type": "Stock",
63
+ "active": true,
64
+ "salePrice": 2,
65
+ "purchasePrice": 1.5,
66
+ "saleAccount": {
67
+ "uid": "10108112",
68
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108112",
69
+ "name": "Sales 2",
70
+ "displayId": "4-2600"
71
+ },
72
+ "saleTaxType": {
73
+ "uid": "10",
74
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
75
+ "code": "GST",
76
+ "name": "Goods & Services Tax"
77
+ },
78
+ "purchaseAccount": {
79
+ "uid": "10108115",
80
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108115",
81
+ "name": "Purchases 1",
82
+ "displayId": "5-2800"
83
+ },
84
+ "purchaseTaxType": {
85
+ "uid": "10",
86
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
87
+ "code": "GST",
88
+ "name": "Goods & Services Tax"
89
+ },
90
+ "bought": true,
91
+ "sold": true,
92
+ "_links": [
93
+ {
94
+ "rel": "self",
95
+ "href": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987817"
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "uid": "987818",
101
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987818",
102
+ "number": "DE902",
103
+ "name": "Manila folders",
104
+ "description": "",
105
+ "unitOfMeasure": "QTY",
106
+ "unitDescription": "",
107
+ "type": "Stock",
108
+ "active": true,
109
+ "salePrice": 8.75,
110
+ "purchasePrice": 8,
111
+ "saleAccount": {
112
+ "uid": "10108112",
113
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108112",
114
+ "name": "Sales 2",
115
+ "displayId": "4-2600"
116
+ },
117
+ "saleTaxType": {
118
+ "uid": "10",
119
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
120
+ "code": "GST",
121
+ "name": "Goods & Services Tax"
122
+ },
123
+ "purchaseAccount": {
124
+ "uid": "10108115",
125
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108115",
126
+ "name": "Purchases 1",
127
+ "displayId": "5-2800"
128
+ },
129
+ "purchaseTaxType": {
130
+ "uid": "10",
131
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
132
+ "code": "GST",
133
+ "name": "Goods & Services Tax"
134
+ },
135
+ "bought": true,
136
+ "sold": true,
137
+ "_links": [
138
+ {
139
+ "rel": "self",
140
+ "href": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987818"
141
+ }
142
+ ]
143
+ },
144
+ {
145
+ "uid": "987819",
146
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987819",
147
+ "number": "DE808",
148
+ "name": "Notebooks",
149
+ "description": "Moleskin premium leather",
150
+ "unitOfMeasure": "QTY",
151
+ "unitDescription": "",
152
+ "type": "Stock",
153
+ "active": true,
154
+ "salePrice": 35,
155
+ "purchasePrice": 32,
156
+ "saleAccount": {
157
+ "uid": "10108112",
158
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108112",
159
+ "name": "Sales 2",
160
+ "displayId": "4-2600"
161
+ },
162
+ "saleTaxType": {
163
+ "uid": "10",
164
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
165
+ "code": "GST",
166
+ "name": "Goods & Services Tax"
167
+ },
168
+ "purchaseAccount": {
169
+ "uid": "10108115",
170
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108115",
171
+ "name": "Purchases 1",
172
+ "displayId": "5-2800"
173
+ },
174
+ "purchaseTaxType": {
175
+ "uid": "10",
176
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
177
+ "code": "GST",
178
+ "name": "Goods & Services Tax"
179
+ },
180
+ "bought": true,
181
+ "sold": true,
182
+ "_links": [
183
+ {
184
+ "rel": "self",
185
+ "href": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987819"
186
+ }
187
+ ]
188
+ },
189
+ {
190
+ "uid": "987815",
191
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987815",
192
+ "number": "AC304",
193
+ "name": "Pens",
194
+ "description": "ball point and gel tips",
195
+ "unitOfMeasure": "QTY",
196
+ "unitDescription": "",
197
+ "type": "Stock",
198
+ "active": true,
199
+ "salePrice": 5.5,
200
+ "purchasePrice": 5,
201
+ "saleAccount": {
202
+ "uid": "10108111",
203
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108111",
204
+ "name": "Sales 1",
205
+ "displayId": "4-2400"
206
+ },
207
+ "saleTaxType": {
208
+ "uid": "10",
209
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
210
+ "code": "GST",
211
+ "name": "Goods & Services Tax"
212
+ },
213
+ "purchaseAccount": {
214
+ "uid": "10108115",
215
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108115",
216
+ "name": "Purchases 1",
217
+ "displayId": "5-2800"
218
+ },
219
+ "purchaseTaxType": {
220
+ "uid": "10",
221
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
222
+ "code": "GST",
223
+ "name": "Goods & Services Tax"
224
+ },
225
+ "bought": true,
226
+ "sold": true,
227
+ "_links": [
228
+ {
229
+ "rel": "self",
230
+ "href": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987815"
231
+ }
232
+ ]
233
+ },
234
+ {
235
+ "uid": "987820",
236
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987820",
237
+ "number": "ST907",
238
+ "name": "Stationary",
239
+ "description": "Stationary",
240
+ "unitOfMeasure": "QTY",
241
+ "unitDescription": "",
242
+ "type": "Stock",
243
+ "active": true,
244
+ "salePrice": 240,
245
+ "purchasePrice": 210,
246
+ "saleAccount": {
247
+ "uid": "10108112",
248
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108112",
249
+ "name": "Sales 2",
250
+ "displayId": "4-2600"
251
+ },
252
+ "saleTaxType": {
253
+ "uid": "10",
254
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
255
+ "code": "GST",
256
+ "name": "Goods & Services Tax"
257
+ },
258
+ "purchaseAccount": {
259
+ "uid": "10108115",
260
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108115",
261
+ "name": "Purchases 1",
262
+ "displayId": "5-2800"
263
+ },
264
+ "purchaseTaxType": {
265
+ "uid": "10",
266
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
267
+ "code": "GST",
268
+ "name": "Goods & Services Tax"
269
+ },
270
+ "bought": true,
271
+ "sold": true,
272
+ "_links": [
273
+ {
274
+ "rel": "self",
275
+ "href": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987820"
276
+ }
277
+ ]
278
+ },
279
+ {
280
+ "uid": "987821",
281
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987821",
282
+ "number": "TT874",
283
+ "name": "Telephone",
284
+ "description": "Telephone bill",
285
+ "unitOfMeasure": "QTY",
286
+ "unitDescription": "",
287
+ "type": "Stock",
288
+ "active": true,
289
+ "salePrice": 89,
290
+ "purchasePrice": 75,
291
+ "saleAccount": {
292
+ "uid": "10108112",
293
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108112",
294
+ "name": "Sales 2",
295
+ "displayId": "4-2600"
296
+ },
297
+ "saleTaxType": {
298
+ "uid": "10",
299
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
300
+ "code": "GST",
301
+ "name": "Goods & Services Tax"
302
+ },
303
+ "purchaseAccount": {
304
+ "uid": "10108115",
305
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108115",
306
+ "name": "Purchases 1",
307
+ "displayId": "5-2800"
308
+ },
309
+ "purchaseTaxType": {
310
+ "uid": "10",
311
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
312
+ "code": "GST",
313
+ "name": "Goods & Services Tax"
314
+ },
315
+ "bought": true,
316
+ "sold": true,
317
+ "_links": [
318
+ {
319
+ "rel": "self",
320
+ "href": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987821"
321
+ }
322
+ ]
323
+ }
324
+ ],
325
+ "page": {
326
+ "size": 400,
327
+ "totalElements": 7,
328
+ "totalPages": 1,
329
+ "number": 1
330
+ }
331
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "uid": "987816",
3
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987816",
4
+ "number": "BX22",
5
+ "name": "Business Cards",
6
+ "description": "",
7
+ "unitOfMeasure": "QTY",
8
+ "unitDescription": "",
9
+ "type": "Stock",
10
+ "active": true,
11
+ "salePrice": 88.5,
12
+ "purchasePrice": 80,
13
+ "saleAccount": {
14
+ "uid": "10108111",
15
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108111",
16
+ "name": "Sales 1",
17
+ "displayId": "4-2400"
18
+ },
19
+ "saleTaxType": {
20
+ "uid": "10",
21
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
22
+ "code": "GST",
23
+ "name": "Goods & Services Tax"
24
+ },
25
+ "purchaseAccount": {
26
+ "uid": "10108115",
27
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/generalledger/accounts/10108115",
28
+ "name": "Purchases 1",
29
+ "displayId": "5-2800"
30
+ },
31
+ "purchaseTaxType": {
32
+ "uid": "10",
33
+ "uri": "https://api.myob.com/au/essentials/tax/types/10",
34
+ "code": "GST",
35
+ "name": "Goods & Services Tax"
36
+ },
37
+ "bought": true,
38
+ "sold": true,
39
+ "_links": [
40
+ {
41
+ "rel": "self",
42
+ "href": "https://api.myob.com/au/essentials/businesses/168254/inventory/items/987816"
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,131 @@
1
+ {
2
+ "_links": [
3
+ {
4
+ "rel": "self",
5
+ "href": "https://api.myob.com/au/essentials/businesses/168254/sale/invoices"
6
+ }
7
+ ],
8
+ "items": [
9
+ {
10
+ "uid": "35608735",
11
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/sale/invoices/35608735",
12
+ "invoiceNumber": "IV00000000001",
13
+ "contact": {
14
+ "uid": "3604148",
15
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/contacts/3604148",
16
+ "name": "Malvern Glass"
17
+ },
18
+ "issueDate": "2014-09-29",
19
+ "dueDate": "2014-10-29",
20
+ "status": "Open",
21
+ "displayStatus": "Overdue",
22
+ "total": 907.5,
23
+ "amountDue": 907.5,
24
+ "sent": false,
25
+ "_links": [
26
+ {
27
+ "rel": "self",
28
+ "href": "https://api.myob.com/au/essentials/businesses/168254/sale/invoices/35608735"
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ "uid": "35608736",
34
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/sale/invoices/35608736",
35
+ "invoiceNumber": "IV00000000002",
36
+ "contact": {
37
+ "uid": "3604150",
38
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/contacts/3604150",
39
+ "name": "Brighton Body Works"
40
+ },
41
+ "issueDate": "2014-09-29",
42
+ "dueDate": "2014-10-29",
43
+ "status": "Open",
44
+ "displayStatus": "Overdue",
45
+ "total": 550,
46
+ "amountDue": 550,
47
+ "sent": false,
48
+ "_links": [
49
+ {
50
+ "rel": "self",
51
+ "href": "https://api.myob.com/au/essentials/businesses/168254/sale/invoices/35608736"
52
+ }
53
+ ]
54
+ },
55
+ {
56
+ "uid": "35608737",
57
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/sale/invoices/35608737",
58
+ "invoiceNumber": "IV00000000003",
59
+ "contact": {
60
+ "uid": "3604151",
61
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/contacts/3604151",
62
+ "name": "Red Dragon"
63
+ },
64
+ "issueDate": "2014-09-29",
65
+ "dueDate": "2014-10-29",
66
+ "status": "Open",
67
+ "displayStatus": "Overdue",
68
+ "total": 962.5,
69
+ "amountDue": 962.5,
70
+ "sent": false,
71
+ "_links": [
72
+ {
73
+ "rel": "self",
74
+ "href": "https://api.myob.com/au/essentials/businesses/168254/sale/invoices/35608737"
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "uid": "35608738",
80
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/sale/invoices/35608738",
81
+ "invoiceNumber": "IV00000000004",
82
+ "contact": {
83
+ "uid": "3604151",
84
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/contacts/3604151",
85
+ "name": "Red Dragon"
86
+ },
87
+ "issueDate": "2014-09-29",
88
+ "dueDate": "2014-10-29",
89
+ "status": "Open",
90
+ "displayStatus": "Overdue",
91
+ "total": 1684.38,
92
+ "amountDue": 1684.38,
93
+ "sent": false,
94
+ "_links": [
95
+ {
96
+ "rel": "self",
97
+ "href": "https://api.myob.com/au/essentials/businesses/168254/sale/invoices/35608738"
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "uid": "35608739",
103
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/sale/invoices/35608739",
104
+ "invoiceNumber": "IV00000000005",
105
+ "contact": {
106
+ "uid": "3604150",
107
+ "uri": "https://api.myob.com/au/essentials/businesses/168254/contacts/3604150",
108
+ "name": "Brighton Body Works"
109
+ },
110
+ "issueDate": "2014-09-29",
111
+ "dueDate": "2014-10-29",
112
+ "status": "Open",
113
+ "displayStatus": "Overdue",
114
+ "total": 2213.75,
115
+ "amountDue": 2213.75,
116
+ "sent": false,
117
+ "_links": [
118
+ {
119
+ "rel": "self",
120
+ "href": "https://api.myob.com/au/essentials/businesses/168254/sale/invoices/35608739"
121
+ }
122
+ ]
123
+ }
124
+ ],
125
+ "page": {
126
+ "size": 400,
127
+ "totalElements": 5,
128
+ "totalPages": 1,
129
+ "number": 1
130
+ }
131
+ }