creditario-client 0.0.6.alpha → 0.0.7.alpha

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: 54a4334502f35b6d2befa8cf6ce2ba4cd0440c2b008f1080df753742a1c3b2ea
4
- data.tar.gz: '0608409622203f0cfb3a29a9af6e73a9dee3dfb62f3ee25938a52a9ab23cdcef'
3
+ metadata.gz: 217be7d392fba8ad1ebe71041c71bd828e0756905a3d2acd01ac9fabdd0a67e0
4
+ data.tar.gz: 024f36b22af15a41780602d9984b422a9ac863f5e0c97d9e47361b207819048b
5
5
  SHA512:
6
- metadata.gz: 54d5728536d0e2de222077f7978ebb720c1d35f9443318eb9b5722156be4cdb87cc8925d647812ec09c69b21cddddd292d988d47cd553ffd31556ad383555379
7
- data.tar.gz: 0f479a8dbf1fff59a814f8a8ec84cf8d6c38d61312164a7b6d2143e8c4642a1a78f647c5d4a1cc94beb1ec91f0afe1e1489e1de8dee4f7e6f120e664ac27ab9e
6
+ metadata.gz: 9381ab32b370ce549642676fb8d2bb53d257543b735109d1ed2f40e1fe83e6379c871af787e3dbdd2cf92c0a3ce6e668b1fd3d3bcc982f4268b58bf6e8595266
7
+ data.tar.gz: 432e445cdf43cad23a4bc8d08207fa89d62f6d50698d451825be55e2189eb255cbfc3a72d6ea41cbd10e6da33f4c7b6c01ea541336ea8f00ebaf202d3e154a3d
@@ -0,0 +1,6 @@
1
+ Version 0.0.7.alpha
2
+
3
+ Release notes:
4
+
5
+ - New repository "ConvertApplicationToCredits" for create applications to credits from API of creditar.io
6
+ - Updating documentation removing description for resources that it hasn't makes sense
@@ -77,6 +77,7 @@ module Creditario # :nodoc:
77
77
 
78
78
  request["User-Agent"] = "creditario-client gem v#{Creditario::Client::VERSION}"
79
79
  request["Accept"] = "application/vnd.creditar.v#{Creditario::Client.api_version}+json"
80
+ request["Content-Type"] = "application/json"
80
81
 
81
82
  request
82
83
  end
@@ -48,6 +48,7 @@ require "creditario/repositories/credits"
48
48
  require "creditario/repositories/payments"
49
49
  require "creditario/repositories/movements"
50
50
  require "creditario/repositories/qualify_score_flows"
51
+ require "creditario/repositories/convert_application_to_credits"
51
52
 
52
53
  module Creditario # :nodoc:
53
54
  ###
@@ -210,6 +211,14 @@ module Creditario # :nodoc:
210
211
  def qualify_score_flows
211
212
  Creditario::QualifyScoreFlows
212
213
  end
214
+
215
+ ###
216
+ # Método de acceso al repositorio de Convertir una Solicitud en Crédito
217
+ #
218
+ # Para más información, puede consultar la documentación de Creditario::ConvertApplicationToCredits
219
+ def convert_application_to_credits
220
+ Creditario::ConvertApplicationToCredits
221
+ end
213
222
  end
214
223
  end
215
224
  end
@@ -4,6 +4,6 @@ module Creditario
4
4
  module Client
5
5
  ###
6
6
  # Versión actual de la gema *creditario-client*
7
- VERSION = "0.0.6.alpha"
7
+ VERSION = "0.0.7.alpha"
8
8
  end
9
9
  end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Creditario # :nodoc:
4
+ ###
5
+ # == Creditario::ConvertApplicationToCredits
6
+ #
7
+ # Repositorio para Convertir Solicitud a Crédito, permite convertir una Solicitud a Crédito.
8
+ #
9
+ # - Crea para Convertir una Solicitud a Crédito:
10
+ #
11
+ # Creditario::ConvertApplicationToCredits.create(credit_application_id: "2e9d05b8-2180-4779-bab6-bdfd41d1569f", accepted_at: "2020-05-01", first_payment_date: "2020-05-02", closing_date_at: "2020-05-04", payment_days: 20)
12
+ # => Creditario::Credit
13
+ #
14
+ module ConvertApplicationToCredits
15
+ extend Creditario::API::Create
16
+
17
+ ###
18
+ # Path de la API donde se ejecutan las peticiones para Convertir Solicitud a Crédito.
19
+ def self.resource_path
20
+ "/convert_application_to_credits"
21
+ end
22
+
23
+ ###
24
+ # Clase a utilizar para transformar las respuestas de la API
25
+ def self.resource_class
26
+ Creditario::Credit
27
+ end
28
+ end
29
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Creditario # :nodoc:
4
4
  ###
5
- # == Creditario::QualifyScoreFlow
5
+ # == Creditario::QualifyScoreFlows
6
6
  #
7
7
  # Repositorio de Calificaciones de flujos de calificación, permite obtener una Calificación de un flujo de calificación
8
8
  # en base a una Solicitud de creditar.io:
@@ -1,21 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditario # :nodoc:
4
- ###
5
- # == Creditario::Application
6
- #
7
- # Representa una Aplicación de Credito del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => credit_application = Creditario::Application.new({"id": "636264b1-77a2-45ef-b643-e44cfbc84d40", "application_number": "UENDSND-1", "flow": "inicio"})
12
- # => credit_application.id
13
- # => "636264b1-77a2-45ef-b643-e44cfbc84d40"
14
- # => credit_application.flow = "referencias"
15
- # => "referencias"
16
- # => credit_application[:application_number]
17
- # => "UENDSND-1"
18
- class Application
4
+ class Application # :nodoc:
19
5
  include Resource
20
6
 
21
7
  has_one :product, class: Creditario::Product
@@ -1,19 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditario # :nodoc
4
- ###
5
- # == Creditario::Attachment
6
- #
7
- # Representa un Archivo del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => attachment = Creditario::Attachment.new({"id": "aabfd43d-6f63-44dd-b7d9-9352a101d11e", "attachment_type": "INE", "url": "http://creditar.io/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBGUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--4f40e5eabc39d2215d0ce08a1ad735df3bcf74b4/image.jpg"})
12
- # => attachment.id
13
- # => "aabfd43d-6f63-44dd-b7d9-9352a101d11e"
14
- # => attachment[:url]
15
- # => "http://creditario.io/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBGUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--4f40e5eabc39d2215d0ce08a1ad735df3bcf74b4/image.jpg"
16
- class Attachment
4
+ class Attachment # :nodoc:
17
5
  include Resource
18
6
  end
19
7
  end
@@ -1,35 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditario # :nodoc:
4
- ###
5
- # == Creditario::Catalog
6
- #
7
- # Representa un Catálogo del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => catalog = Creditario::Catalog.new({resource: "customer", field: "source"})
12
- # => catalog.resource
13
- # => "customer"
14
- # => catalog[:field]
15
- # => "source"
16
- class Catalog
4
+ class Catalog # :nodoc:
17
5
  include Resource
18
6
  end
19
7
 
20
- ###
21
- # == Creditario::CatalogValue
22
- #
23
- # Representa un Valor de Catálogo del sistema creditar.io
24
- #
25
- # === Ejemplo
26
- #
27
- # => catalog = Creditario::CatalogValue.new({name: "Revista", value: "revista"})
28
- # => catalog.name
29
- # => "Revista"
30
- # => catalog[:value]
31
- # => "revista"
32
- class CatalogValue
8
+ class CatalogValue # :nodoc:
33
9
  include Resource
34
10
  end
35
11
  end
@@ -1,21 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditario # :nodoc:
4
- ###
5
- # == Creditario::Contract
6
- #
7
- # Representa un Contrato del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => contract = Creditario::Contract.new({"id": "c005b7f7-a44a-4ec0-bf7f-73d15d806fd9", body: "Contrato del Crédito..."})
12
- # => contract.id
13
- # => "c005b7f7-a44a-4ec0-bf7f-73d15d806fd9"
14
- # => contract.body
15
- # => "Contrato del Crédito..."
16
- # => contract[:body]
17
- # => "Contrato del Crédito..."
18
- class Contract
4
+ class Contract # :nodoc:
19
5
  include Resource
20
6
  end
21
7
  end
@@ -1,19 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditario # :nodoc:
4
- ###
5
- # == Creditario::Credit
6
- #
7
- # Representa un Crédito del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => credit = Creditario::Credit.new({"id": "636264b1-dc0d-453e-8804-4ac451e1dbd5", "credit_application_id": "636264b1-77a2-45ef-b643-e44cfbc84d40", "customer_id": "6313ac69-dc0d-45a8-8804-4ac451e1db5c", "contract_id": "0b19e3b6-9fae-40e1-a7c2-f2db1cae8a5a", "installment_plan": [] })
12
- # => credit.id
13
- # => "636264b1-dc0d-453e-8804-4ac451e1dbd5"
14
- # => credit[:customer_id]
15
- # => "6313ac69-dc0d-45a8-8804-4ac451e1db5c"
16
- class Credit
4
+ class Credit # :nodoc:
17
5
  include Resource
18
6
  end
19
7
  end
@@ -1,19 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditario # :nodoc:
4
- ###
5
- # == Creditario::CreditEstimate
6
- #
7
- # Representa una Estimación de Crédito del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => credit_estimate = Creditario::CreditEstimate.new({ "total_interest_amount_cents": 100000, "total_credit_amount_cents": 1100000 })
12
- # => credit_estimate.total_interest_amount_cents
13
- # => 100000
14
- # => credit_estimate[:total_credit_amount_cents]
15
- # => 1100000
16
- class CreditEstimate
4
+ class CreditEstimate # :nodoc:
17
5
  include Resource
18
6
  end
19
7
  end
@@ -1,23 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditario # :nodoc:
4
- ###
5
- # == Creditario::Customer
6
- #
7
- # Representa un Cliente del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => customer = Creditario::Customer.new({first_name: "Juan", last_name: "Carlos", credit_applications: [{"id": "636264b1-77a2-45ef-b643-e44cfbc84d40"}]})
12
- # => customer.first_name
13
- # => "Juan"
14
- # => customer.first_name = "Pepé"
15
- # => "Pepé"
16
- # => customer[:first_name]
17
- # => "Pepé"
18
- # => customer[:first_name] = "Juan"
19
- # => "Juan"
20
- class Customer
4
+ class Customer # :nodoc:
21
5
  include Resource
22
6
 
23
7
  has_many :credit_applications, class: Creditario::Application
@@ -1,19 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Creditario
4
- ###
5
- # == Creditario::Expense
6
- #
7
- # Representa un Egreso del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => expense = Creditario::Expense.new({"id": "aff581fc-ba6e-49f2-9be7-73ef20043d1c", "classification": "Renta", "amount_cents": 30000})
12
- # => expense.id
13
- # => aff581fc-ba6e-49f2-9be7-73ef20043d1c
14
- # => expense[:amount_cents]
15
- # => 30000
16
- class Expense
3
+ module Creditario # :nodoc:
4
+ class Expense # :nodoc:
17
5
  include Resource
18
6
  end
19
7
  end
@@ -1,19 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditario # :nodoc:
4
- ###
5
- # == Creditario::Income
6
- #
7
- # Representa un Ingreso del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => income = Creditario::Income.new({"id": "2ff8779b-ba6e-49f2-9be7-73ef20043d1c", "classification": "Trabajo", "amount_cents": 500000})
12
- # => income.id
13
- # => 2ff8779b-ba6e-49f2-9be7-73ef20043d1c
14
- # => income[:amount_cents]
15
- # => 500000
16
- class Income
4
+ class Income # :nodoc:
17
5
  include Resource
18
6
  end
19
7
  end
@@ -1,29 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditario # :nodoc:
4
- ###
5
- # == Creditario::Movement
6
- #
7
- # Representa un Movimiento del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => movement = Creditario::Movement.new({"id": "5c9d3d7b-3f64-4a6e-82e2-18acc95870c9","reference": "Compra a comercio","amount_cents": 100000,"credit_id": "97a03292-c521-4495-813d-173d7f371c62","movement_type": "cargo","interest": false,"folio_number": "DWJDHQY"})
12
- # => movement.id
13
- # => "5c9d3d7b-3f64-4a6e-82e2-18acc95870c9"
14
- # => movement.reference
15
- # => "Compra a comercio"
16
- # => movement.amount_cents
17
- # => 100000
18
- # => movement.credit_id
19
- # => "97a03292-c521-4495-813d-173d7f371c62"
20
- # => movement.movement_type
21
- # => "cargo"
22
- # => movement.interest
23
- # => false
24
- # => movement.folio_number
25
- # => "DWJDHQY"
26
- class Movement
4
+ class Movement # :nodoc:
27
5
  include Resource
28
6
  end
29
7
  end
@@ -1,21 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditario # :nodoc:
4
- ###
5
- # == Creditario::Payment
6
- #
7
- # Representa un Pago del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => payment = Creditario::Payment.new({"id": "6313ac69-dc0d-45a8-8804-4ac451e1db5c", "payment_type": "annuity", "amount_cents": 100000})
12
- # => payment.id
13
- # => "6313ac69-dc0d-45a8-8804-4ac451e1db5c"
14
- # => payment.payment_type = "annuity"
15
- # => "annuity"
16
- # => payment[:amount_cents]
17
- # => 100000
18
- class Payment
4
+ class Payment # :nodoc:
19
5
  include Resource
20
6
  end
21
7
  end
@@ -1,21 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditario # :nodoc:
4
- ###
5
- # == Creditario::Product
6
- #
7
- # Representa un Producto del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => product = Creditario::Product.new({"id": "6313ac69-dc0d-45a8-8804-4ac451e1db5c", "short_name": "un-pago", "name": "Crédito a un sólo pago"})
12
- # => product.id
13
- # => "6313ac69-dc0d-45a8-8804-4ac451e1db5c"
14
- # => product.short_name = "dos-pagos"
15
- # => "dos-pagos"
16
- # => product[:name]
17
- # => "Crédito a un sólo pago"
18
- class Product
4
+ class Product # :nodoc:
19
5
  include Resource
20
6
  end
21
7
  end
@@ -1,21 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creditario # :nodoc:
4
- ###
5
- # == Creditario::QualifyScoreFlow
6
- #
7
- # Representa una Calificación del flujo de calificación del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => score_flow_calification = Creditario::QualifyScoreFlow.new({"value": "100", "passed": "true", "notes": "Resultado sastifactorio"})
12
- # => score_flow_calification.value
13
- # => 100
14
- # => score_flow_calification.passed
15
- # => true
16
- # => score_flow_calification.notes
17
- # => "Resultado satisfactorio"
18
- class QualifyScoreFlow
4
+ class QualifyScoreFlow # :nodoc:
19
5
  include Resource
20
6
  end
21
7
  end
@@ -1,19 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Creditario
4
- ###
5
- # == Creditario::Reference
6
- #
7
- # Representa una Referencia del sistema creditar.io
8
- #
9
- # === Ejemplo
10
- #
11
- # => reference = Creditario::Reference.new({"id": "1b38ab7d-4c3e-4f39-99e8-57b099c86d45", "classification": "Familiar", "name": "Diane Nguyen", "phone": "3123100045"})
12
- # => reference.id
13
- # => 1b38ab7d-4c3e-4f39-99e8-57b099c86d45
14
- # => reference[:phone]
15
- # => 312100045
16
- class Reference
3
+ module Creditario # :nodoc:
4
+ class Reference # :nodoc:
17
5
  include Resource
18
6
  end
19
7
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class FixtureAPIResponse # :nodoc:
4
- attr_reader :method, :port, :path, :params, :api_token, :name
4
+ attr_reader :method, :port, :path, :params, :api_token, :name, :api_version
5
5
 
6
6
  REQUESTS = %w(get post patch delete multipart)
7
7
 
8
8
  def initialize
9
- @method, @port, @path, @params, @api_token, @name = ""
9
+ @method, @port, @path, @params, @api_token, @name, @api_version = ""
10
10
  build_request_and_save_fixture
11
11
  end
12
12
 
@@ -16,6 +16,7 @@ class FixtureAPIResponse # :nodoc:
16
16
  path_gets
17
17
  params_gets
18
18
  api_token_gets
19
+ api_version_gets
19
20
  name_gets
20
21
  execute_request
21
22
  end
@@ -69,6 +70,11 @@ class FixtureAPIResponse # :nodoc:
69
70
  @name = STDIN.gets.chomp
70
71
  end
71
72
 
73
+ def api_version_gets
74
+ puts "Qué versión desea especificar?"
75
+ @api_version = STDIN.gets.chomp
76
+ end
77
+
72
78
  def request_url
73
79
  "'localhost:#{port}#{path}'"
74
80
  end
@@ -76,7 +82,7 @@ class FixtureAPIResponse # :nodoc:
76
82
  def headers
77
83
  "-H 'Content-Type: application/json' " \
78
84
  "#{header_api_token}" \
79
- "-H 'Accept: application/vnd.creditar.v1+json'"
85
+ "-H 'Accept: application/vnd.creditar.#{api_version}+json'"
80
86
  end
81
87
 
82
88
  def header_api_token
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: creditario-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6.alpha
4
+ version: 0.0.7.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - michelada.io
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-12 00:00:00.000000000 Z
11
+ date: 2020-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -134,6 +134,7 @@ files:
134
134
  - ".gitlab-ci.yml"
135
135
  - ".rubocop.yml"
136
136
  - ".travis.yml"
137
+ - CHANGELOG
137
138
  - CODE_OF_CONDUCT.md
138
139
  - Dockerfile
139
140
  - Gemfile
@@ -158,6 +159,7 @@ files:
158
159
  - lib/creditario/repositories/attachments.rb
159
160
  - lib/creditario/repositories/catalogs.rb
160
161
  - lib/creditario/repositories/contracts.rb
162
+ - lib/creditario/repositories/convert_application_to_credits.rb
161
163
  - lib/creditario/repositories/credit_estimates.rb
162
164
  - lib/creditario/repositories/credits.rb
163
165
  - lib/creditario/repositories/customers.rb