tochka_cyclops_api 0.2.0 → 0.4.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/README.md +67 -10
  3. data/Rakefile +0 -4
  4. data/lib/tasks/methods.rake +11 -0
  5. data/lib/tochka_cyclops_api/data_processor.rb +46 -22
  6. data/lib/tochka_cyclops_api/generators/initializer_generator.rb +5 -5
  7. data/lib/tochka_cyclops_api/generators/{model_generator.rb → models_generator.rb} +8 -9
  8. data/lib/tochka_cyclops_api/generators/templates/tochka_cyclops_request_model_template.rb +1 -1
  9. data/lib/tochka_cyclops_api/generators/templates/tochka_cyclops_responses_migration_template.rb +1 -1
  10. data/lib/tochka_cyclops_api/methods.rb +198 -5
  11. data/lib/tochka_cyclops_api/request.rb +66 -31
  12. data/lib/tochka_cyclops_api/response.rb +27 -34
  13. data/lib/tochka_cyclops_api/result.rb +33 -0
  14. data/lib/tochka_cyclops_api/schemas/requests/activate_beneficiary.rb +22 -0
  15. data/lib/tochka_cyclops_api/schemas/requests/create_beneficiary_fl.rb +56 -0
  16. data/lib/tochka_cyclops_api/schemas/requests/create_beneficiary_ip.rb +22 -10
  17. data/lib/tochka_cyclops_api/schemas/requests/create_beneficiary_ul.rb +22 -10
  18. data/lib/tochka_cyclops_api/schemas/requests/deactivate_beneficiary.rb +22 -0
  19. data/lib/tochka_cyclops_api/schemas/requests/echo.rb +2 -0
  20. data/lib/tochka_cyclops_api/schemas/requests/get_beneficiary.rb +22 -0
  21. data/lib/tochka_cyclops_api/schemas/requests/list_beneficiary.rb +44 -0
  22. data/lib/tochka_cyclops_api/schemas/requests/update_beneficiary_fl.rb +51 -0
  23. data/lib/tochka_cyclops_api/schemas/requests/update_beneficiary_ip.rb +39 -0
  24. data/lib/tochka_cyclops_api/schemas/requests/update_beneficiary_ul.rb +38 -0
  25. data/lib/tochka_cyclops_api/schemas/responses/activate_beneficiary.rb +24 -0
  26. data/lib/tochka_cyclops_api/schemas/responses/create_beneficiary_fl.rb +24 -0
  27. data/lib/tochka_cyclops_api/schemas/responses/create_beneficiary_ip.rb +10 -1
  28. data/lib/tochka_cyclops_api/schemas/responses/create_beneficiary_ul.rb +9 -9
  29. data/lib/tochka_cyclops_api/schemas/responses/deactivate_beneficiary.rb +24 -0
  30. data/lib/tochka_cyclops_api/schemas/responses/echo.rb +1 -1
  31. data/lib/tochka_cyclops_api/schemas/responses/error.rb +5 -2
  32. data/lib/tochka_cyclops_api/schemas/responses/get_beneficiary.rb +48 -0
  33. data/lib/tochka_cyclops_api/schemas/responses/list_beneficiary.rb +38 -0
  34. data/lib/tochka_cyclops_api/schemas/responses/update_beneficiary_fl.rb +20 -0
  35. data/lib/tochka_cyclops_api/schemas/responses/update_beneficiary_ip.rb +20 -0
  36. data/lib/tochka_cyclops_api/schemas/responses/update_beneficiary_ul.rb +24 -0
  37. data/lib/tochka_cyclops_api/schemas/results/local_error.rb +0 -0
  38. data/lib/tochka_cyclops_api/test.rb +0 -0
  39. data/lib/tochka_cyclops_api/version.rb +1 -1
  40. data/lib/tochka_cyclops_api.rb +8 -2
  41. metadata +23 -17
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'dry-struct'
4
+
5
+ module Types
6
+ include Dry.Types()
7
+ end
8
+
9
+ module TochkaCyclopsApi
10
+ module Schemas
11
+ module Responses
12
+ # Response schema for get_beneficiary request
13
+ class ListBeneficicary < Dry::Struct
14
+ class LastContractOffer < Dry::Struct
15
+ attribute :id, ::Types::String
16
+ attribute :type, ::Types::String
17
+ attribute :success_added, ::Types::Bool
18
+ attribute :success_added_desc, ::Types::String
19
+ end
20
+
21
+ class NominalAccount < Dry::Struct
22
+ attribute :bic, ::Types::String
23
+ attribute :code, ::Types::String
24
+ end
25
+
26
+ class BeneficiaryData < Dry::Struct
27
+ attribute :name, ::Types::String
28
+ end
29
+
30
+ class Beneficiary < Dry::Struct
31
+ attribute :inn, Types::String
32
+ attribute :id, Types::String
33
+ attribute :is_active, Types::Bool
34
+ attribute :legal_type, Types::String
35
+ attribute :ogrn, Types::String
36
+ attribute :beneficiary_data, BeneficiaryData
37
+ end
38
+
39
+ attribute :beneficiary, Beneficiary
40
+ attribute :nominal_account, NominalAccount
41
+ attribute :last_contract_offer, LastContractOffer
42
+ attribute :permission, Types::Bool
43
+ attribute :permission_description, Types::String
44
+ attribute :meta, Meta
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'dry-struct'
4
+
5
+ module Types
6
+ include Dry.Types()
7
+ end
8
+
9
+ module TochkaCyclopsApi
10
+ module Schemas
11
+ module Responses
12
+ # Response schema for list_beneficiary request
13
+ class ListBeneficicary < Dry::Struct
14
+ class Beneficiary < Dry::Struct
15
+ attribute :inn, Types::String
16
+ attribute :id, Types::String
17
+ attribute :is_active, Types::Bool
18
+ attribute :legal_type, Types::String
19
+ attribute :nominal_account_code, Types::String
20
+ attribute :nominal_account_bic, Types::String
21
+ end
22
+
23
+ class Page < Dry::Struct
24
+ attribute :current_page, Types::Integer
25
+ attribute :per_page, Types::Integer
26
+ end
27
+
28
+ class Meta < Dry::Struct
29
+ attribute :total, Types::Integer
30
+ attribute :page, Page
31
+ end
32
+
33
+ attribute :beneficiaries, Types::Array.of(Beneficiary)
34
+ attribute :meta, Meta
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'dry-validation'
4
+
5
+ module TochkaCyclopsApi
6
+ module Schemas
7
+ module Responses
8
+ # Response schema for update_beneficiary_fl request
9
+ class UpdateBeneficiaryFl < Dry::Struct
10
+ # Schema for beneficiary field of main response
11
+ class BeneficiaryData < Dry::Struct
12
+ attribute :inn, Types::Strict::String
13
+ attribute :id, Types::Strict::String
14
+ end
15
+
16
+ attribute :beneficiary, BeneficiaryData
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'dry-validation'
4
+
5
+ module TochkaCyclopsApi
6
+ module Schemas
7
+ module Responses
8
+ # Response schema for update_beneficiary_ip request
9
+ class UpdateBeneficiaryIp < Dry::Struct
10
+ # Schema for beneficiary field of main response
11
+ class BeneficiaryData < Dry::Struct
12
+ attribute :inn, Types::Strict::String
13
+ attribute :id, Types::Strict::String
14
+ end
15
+
16
+ attribute :beneficiary, BeneficiaryData
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'dry-struct'
4
+
5
+ module Types
6
+ include Dry.Types()
7
+ end
8
+
9
+ module TochkaCyclopsApi
10
+ module Schemas
11
+ module Responses
12
+ # Response schema for update_beneficiary_ul request
13
+ class UpdateBeneficiaryUl < Dry::Struct
14
+ # Schema for beneficiary field of main response
15
+ class BeneficiaryData < Dry::Struct
16
+ attribute :inn, Types::Strict::String
17
+ attribute :id, Types::Strict::String
18
+ end
19
+
20
+ attribute :beneficiary, BeneficiaryData
21
+ end
22
+ end
23
+ end
24
+ end
File without changes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TochkaCyclopsApi
4
- VERSION = '0.2.0'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -2,10 +2,14 @@
2
2
  require 'dry-types'
3
3
  require 'dry-validation'
4
4
 
5
+ require_relative 'tochka_cyclops_api/generators/models_generator'
6
+ require_relative 'tochka_cyclops_api/generators/initializer_generator'
7
+
5
8
  require_relative 'tochka_cyclops_api/data_processor'
6
9
  require_relative 'tochka_cyclops_api/configuration'
7
10
  require_relative 'tochka_cyclops_api/version'
8
11
  require_relative 'tochka_cyclops_api/methods'
12
+ require_relative 'tochka_cyclops_api/test'
9
13
 
10
14
  # Core module of this gem
11
15
  module TochkaCyclopsApi
@@ -16,8 +20,6 @@ module TochkaCyclopsApi
16
20
  end
17
21
 
18
22
  class << self
19
- include DataProcessor
20
-
21
23
  def configuration
22
24
  @configuration ||= Configuration.new
23
25
  end
@@ -25,5 +27,9 @@ module TochkaCyclopsApi
25
27
  def configure
26
28
  yield(configuration)
27
29
  end
30
+
31
+ def send_request(method: ,data: , layer: )
32
+ DataProcessor.send_request(method: ,data: , layer: )
33
+ end
28
34
  end
29
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tochka_cyclops_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - andrewgavrick
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-29 00:00:00.000000000 Z
11
+ date: 2024-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-validation
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.6'
41
- - !ruby/object:Gem::Dependency
42
- name: activesupport
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '='
46
- - !ruby/object:Gem::Version
47
- version: 7.2.1.1
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '='
53
- - !ruby/object:Gem::Version
54
- version: 7.2.1.1
55
41
  description: em for working with the api of the bank Point
56
42
  email:
57
43
  - andrewgavrick@yandex.ru
@@ -62,11 +48,12 @@ files:
62
48
  - CHANGELOG.md
63
49
  - README.md
64
50
  - Rakefile
51
+ - lib/tasks/methods.rake
65
52
  - lib/tochka_cyclops_api.rb
66
53
  - lib/tochka_cyclops_api/configuration.rb
67
54
  - lib/tochka_cyclops_api/data_processor.rb
68
55
  - lib/tochka_cyclops_api/generators/initializer_generator.rb
69
- - lib/tochka_cyclops_api/generators/model_generator.rb
56
+ - lib/tochka_cyclops_api/generators/models_generator.rb
70
57
  - lib/tochka_cyclops_api/generators/templates/tochka_cyclops_error_model_template.rb
71
58
  - lib/tochka_cyclops_api/generators/templates/tochka_cyclops_errors_migration_template.rb
72
59
  - lib/tochka_cyclops_api/generators/templates/tochka_cyclops_request_model_template.rb
@@ -76,13 +63,32 @@ files:
76
63
  - lib/tochka_cyclops_api/methods.rb
77
64
  - lib/tochka_cyclops_api/request.rb
78
65
  - lib/tochka_cyclops_api/response.rb
66
+ - lib/tochka_cyclops_api/result.rb
67
+ - lib/tochka_cyclops_api/schemas/requests/activate_beneficiary.rb
68
+ - lib/tochka_cyclops_api/schemas/requests/create_beneficiary_fl.rb
79
69
  - lib/tochka_cyclops_api/schemas/requests/create_beneficiary_ip.rb
80
70
  - lib/tochka_cyclops_api/schemas/requests/create_beneficiary_ul.rb
71
+ - lib/tochka_cyclops_api/schemas/requests/deactivate_beneficiary.rb
81
72
  - lib/tochka_cyclops_api/schemas/requests/echo.rb
73
+ - lib/tochka_cyclops_api/schemas/requests/get_beneficiary.rb
74
+ - lib/tochka_cyclops_api/schemas/requests/list_beneficiary.rb
75
+ - lib/tochka_cyclops_api/schemas/requests/update_beneficiary_fl.rb
76
+ - lib/tochka_cyclops_api/schemas/requests/update_beneficiary_ip.rb
77
+ - lib/tochka_cyclops_api/schemas/requests/update_beneficiary_ul.rb
78
+ - lib/tochka_cyclops_api/schemas/responses/activate_beneficiary.rb
79
+ - lib/tochka_cyclops_api/schemas/responses/create_beneficiary_fl.rb
82
80
  - lib/tochka_cyclops_api/schemas/responses/create_beneficiary_ip.rb
83
81
  - lib/tochka_cyclops_api/schemas/responses/create_beneficiary_ul.rb
82
+ - lib/tochka_cyclops_api/schemas/responses/deactivate_beneficiary.rb
84
83
  - lib/tochka_cyclops_api/schemas/responses/echo.rb
85
84
  - lib/tochka_cyclops_api/schemas/responses/error.rb
85
+ - lib/tochka_cyclops_api/schemas/responses/get_beneficiary.rb
86
+ - lib/tochka_cyclops_api/schemas/responses/list_beneficiary.rb
87
+ - lib/tochka_cyclops_api/schemas/responses/update_beneficiary_fl.rb
88
+ - lib/tochka_cyclops_api/schemas/responses/update_beneficiary_ip.rb
89
+ - lib/tochka_cyclops_api/schemas/responses/update_beneficiary_ul.rb
90
+ - lib/tochka_cyclops_api/schemas/results/local_error.rb
91
+ - lib/tochka_cyclops_api/test.rb
86
92
  - lib/tochka_cyclops_api/version.rb
87
93
  - sig/tochka_cyclops_api.rbs
88
94
  homepage: https://gitlab.com/andrewgavrick/tochka_api