fatture_in_cloud_ruby 0.2.4 → 0.2.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cf4bd7db4592e21d1a2fcedff50c9d4bb5812e2a1bb54f1119018d4a5938400
4
- data.tar.gz: 94df36cf4391f42cd77f78aa572649b7a7dfdf1e7bfbdb1a69aac676d12e5ae0
3
+ metadata.gz: b469002a759aa7d15ceb46038b3e0a4db14fdd75dcf7c4bc87142d006659d56d
4
+ data.tar.gz: '08d9b58e6434d0c11e043224dc62914746dbf827a260f3595dc66c615f7a00e9'
5
5
  SHA512:
6
- metadata.gz: 4bb77c6b0712089678165dcc6f9a3bd3c43982a142380c3d411e23bf0fdaec3abec2540de477671b52898e7aadfe2b3eb803fb407e28a2f79094dc33ac541518
7
- data.tar.gz: e0e72d657314cb173cb553bb6a27e0a292cca38ef3333e5cd79dda99d4455ecc319ef5f31025898e293be6ef841effb12bc383aee8b7a8cbb550829ac8f5cba1
6
+ metadata.gz: f121b02f5b6e09b8a2dea2d65583b95820b3b99e3b67664568d49d95394de753fae447c39aaf26e134eb75f21ecee9f2a07db96ca4b916d0a3fe92cd531c0b47
7
+ data.tar.gz: e8909ae9d43fc89c52135bf97b7d2667b351c954402a0fc0cad74f0b49897d215acb521a1cc6c22f308c0f0879201ed875d0bc50f4f84434288f156b8ce2068a
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'api_struct'
2
4
  require 'dry-configurable'
3
5
 
@@ -5,6 +7,7 @@ require_relative 'fatture_in_cloud_ruby/version'
5
7
  require_relative 'fatture_in_cloud_ruby/settings'
6
8
  require_relative 'fatture_in_cloud_ruby/api_struct_settings'
7
9
  require_relative 'fatture_in_cloud_ruby/clients/corrispettivi'
10
+ require_relative 'fatture_in_cloud_ruby/corrispettivi'
8
11
 
9
12
  module FattureInCloudRuby
10
13
  class Error < StandardError; end
@@ -1,40 +1,40 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module FattureInCloudRuby
2
4
  module Clients
3
5
  class Corrispettivi < ApiStruct::Client
4
6
  fatture_in_cloud :corrispettivi
5
7
 
6
- def list(year)
8
+ def list(**params)
7
9
  post(
8
10
  path: 'corrispettivi/lista',
9
11
  json: {
10
- anno: year,
11
12
  api_uid: FattureInCloudRuby::Settings.config.api_uid,
12
13
  api_key: FattureInCloudRuby::Settings.config.api_key
13
- }
14
+ }.merge(params)
14
15
  )
15
16
  end
16
17
 
17
- def retrieve(id)
18
+ def retrieve(id); end
19
+
20
+ def delete(id)
21
+ post(
22
+ path: 'corrispettivi/elimina',
23
+ json: {
24
+ api_uid: FattureInCloudRuby::Settings.config.api_uid,
25
+ api_key: FattureInCloudRuby::Settings.config.api_key
26
+ }.merge(id: id)
27
+ )
18
28
  end
19
29
 
20
- def create(tipo: 'ricevute', metodo:, importi_ivati: true, desc:, riga:)
30
+ def create(**params)
31
+ puts params.inspect
21
32
  post(
22
33
  path: 'corrispettivi/nuovo',
23
34
  json: {
24
35
  api_uid: FattureInCloudRuby::Settings.config.api_uid,
25
- api_key: FattureInCloudRuby::Settings.config.api_key,
26
- tipo: tipo,
27
- protocollo_auto: true,
28
- metodo: metodo,
29
- desc: desc,
30
- importi_ivati: importi_ivati,
31
- lista_righe: [
32
- {
33
- importo: riga[:importo],
34
- cod_iva: riga[:cod_iva]
35
- }
36
- ]
37
- }
36
+ api_key: FattureInCloudRuby::Settings.config.api_key
37
+ }.merge(params)
38
38
  )
39
39
  end
40
40
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FattureInCloudRuby
4
+ class Corrispettivi < ApiStruct::Entity
5
+ client_service FattureInCloudRuby::Clients::Corrispettivi
6
+
7
+ # client_service AuthorsClient, prefix: true, only: :index
8
+ # alias:
9
+ # client_service AuthorsClient, prefix: :prefix, except: :index
10
+
11
+ attr_entity :success, :error, :error_code,
12
+ :id, :metodo, :importi_ivati,
13
+ :desc, :riga, :protocollo_auto, :tipo, :lista_corrispettivi,
14
+ :new_id
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module FattureInCloudRuby
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fatture_in_cloud_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Vanini
@@ -116,6 +116,7 @@ files:
116
116
  - lib/fatture_in_cloud_ruby.rb
117
117
  - lib/fatture_in_cloud_ruby/api_struct_settings.rb
118
118
  - lib/fatture_in_cloud_ruby/clients/corrispettivi.rb
119
+ - lib/fatture_in_cloud_ruby/corrispettivi.rb
119
120
  - lib/fatture_in_cloud_ruby/settings.rb
120
121
  - lib/fatture_in_cloud_ruby/version.rb
121
122
  homepage: https://github.com/uidu-org/fatture-in-cloud-ruby