economic-rest 0.5.6 → 0.5.7

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
  SHA256:
3
- metadata.gz: dc4d033f6a75d6511c4093d245efd77f8f89a798041e9f5f9722f68de9154fd1
4
- data.tar.gz: 68459bf79ebf33bd9df2b468cbe7a66269ea769d5d4cf496b4de5551098de56b
3
+ metadata.gz: 20f67e5c9705573a15158f9d1b584f84cf5b16024fbc4b199ae20193c2885df2
4
+ data.tar.gz: 1975cf48bfc94353e99c50be229707e997da7d069fd5e1a7a178796044535a23
5
5
  SHA512:
6
- metadata.gz: 5056b4552c40fbd19e12f34136ebe5999536442c630be69b00412698e33840b42e3a2591e25f4b73d06e5ae09c9250c2b9112276694663cf3f3abd5569e12163
7
- data.tar.gz: 2b7067210049c897d4c123c4e6a26725cf02deb8177b867fbfcff8fa14ff0aed1e13aaaf36283cce082afe0f8c6a2e6a8652b6b69ab69eafa49cf5245713eb22
6
+ metadata.gz: d6b9d5f0136b6b89c8e4e322c6af72daf4a660d2db18021535f26ad5e3a897ca96f99ef409047a608b132f76f1eb2f7fe4b94bc89a707a9371a838db82a545b2
7
+ data.tar.gz: 074e3535e62b3220ad0a96d8cc070767565c67b31e852b8cce897514ae5d44899a8687a4bf2e673dd08a088d32a8fcff523f1041347e49b548e2bb6c0023d8d7
@@ -24,6 +24,12 @@ GEM
24
24
  awesome_print (1.8.0)
25
25
  builder (3.2.3)
26
26
  concurrent-ruby (1.1.5)
27
+ coveralls (0.8.23)
28
+ json (>= 1.8, < 3)
29
+ simplecov (~> 0.16.1)
30
+ term-ansicolor (~> 1.3)
31
+ thor (>= 0.19.4, < 2.0)
32
+ tins (~> 1.6)
27
33
  crack (0.4.3)
28
34
  safe_yaml (~> 1.0.0)
29
35
  docile (1.3.1)
@@ -99,7 +105,11 @@ GEM
99
105
  standard (0.1.4)
100
106
  rubocop (~> 0.72.0)
101
107
  rubocop-performance (~> 1.4.0)
108
+ term-ansicolor (1.7.1)
109
+ tins (~> 1.0)
110
+ thor (0.20.3)
102
111
  thread_safe (0.3.6)
112
+ tins (1.22.1)
103
113
  tzinfo (1.2.5)
104
114
  thread_safe (~> 0.1)
105
115
  unf (0.1.4)
@@ -121,6 +131,7 @@ PLATFORMS
121
131
  DEPENDENCIES
122
132
  awesome_print
123
133
  bundler (~> 1.17)
134
+ coveralls
124
135
  dotenv
125
136
  economic-rest!
126
137
  m
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [![Build Status](https://semaphoreci.com/api/v1/traels-it/economic-rest/branches/master/badge.svg)](https://semaphoreci.com/traels-it/economic-rest)
4
4
 
5
+ [![Coverage Status](https://coveralls.io/repos/bitbucket/traels/economic-rest/badge.svg?branch=master)](https://coveralls.io/bitbucket/traels/economic-rest?branch=master)
6
+
5
7
  Ruby wrapper for the e-conomic REST API, that aims at making working with the API bearable.
6
8
  E-conomic is a web-based accounting system. For their marketing speak, see http://www.e-conomic.co.uk/about/. More details about their API at http://www.e-conomic.co.uk/integration/integration-partner/'.
7
9
  The documentation can be found at https://restdocs.e-conomic.com
@@ -33,6 +33,7 @@ The documentation can be found at https://restdocs.e-conomic.com'
33
33
  spec.add_development_dependency "standard"
34
34
  spec.add_development_dependency "awesome_print"
35
35
  spec.add_development_dependency "mocha"
36
+ spec.add_development_dependency "coveralls"
36
37
 
37
38
  spec.add_dependency "savon"
38
39
  spec.add_dependency "rest-client"
@@ -1,5 +1,6 @@
1
1
  module Economic
2
2
  class Attention < Base
3
3
  field :customerContactNumber
4
+ field :supplierContactNumber
4
5
  end
5
6
  end
@@ -77,10 +77,11 @@ module Economic
77
77
  if relation_hash[:multiple]
78
78
  relation_name = relation_hash[:name]
79
79
  relation_fields = relation_hash[:fields]
80
-
81
- arr = public_send(relation_name).map { |relation| relation_data = relation.to_h(only_fields: relation_fields) }
82
-
83
- return_hash[relation_name] = arr
80
+ begin
81
+ arr = public_send(relation_name).map { |relation| relation.to_h(only_fields: relation_fields) }
82
+ return_hash[relation_name] = arr
83
+ rescue NoMethodError
84
+ end
84
85
  else
85
86
  relation_name = relation_hash[:name]
86
87
  relation_fields = relation_hash[:fields]
@@ -0,0 +1,5 @@
1
+ module Economic
2
+ class CostAccount < Base
3
+ field :accountNumber, id: true
4
+ end
5
+ end
@@ -1,6 +1,16 @@
1
1
  module Economic
2
2
  module Invoices
3
3
  class Repo < Economic::BaseRepo
4
+ def self.all
5
+ invoices = super
6
+ invoices.each do |invoice|
7
+ invoice.remove_instance_variable("@lines")
8
+ class << invoice
9
+ define_method(:lines) { raise NoMethodError }
10
+ end
11
+ end
12
+ invoices
13
+ end
4
14
  end
5
15
  end
6
16
  end
@@ -1,6 +1,16 @@
1
1
  module Economic
2
2
  module Orders
3
3
  class Repo < Economic::BaseRepo
4
+ def self.all
5
+ orders = super
6
+ orders.each do |order|
7
+ order.remove_instance_variable("@lines")
8
+ class << order
9
+ define_method(:lines) { raise NoMethodError }
10
+ end
11
+ end
12
+ orders
13
+ end
4
14
  end
5
15
  end
6
16
  end
@@ -0,0 +1,6 @@
1
+ module Economic
2
+ class PaymentType < Base
3
+ field :name
4
+ field :paymentTypeNumber, id: true
5
+ end
6
+ end
@@ -0,0 +1,4 @@
1
+ module Economic
2
+ class PaymentTypeRepo < Economic::BaseRepo
3
+ end
4
+ end
@@ -0,0 +1,7 @@
1
+ module Economic
2
+ class RemittanceAdvice < Base
3
+ field :creditorId
4
+
5
+ relation :paymentType, fields: [:paymentTypeNumber]
6
+ end
7
+ end
@@ -79,6 +79,16 @@ require "economic/line"
79
79
  require "economic/sales_person"
80
80
  require "economic/vendor_reference"
81
81
 
82
+ require "economic/supplier"
83
+ require "economic/supplier_group"
84
+ require "economic/supplier_repo"
85
+ require "economic/supplier_contact"
86
+ require "economic/cost_account"
87
+ require "economic/remittance_advice"
88
+
89
+ require "economic/payment_type"
90
+ require "economic/payment_type_repo"
91
+
82
92
  module Economic
83
93
  class Demo
84
94
  def self.hello
@@ -1,5 +1,5 @@
1
1
  module Economic
2
2
  module Rest
3
- VERSION = "0.5.6".freeze
3
+ VERSION = "0.5.7".freeze
4
4
  end
5
5
  end
@@ -0,0 +1,28 @@
1
+ module Economic
2
+ class Supplier < Base
3
+ field :address
4
+ field :bankAccount
5
+ field :barred
6
+ field :city
7
+ field :contacts
8
+ field :corporateIdentificationNumber
9
+ field :country
10
+ field :currency
11
+ field :defaultInvoiceText
12
+ field :email
13
+ field :name
14
+ field :phone
15
+ field :supplierNumber, id: true
16
+ field :zip
17
+
18
+ relation :attention, fields: [:supplierContactNumber]
19
+ relation :costAccount, fields: [:accountNumber]
20
+ relation :layout, fields: [:layoutNumber]
21
+ relation :paymentTerms, fields: [:paymentTermsNumber]
22
+ relation :remittanceAdvice, fields: [:creditorId]
23
+ relation :salesPerson, fields: [:employeeNumber]
24
+ relation :supplierContact, fields: [:supplierContactNumber]
25
+ relation :supplierGroup, fields: [:supplierGroupNumber]
26
+ relation :vatZone, fields: [:vatZoneNumber]
27
+ end
28
+ end
@@ -0,0 +1,5 @@
1
+ module Economic
2
+ class SupplierContact < Base
3
+ field :supplierContactNumber
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Economic
2
+ class SupplierGroup < Base
3
+ field :supplierGroupNumber, id: true
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module Economic
2
+ class SupplierRepo < Economic::BaseRepo
3
+ end
4
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: economic-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Klogborg
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-08 00:00:00.000000000 Z
11
+ date: 2019-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: coveralls
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: savon
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -217,6 +231,7 @@ files:
217
231
  - lib/economic/base_repo.rb
218
232
  - lib/economic/company.rb
219
233
  - lib/economic/concerns/soap_methods.rb
234
+ - lib/economic/cost_account.rb
220
235
  - lib/economic/currency.rb
221
236
  - lib/economic/customer.rb
222
237
  - lib/economic/customer_contact.rb
@@ -250,6 +265,8 @@ files:
250
265
  - lib/economic/orders/sent_repo.rb
251
266
  - lib/economic/payment_terms.rb
252
267
  - lib/economic/payment_terms_repo.rb
268
+ - lib/economic/payment_type.rb
269
+ - lib/economic/payment_type_repo.rb
253
270
  - lib/economic/pdf.rb
254
271
  - lib/economic/pricing.rb
255
272
  - lib/economic/pricing_repo.rb
@@ -260,6 +277,7 @@ files:
260
277
  - lib/economic/project.rb
261
278
  - lib/economic/recipient.rb
262
279
  - lib/economic/references.rb
280
+ - lib/economic/remittance_advice.rb
263
281
  - lib/economic/rest.rb
264
282
  - lib/economic/rest/version.rb
265
283
  - lib/economic/sales_person.rb
@@ -267,6 +285,10 @@ files:
267
285
  - lib/economic/self_repo.rb
268
286
  - lib/economic/session.rb
269
287
  - lib/economic/soap_api.rb
288
+ - lib/economic/supplier.rb
289
+ - lib/economic/supplier_contact.rb
290
+ - lib/economic/supplier_group.rb
291
+ - lib/economic/supplier_repo.rb
270
292
  - lib/economic/unit.rb
271
293
  - lib/economic/unit_repo.rb
272
294
  - lib/economic/user.rb
@@ -295,7 +317,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
295
317
  - !ruby/object:Gem::Version
296
318
  version: '0'
297
319
  requirements: []
298
- rubygems_version: 3.0.3
320
+ rubyforge_project:
321
+ rubygems_version: 2.7.6
299
322
  signing_key:
300
323
  specification_version: 4
301
324
  summary: Ruby wrapper for the e-conomic REST API, that aims at making working with