myfinance 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +24 -0
  3. data/.rubocop.yml +1156 -0
  4. data/.travis.yml +3 -3
  5. data/Gemfile.lock +7 -7
  6. data/README.md +309 -2
  7. data/lib/myfinance.rb +15 -0
  8. data/lib/myfinance/client.rb +20 -0
  9. data/lib/myfinance/entities/account.rb +26 -0
  10. data/lib/myfinance/entities/account_collection.rb +16 -0
  11. data/lib/myfinance/entities/category.rb +22 -0
  12. data/lib/myfinance/entities/category_collection.rb +16 -0
  13. data/lib/myfinance/entities/classification_center.rb +15 -0
  14. data/lib/myfinance/entities/classification_center_collection.rb +18 -0
  15. data/lib/myfinance/entities/deposit_account.rb +24 -0
  16. data/lib/myfinance/entities/deposit_account_collection.rb +16 -0
  17. data/lib/myfinance/entities/person.rb +38 -0
  18. data/lib/myfinance/entities/person_collection.rb +14 -0
  19. data/lib/myfinance/resources/account.rb +25 -0
  20. data/lib/myfinance/resources/category.rb +81 -0
  21. data/lib/myfinance/resources/classification_center.rb +103 -0
  22. data/lib/myfinance/resources/deposit_account.rb +93 -0
  23. data/lib/myfinance/resources/person.rb +97 -0
  24. data/lib/myfinance/version.rb +1 -1
  25. data/spec/lib/myfinance/client_spec.rb +40 -0
  26. data/spec/lib/myfinance/entities/account_collection_spec.rb +19 -0
  27. data/spec/lib/myfinance/entities/account_spec.rb +13 -0
  28. data/spec/lib/myfinance/entities/category_collection_spec.rb +47 -0
  29. data/spec/lib/myfinance/entities/category_spec.rb +12 -0
  30. data/spec/lib/myfinance/entities/classification_center_collection_spec.rb +23 -0
  31. data/spec/lib/myfinance/entities/classification_center_spec.rb +8 -0
  32. data/spec/lib/myfinance/entities/deposit_account_collection_spec.rb +23 -0
  33. data/spec/lib/myfinance/entities/deposit_account_spec.rb +11 -0
  34. data/spec/lib/myfinance/entities/person_collection_spec.rb +26 -0
  35. data/spec/lib/myfinance/entities/person_spec.rb +18 -0
  36. data/spec/lib/myfinance/resources/account_spec.rb +28 -0
  37. data/spec/lib/myfinance/resources/category_spec.rb +118 -0
  38. data/spec/lib/myfinance/resources/classification_center_spec.rb +147 -0
  39. data/spec/lib/myfinance/resources/deposit_account_spec.rb +123 -0
  40. data/spec/lib/myfinance/resources/person_spec.rb +139 -0
  41. metadata +50 -3
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
4
- - 2.1.1
5
- - 2.2.2
3
+ - 2.1.9
4
+ - 2.2.5
5
+ - 2.3.1
6
6
  script:
7
7
  - bundle exec rake --trace spec
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- myfinance (0.4.0)
4
+ myfinance (0.5.0)
5
5
  mime-types (~> 2.99)
6
6
  multi_json (~> 1.11)
7
7
  typhoeus (~> 0.8)
@@ -28,14 +28,14 @@ GEM
28
28
  diff-lcs (1.2.5)
29
29
  docile (1.1.5)
30
30
  equalizer (0.0.11)
31
- ethon (0.8.1)
31
+ ethon (0.10.1)
32
32
  ffi (>= 1.3.0)
33
- ffi (1.9.10)
33
+ ffi (1.9.18)
34
34
  ice_nine (0.11.2)
35
35
  json (1.8.3)
36
36
  method_source (0.8.2)
37
- mime-types (2.99.1)
38
- multi_json (1.11.2)
37
+ mime-types (2.99.3)
38
+ multi_json (1.12.1)
39
39
  pry (0.10.3)
40
40
  coderay (~> 1.1.0)
41
41
  method_source (~> 0.8.1)
@@ -63,7 +63,7 @@ GEM
63
63
  simplecov-html (~> 0.10.0)
64
64
  simplecov-html (0.10.0)
65
65
  slop (3.6.0)
66
- thread_safe (0.3.5)
66
+ thread_safe (0.3.6)
67
67
  typhoeus (0.8.0)
68
68
  ethon (>= 0.8.0)
69
69
  vcr (2.9.3)
@@ -93,4 +93,4 @@ DEPENDENCIES
93
93
  webmock (~> 1.9.3)
94
94
 
95
95
  BUNDLED WITH
96
- 1.11.2
96
+ 1.13.6
data/README.md CHANGED
@@ -39,6 +39,11 @@ client = Myfinance.client("YOUR_TOKEN_HERE")
39
39
  * [PayableAccounts API](https://app.myfinance.com.br/docs/api/payable_accounts) as `client.payable_accounts`
40
40
  * [ReceivableAccounts API](https://app.myfinance.com.br/docs/api/receivable_accounts) as `client.receivable_accounts`
41
41
  * [Attachments API](https://app.myfinance.com.br/docs/api/attachments) as `client.attachments`
42
+ * [Accounts API](https://app.myfinance.com.br/docs/api/multiple_accounts) as `client.accounts`
43
+ * [DepositAccounts API](https://app.myfinance.com.br/docs/api/deposit_accounts) as `client.deposit_accounts`
44
+ * [Categories API](https://app.myfinance.com.br/docs/api/categories) as `client.categories`
45
+ * [ClassificationCenters API](https://app.myfinance.com.br/docs/api/classification_centers) as `client.classification_centers`
46
+ * [People API](https://app.myfinance.com.br/docs/api/people) as `client.people`
42
47
 
43
48
  ### Endpoints
44
49
 
@@ -258,6 +263,310 @@ client = Myfinance.client("YOUR_TOKEN_HERE")
258
263
  </tr>
259
264
  </table>
260
265
 
266
+ #### [Accounts](https://app.myfinance.com.br/docs/api/multiple_accounts)
267
+
268
+ <table>
269
+ <tr>
270
+ <th>HTTP method</th>
271
+ <th>Endpoint</th>
272
+ <th>Client method</th>
273
+ </tr>
274
+ <tr>
275
+ <td><code>GET</code></td>
276
+ <td>
277
+ <a href="https://app.myfinance.com.br/docs/api/multiple_accounts#get_index" target="_blank">
278
+ /accounts
279
+ </a>
280
+ </td>
281
+ <td>
282
+ <code>client.accounts.find_all</code>
283
+ </td>
284
+ </tr>
285
+ </table>
286
+
287
+ #### [DepositAccounts](https://app.myfinance.com.br/docs/api/deposit_accounts)
288
+
289
+ <table>
290
+ <tr>
291
+ <th>HTTP method</th>
292
+ <th>Endpoint</th>
293
+ <th>Client method</th>
294
+ </tr>
295
+ <tr>
296
+ <td><code>GET</code></td>
297
+ <td>
298
+ <a href="https://app.myfinance.com.br/docs/api/deposit_accounts#get_index" target="_blank">
299
+ /entities/:entity_id/deposit_accounts
300
+ </a>
301
+ </td>
302
+ <td>
303
+ <code>client.deposit_accounts.find_all</code>
304
+ </td>
305
+ </tr>
306
+ <tr>
307
+ <td><code>GET</code></td>
308
+ <td>
309
+ <a href="https://app.myfinance.com.br/docs/api/deposit_accounts#get_show" target="_blank">
310
+ /entities/:entity_id/deposit_accounts/:id
311
+ </a>
312
+ </td>
313
+ <td>
314
+ <code>client.deposit_accounts.find</code>
315
+ </td>
316
+ </tr>
317
+ <tr>
318
+ <td><code>POST</code></td>
319
+ <td>
320
+ <a href="https://app.myfinance.com.br/docs/api/deposit_accounts#post_create" target="_blank">
321
+ /entities/:entity_id/deposit_accounts
322
+ </a>
323
+ </td>
324
+ <td>
325
+ <code>client.deposit_accounts.create</code>
326
+ </td>
327
+ </tr>
328
+ <tr>
329
+ <td><code>PUT</code></td>
330
+ <td>
331
+ <a href="https://app.myfinance.com.br/docs/api/deposit_accounts#put_update" target="_blank">
332
+ /entities/:entity_id/deposit_accounts/:id
333
+ </a>
334
+ </td>
335
+ <td>
336
+ <code>client.deposit_accounts.update</code>
337
+ </td>
338
+ </tr>
339
+ <tr>
340
+ <td><code>DELETE</code></td>
341
+ <td>
342
+ <a href="https://app.myfinance.com.br/docs/api/deposit_accounts#delete_destroy" target="_blank">
343
+ /entities/:entity_id/deposit_accounts/:id
344
+ </a>
345
+ </td>
346
+ <td>
347
+ <code>client.deposit_accounts.destroy</code>
348
+ </td>
349
+ </tr>
350
+ </table>
351
+
352
+ #### [Categories](https://app.myfinance.com.br/docs/api/categories)
353
+
354
+ <table>
355
+ <tr>
356
+ <th>HTTP method</th>
357
+ <th>Endpoint</th>
358
+ <th>Client method</th>
359
+ </tr>
360
+ <tr>
361
+ <td><code>GET</code></td>
362
+ <td>
363
+
364
+ <a href="https://app.myfinance.com.br/docs/api/categories#get_index" target="_blank">
365
+ /categories
366
+ </a>
367
+ </td>
368
+ <td>
369
+ <code>client.categories.find_all</code>
370
+ </td>
371
+ </tr>
372
+ <tr>
373
+ <td><code>GET</code></td>
374
+ <td>
375
+ <a href="https://app.myfinance.com.br/docs/api/categories#get_show" target="_blank">
376
+ /categories/:id
377
+ </a>
378
+ </td>
379
+ <td>
380
+ <code>client.categories.find</code>
381
+ </td>
382
+ </tr>
383
+ <tr>
384
+ <td><code>POST</code></td>
385
+ <td>
386
+ <a href="https://app.myfinance.com.br/docs/api/categories#post_create" target="_blank">
387
+ /categories
388
+ </a>
389
+ </td>
390
+ <td>
391
+ <code>client.categories.create</code>
392
+ </td>
393
+ </tr>
394
+ <tr>
395
+ <td><code>PUT</code></td>
396
+ <td>
397
+ <a href="https://app.myfinance.com.br/docs/api/categories#put_update" target="_blank">
398
+ /categories/:id
399
+ </a>
400
+ </td>
401
+ <td>
402
+ <code>client.categories.update</code>
403
+ </td>
404
+ </tr>
405
+ <tr>
406
+ <td><code>DELETE</code></td>
407
+ <td>
408
+ <a href="https://app.myfinance.com.br/docs/api/categories#delete_destroy" target="_blank">
409
+ /categories/:id
410
+ </a>
411
+ </td>
412
+ <td>
413
+ <code>client.categories.destroy</code>
414
+ </td>
415
+ </tr>
416
+ </table>
417
+
418
+ #### [ClassificationCenters](https://app.myfinance.com.br/docs/api/classification_centers)
419
+
420
+ <table>
421
+ <tr>
422
+ <th>HTTP method</th>
423
+ <th>Endpoint</th>
424
+ <th>Client method</th>
425
+ </tr>
426
+ <tr>
427
+ <td><code>GET</code></td>
428
+ <td>
429
+ <a href="https://app.myfinance.com.br/docs/api/classification_centers#get_index" target="_blank">
430
+ /classification_centers
431
+ </a>
432
+ </td>
433
+ <td>
434
+ <code>client.classification_centers.find_all</code>
435
+ </td>
436
+ </tr>
437
+ <tr>
438
+ <td><code>GET</code></td>
439
+ <td>
440
+ <a href="https://app.myfinance.com.br/docs/api/classification_centers#get_show" target="_blank">
441
+ /classification_centers/:id
442
+ </a>
443
+ </td>
444
+ <td>
445
+ <code>client.classification_centers.find</code>
446
+ </td>
447
+ </tr>
448
+ <tr>
449
+ <td><code>GET</code></td>
450
+ <td>
451
+ <a href="https://app.myfinance.com.br/docs/api/classification_centers#get_show" target="_blank">
452
+ /classification_centers
453
+ </a>
454
+ </td>
455
+ <td>
456
+ <code>client.classification_centers.find_by</code>
457
+ </td>
458
+ </tr>
459
+ <tr>
460
+ <td><code>POST</code></td>
461
+ <td>
462
+ <a href="https://app.myfinance.com.br/docs/api/classification_centers#post_create" target="_blank">
463
+ /classification_centers
464
+ </a>
465
+ </td>
466
+ <td>
467
+ <code>client.classification_centers.create</code>
468
+ </td>
469
+ </tr>
470
+ <tr>
471
+ <td><code>PUT</code></td>
472
+ <td>
473
+ <a href="https://app.myfinance.com.br/docs/api/classification_centers#put_update" target="_blank">
474
+ /classification_centers/:id
475
+ </a>
476
+ </td>
477
+ <td>
478
+ <code>client.classification_centers.update</code>
479
+ </td>
480
+ </tr>
481
+ <tr>
482
+ <td><code>DELETE</code></td>
483
+ <td>
484
+ <a href="https://app.myfinance.com.br/docs/api/classification_centers#delete_destroy" target="_blank">
485
+ /classification_centers/:id
486
+ </a>
487
+ </td>
488
+ <td>
489
+ <code>client.classification_centers.destroy</code>
490
+ </td>
491
+ </tr>
492
+ </table>
493
+
494
+ #### [People](https://app.myfinance.com.br/docs/api/people)
495
+
496
+ <table>
497
+ <tr>
498
+ <th>HTTP method</th>
499
+ <th>Endpoint</th>
500
+ <th>Client method</th>
501
+ </tr>
502
+ <tr>
503
+ <td><code>GET</code></td>
504
+ <td>
505
+ <a href="https://app.myfinance.com.br/docs/api/people#get_index" target="_blank">
506
+ /people
507
+ </a>
508
+ </td>
509
+ <td>
510
+ <code>client.people.find_all</code>
511
+ </td>
512
+ </tr>
513
+ <tr>
514
+ <td><code>GET</code></td>
515
+ <td>
516
+ <a href="https://app.myfinance.com.br/docs/api/people" target="_blank">
517
+ /people
518
+ </a>
519
+ </td>
520
+ <td>
521
+ <code>client.people.find_by</code>
522
+ </td>
523
+ </tr>
524
+ <tr>
525
+ <td><code>GET</code></td>
526
+ <td>
527
+ <a href="https://app.myfinance.com.br/docs/api/people#get_show" target="_blank">
528
+ /people/:id
529
+ </a>
530
+ </td>
531
+ <td>
532
+ <code>client.people.find</code>
533
+ </td>
534
+ </tr>
535
+ <tr>
536
+ <td><code>POST</code></td>
537
+ <td>
538
+ <a href="https://app.myfinance.com.br/docs/api/people#post_create" target="_blank">
539
+ /people
540
+ </a>
541
+ </td>
542
+ <td>
543
+ <code>client.people.create</code>
544
+ </td>
545
+ </tr>
546
+ <tr>
547
+ <td><code>PUT</code></td>
548
+ <td>
549
+ <a href="https://app.myfinance.com.br/docs/api/people#put_update" target="_blank">
550
+ /people/:id
551
+ </a>
552
+ </td>
553
+ <td>
554
+ <code>client.people.update</code>
555
+ </td>
556
+ </tr>
557
+ <tr>
558
+ <td><code>DELETE</code></td>
559
+ <td>
560
+ <a href="https://app.myfinance.com.br/docs/api/people#delete_destroy" target="_blank">
561
+ /people/:id
562
+ </a>
563
+ </td>
564
+ <td>
565
+ <code>client.people.destroy</code>
566
+ </td>
567
+ </tr>
568
+ </table>
569
+
261
570
  ### Configuration
262
571
 
263
572
  ```ruby
@@ -299,8 +608,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
299
608
 
300
609
  Bug reports and pull requests are welcome on GitHub at https://github.com/myfreecomm/myfinance-client-ruby. This project is intended to be a safe and welcoming space for collaboration.
301
610
 
302
-
303
611
  ## License
304
612
 
305
613
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
306
-
@@ -16,6 +16,16 @@ require "myfinance/entities/financial_account"
16
16
  require "myfinance/entities/payable_account"
17
17
  require "myfinance/entities/receivable_account"
18
18
  require "myfinance/entities/attachment"
19
+ require "myfinance/entities/classification_center"
20
+ require "myfinance/entities/classification_center_collection"
21
+ require "myfinance/entities/category"
22
+ require "myfinance/entities/category_collection"
23
+ require "myfinance/entities/account"
24
+ require "myfinance/entities/account_collection"
25
+ require "myfinance/entities/deposit_account"
26
+ require "myfinance/entities/deposit_account_collection"
27
+ require "myfinance/entities/person"
28
+ require "myfinance/entities/person_collection"
19
29
 
20
30
  require "myfinance/resources/base"
21
31
  require "myfinance/resources/entity"
@@ -23,6 +33,11 @@ require "myfinance/resources/financial_account"
23
33
  require "myfinance/resources/payable_account"
24
34
  require "myfinance/resources/receivable_account"
25
35
  require "myfinance/resources/attachment"
36
+ require "myfinance/resources/classification_center"
37
+ require "myfinance/resources/category"
38
+ require "myfinance/resources/account"
39
+ require "myfinance/resources/deposit_account"
40
+ require "myfinance/resources/person"
26
41
 
27
42
  module Myfinance
28
43
  def self.configuration
@@ -31,5 +31,25 @@ module Myfinance
31
31
  def attachments
32
32
  Myfinance::Resources::Attachment.new(http)
33
33
  end
34
+
35
+ def classification_centers
36
+ Myfinance::Resources::ClassificationCenter.new(http)
37
+ end
38
+
39
+ def categories
40
+ Myfinance::Resources::Category.new(http)
41
+ end
42
+
43
+ def accounts
44
+ Myfinance::Resources::Account.new(http)
45
+ end
46
+
47
+ def deposit_accounts
48
+ Myfinance::Resources::DepositAccount.new(http)
49
+ end
50
+
51
+ def people
52
+ Myfinance::Resources::Person.new(http)
53
+ end
34
54
  end
35
55
  end
@@ -0,0 +1,26 @@
1
+ module Myfinance
2
+ module Entities
3
+ class Account < Base
4
+ attribute :beta, Boolean
5
+ attribute :canceled_at, DateTime
6
+ attribute :cancellation_reason, String
7
+ attribute :charging_uuid, String
8
+ attribute :created_at, DateTime
9
+ attribute :default_currency_id, Integer
10
+ attribute :ecommerce_response, String
11
+ attribute :expires_on, Date
12
+ attribute :id, Integer
13
+ attribute :invite, String
14
+ attribute :is_trial, Boolean
15
+ attribute :name, String
16
+ attribute :owner_id, Integer
17
+ attribute :payment_method, String
18
+ attribute :plan_slug, String
19
+ attribute :referral_code, String
20
+ attribute :referrer_id, Integer
21
+ attribute :updated_at, DateTime
22
+ attribute :uuid, String
23
+ attribute :waiting_payment, Boolean
24
+ end
25
+ end
26
+ end