checkbiz 1.0.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 (93) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +154 -0
  3. data/checkbiz.gemspec +32 -0
  4. data/lib/checkbiz/resource.rb +23 -0
  5. data/lib/checkbiz/resources/address_information.rb +17 -0
  6. data/lib/checkbiz/resources/bolagsverket.rb +17 -0
  7. data/lib/checkbiz/resources/company_annual_report.rb +13 -0
  8. data/lib/checkbiz/resources/company_annual_reports.rb +13 -0
  9. data/lib/checkbiz/resources/company_articles_of_association.rb +13 -0
  10. data/lib/checkbiz/resources/company_autocomplete.rb +13 -0
  11. data/lib/checkbiz/resources/company_beneficial_owner.rb +15 -0
  12. data/lib/checkbiz/resources/company_certificates_of_registration.rb +13 -0
  13. data/lib/checkbiz/resources/company_credit_template.rb +23 -0
  14. data/lib/checkbiz/resources/company_event.rb +29 -0
  15. data/lib/checkbiz/resources/company_information.rb +41 -0
  16. data/lib/checkbiz/resources/company_information_list.rb +14 -0
  17. data/lib/checkbiz/resources/company_search.rb +13 -0
  18. data/lib/checkbiz/resources/company_search_advanced.rb +13 -0
  19. data/lib/checkbiz/resources/company_worksite.rb +13 -0
  20. data/lib/checkbiz/resources/custom_list.rb +31 -0
  21. data/lib/checkbiz/resources/data_factory_person_search.rb +14 -0
  22. data/lib/checkbiz/resources/extended_search_no.rb +14 -0
  23. data/lib/checkbiz/resources/geomatics.rb +13 -0
  24. data/lib/checkbiz/resources/heartbeat.rb +9 -0
  25. data/lib/checkbiz/resources/lookup_company_no.rb +14 -0
  26. data/lib/checkbiz/resources/lookup_id_no.rb +14 -0
  27. data/lib/checkbiz/resources/lookup_phone_no.rb +14 -0
  28. data/lib/checkbiz/resources/nix.rb +11 -0
  29. data/lib/checkbiz/resources/package_calls.rb +13 -0
  30. data/lib/checkbiz/resources/package_information.rb +13 -0
  31. data/lib/checkbiz/resources/person_beneficial_owner.rb +24 -0
  32. data/lib/checkbiz/resources/person_credit_template.rb +23 -0
  33. data/lib/checkbiz/resources/person_event.rb +18 -0
  34. data/lib/checkbiz/resources/person_information.rb +47 -0
  35. data/lib/checkbiz/resources/person_information_list.rb +14 -0
  36. data/lib/checkbiz/resources/person_search.rb +15 -0
  37. data/lib/checkbiz/resources/person_search_advanced.rb +15 -0
  38. data/lib/checkbiz/resources/person_verify.rb +15 -0
  39. data/lib/checkbiz/resources/pts_info.rb +13 -0
  40. data/lib/checkbiz/resources/safenode_company_credit_report.rb +14 -0
  41. data/lib/checkbiz/resources/safenode_company_remark_control.rb +14 -0
  42. data/lib/checkbiz/resources/safenode_person_credit_report.rb +14 -0
  43. data/lib/checkbiz/resources/safenode_person_remark_control.rb +14 -0
  44. data/lib/checkbiz/resources/search_no.rb +14 -0
  45. data/lib/checkbiz/resources/signatory.rb +15 -0
  46. data/lib/checkbiz/resources/spar.rb +13 -0
  47. data/lib/checkbiz/resources/statistics.rb +14 -0
  48. data/lib/checkbiz/resources/subscriber.rb +17 -0
  49. data/lib/checkbiz/resources/subscriber_list.rb +16 -0
  50. data/lib/checkbiz/resources/url.rb +16 -0
  51. data/lib/checkbiz/resources/url_search.rb +16 -0
  52. data/lib/checkbiz/types/address_information.rb +136 -0
  53. data/lib/checkbiz/types/bolagsverket.rb +1012 -0
  54. data/lib/checkbiz/types/common.rb +503 -0
  55. data/lib/checkbiz/types/company_advanced_search.rb +38 -0
  56. data/lib/checkbiz/types/company_annual_reports.rb +17 -0
  57. data/lib/checkbiz/types/company_autocomplete.rb +25 -0
  58. data/lib/checkbiz/types/company_credit_template.rb +54 -0
  59. data/lib/checkbiz/types/company_event.rb +37 -0
  60. data/lib/checkbiz/types/company_information.rb +460 -0
  61. data/lib/checkbiz/types/company_information_list.rb +15 -0
  62. data/lib/checkbiz/types/company_search.rb +38 -0
  63. data/lib/checkbiz/types/company_worksite.rb +18 -0
  64. data/lib/checkbiz/types/custom_list_add.rb +16 -0
  65. data/lib/checkbiz/types/custom_list_get.rb +17 -0
  66. data/lib/checkbiz/types/data_factory_person_search.rb +117 -0
  67. data/lib/checkbiz/types/geomatic.rb +140 -0
  68. data/lib/checkbiz/types/lookup_company_no.rb +57 -0
  69. data/lib/checkbiz/types/lookup_id_no.rb +22 -0
  70. data/lib/checkbiz/types/lookup_phone_no.rb +29 -0
  71. data/lib/checkbiz/types/package_calls.rb +27 -0
  72. data/lib/checkbiz/types/package_information.rb +23 -0
  73. data/lib/checkbiz/types/person_advanced_search.rb +117 -0
  74. data/lib/checkbiz/types/person_credit_template.rb +61 -0
  75. data/lib/checkbiz/types/person_event.rb +33 -0
  76. data/lib/checkbiz/types/person_information.rb +598 -0
  77. data/lib/checkbiz/types/person_information_list.rb +19 -0
  78. data/lib/checkbiz/types/person_search.rb +88 -0
  79. data/lib/checkbiz/types/person_verify.rb +61 -0
  80. data/lib/checkbiz/types/pts.rb +15 -0
  81. data/lib/checkbiz/types/safenode_company_credit_report.rb +50 -0
  82. data/lib/checkbiz/types/safenode_company_remark_control.rb +29 -0
  83. data/lib/checkbiz/types/safenode_person_credit_report.rb +49 -0
  84. data/lib/checkbiz/types/safenode_person_remark_control.rb +28 -0
  85. data/lib/checkbiz/types/signatory.rb +40 -0
  86. data/lib/checkbiz/types/spar.rb +107 -0
  87. data/lib/checkbiz/types/statistics.rb +33 -0
  88. data/lib/checkbiz/types/subscriber.rb +68 -0
  89. data/lib/checkbiz/types/subscriber_list.rb +49 -0
  90. data/lib/checkbiz/types/subscriber_nix.rb +16 -0
  91. data/lib/checkbiz/version.rb +5 -0
  92. data/lib/checkbiz.rb +26 -0
  93. metadata +233 -0
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class PersonPositionBlock < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :latitude, Types::String.optional
12
+ attribute? :longitude, Types::String.optional
13
+ end
14
+
15
+ class PersonSearchBasicBlockRecord < Dry::Struct
16
+ transform_keys { |key| CAMEL.parse(key) }
17
+
18
+ attribute? :first_name, Types::String.optional
19
+ attribute? :given_name, Types::String.optional
20
+ attribute? :last_name, Types::String.optional
21
+ attribute? :street, Types::String.optional
22
+ attribute? :zip_code, Types::String.optional
23
+ attribute? :city, Types::String.optional
24
+ attribute? :municipality, Types::String.optional
25
+ attribute? :age, Types::Integer.optional
26
+ attribute? :phone_numbers, Types::Array.of(Types::String).optional
27
+ attribute? :position, PersonPositionBlock.optional
28
+ end
29
+
30
+ class PersonSearchExtendedBlockRecord < Dry::Struct
31
+ transform_keys { |key| CAMEL.parse(key) }
32
+
33
+ attribute? :ssn, Types::String.optional
34
+ attribute? :first_name, Types::String.optional
35
+ attribute? :given_name, Types::String.optional
36
+ attribute? :last_name, Types::String.optional
37
+ attribute? :street, Types::String.optional
38
+ attribute? :zip_code, Types::String.optional
39
+ attribute? :city, Types::String.optional
40
+ attribute? :municipality, Types::String.optional
41
+ attribute? :age, Types::Integer.optional
42
+ attribute? :phone_numbers, Types::Array.of(Types::String).optional
43
+ attribute? :position, PersonPositionBlock.optional
44
+ end
45
+
46
+ class PersonSearchIdBlockRecord < Dry::Struct
47
+ transform_keys { |key| CAMEL.parse(key) }
48
+
49
+ attribute? :idnummer, Types::String.optional
50
+ attribute? :id_nr, Types::String.optional
51
+ attribute? :first_name, Types::String.optional
52
+ attribute? :given_name, Types::String.optional
53
+ attribute? :last_name, Types::String.optional
54
+ attribute? :street, Types::String.optional
55
+ attribute? :zip_code, Types::String.optional
56
+ attribute? :city, Types::String.optional
57
+ attribute? :municipality, Types::String.optional
58
+ attribute? :age, Types::Integer.optional
59
+ attribute? :phone_numbers, Types::Array.of(Types::String).optional
60
+ attribute? :position, PersonPositionBlock.optional
61
+ end
62
+
63
+ class PersonSearchBasicBlock < Dry::Struct
64
+ transform_keys { |key| CAMEL.parse(key) }
65
+
66
+ attribute? :records_returned, Types::Integer.optional
67
+ attribute? :total_records_found, Types::Integer.optional
68
+ attribute? :records, Types::Array.of(PersonSearchBasicBlockRecord).optional
69
+ end
70
+
71
+ class PersonSearchExtendedBlock < Dry::Struct
72
+ transform_keys { |key| CAMEL.parse(key) }
73
+
74
+ attribute? :records_returned, Types::Integer.optional
75
+ attribute? :total_records_found, Types::Integer.optional
76
+ attribute? :records, Types::Array.of(PersonSearchExtendedBlockRecord).optional
77
+ end
78
+
79
+ class PersonSearchIdBlock < Dry::Struct
80
+ transform_keys { |key| CAMEL.parse(key) }
81
+
82
+ attribute? :records_returned, Types::Integer.optional
83
+ attribute? :total_records_found, Types::Integer.optional
84
+ attribute? :records, Types::Array.of(PersonSearchIdBlockRecord).optional
85
+ end
86
+
87
+ end
88
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class PersonVerifyBasicBlock < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :first_name, Types::String.optional
12
+ attribute? :given_name, Types::String.optional
13
+ attribute? :sur_name, Types::String.optional
14
+ attribute? :middle_name, Types::String.optional
15
+ attribute? :last_name, Types::String.optional
16
+ attribute? :co, Types::String.optional
17
+ attribute? :street, Types::String.optional
18
+ attribute? :zip_code, Types::String.optional
19
+ attribute? :city, Types::String.optional
20
+ end
21
+
22
+ class PersonVerifyPhoneNumberBlock < Dry::Struct
23
+ transform_keys { |key| CAMEL.parse(key) }
24
+
25
+ attribute? :phone_numbers, Types::Array.of(Types::String).optional
26
+ attribute? :phone_types, Types::Array.of(Types::String).optional
27
+ end
28
+
29
+ class PersonVerifyQuery < Dry::Struct
30
+ transform_keys { |key| CAMEL.parse(key) }
31
+
32
+ attribute? :ssn, Types::String.optional
33
+ attribute? :first_name, Types::String.optional
34
+ attribute? :last_name, Types::String.optional
35
+ attribute? :complete_name, Types::String.optional
36
+ attribute? :gender, Types::String.optional
37
+ attribute? :street, Types::String.optional
38
+ attribute? :zip_code, Types::String.optional
39
+ attribute? :city, Types::String.optional
40
+ attribute? :phone_nr, Types::String.optional
41
+ attribute? :exclude_below18_year, Types::Bool.optional
42
+ attribute? :match_steps, Types::String.optional
43
+ attribute? :text, Types::String.optional
44
+ end
45
+
46
+ class PersonVerifySSNBlock < Dry::Struct
47
+ transform_keys { |key| CAMEL.parse(key) }
48
+
49
+ attribute? :ssn, Types::String.optional
50
+ end
51
+
52
+ class PersonVerifyMatch < Dry::Struct
53
+ transform_keys { |key| CAMEL.parse(key) }
54
+
55
+ attribute? :basic, PersonVerifyBasicBlock.optional
56
+ attribute? :ssn, PersonVerifySSNBlock.optional
57
+ attribute? :phone_numbers, PersonVerifyPhoneNumberBlock.optional
58
+ end
59
+
60
+ end
61
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class PTSBasicBlock < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :operator, Types::String.optional
12
+ end
13
+
14
+ end
15
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class SafenodeFinancialStatement < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :period_start, Types::String.optional
12
+ attribute? :period_end, Types::String.optional
13
+ attribute? :number_of_employees, Types::Integer.optional
14
+ attribute? :turnover, Types::Integer.optional
15
+ attribute? :yearly_result, Types::Integer.optional
16
+ attribute? :earnings_after_depreciation, Types::Integer.optional
17
+ attribute? :ebtda, Types::Integer.optional
18
+ attribute? :earnings_after_net_interest_income, Types::Integer.optional
19
+ attribute? :total_assets, Types::Integer.optional
20
+ attribute? :total_equity, Types::Integer.optional
21
+ attribute? :sum_of_cash_bank, Types::Integer.optional
22
+ attribute? :long_term_liabilities, Types::Integer.optional
23
+ attribute? :short_term_liabilities, Types::Integer.optional
24
+ end
25
+
26
+ class SafenodeCompanyCreditReport < Dry::Struct
27
+ transform_keys { |key| CAMEL.parse(key) }
28
+
29
+ attribute? :blocked, Types::Bool.optional
30
+ attribute? :status, Types::String.optional
31
+ attribute? :details, SafenodeCompanyDetails.optional
32
+ attribute? :financial_statements, Types::Array.of(SafenodeFinancialStatement).optional
33
+ attribute? :board_members, Types::Array.of(SafenodeBoardMember).optional
34
+ attribute? :rating_value, Types::Integer.optional
35
+ attribute? :rating_description, Types::String.optional
36
+ attribute? :summary_ansokningar, SafenodeRemarkSummary.optional
37
+ attribute? :summary_remarks, SafenodeRemarkSummary.optional
38
+ attribute? :summary_emal, SafenodeRemarkSummary.optional
39
+ attribute? :summary_amal, SafenodeRemarkSummary.optional
40
+ attribute? :summary_tredskodomar, SafenodeRemarkSummary.optional
41
+ attribute? :summary_utmatningar, SafenodeRemarkSummary.optional
42
+ attribute? :skuldsaldo, SafenodeSkuldsaldo.optional
43
+ attribute? :skuldsaldo_history, Types::Array.of(SafenodeSkuldsaldo).optional
44
+ attribute? :skuldsanering, SafenodeSkuldsanering.optional
45
+ attribute? :konkurs, Types::String.optional
46
+ attribute? :remarks, Types::Array.of(SafenodeRemark).optional
47
+ end
48
+
49
+ end
50
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class SafenodeCompanyRemarkControl < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :blocked, Types::Bool.optional
12
+ attribute? :status, Types::String.optional
13
+ attribute? :details, SafenodeCompanyDetails.optional
14
+ attribute? :board_members, Types::Array.of(SafenodeBoardMember).optional
15
+ attribute? :summary_ansokningar, SafenodeRemarkSummary.optional
16
+ attribute? :summary_remarks, SafenodeRemarkSummary.optional
17
+ attribute? :summary_emal, SafenodeRemarkSummary.optional
18
+ attribute? :summary_amal, SafenodeRemarkSummary.optional
19
+ attribute? :summary_tredskodomar, SafenodeRemarkSummary.optional
20
+ attribute? :summary_utmatningar, SafenodeRemarkSummary.optional
21
+ attribute? :skuldsaldo, SafenodeSkuldsaldo.optional
22
+ attribute? :skuldsaldo_history, Types::Array.of(SafenodeSkuldsaldo).optional
23
+ attribute? :skuldsanering, SafenodeSkuldsanering.optional
24
+ attribute? :konkurs, Types::String.optional
25
+ attribute? :remarks, Types::Array.of(SafenodeRemark).optional
26
+ end
27
+
28
+ end
29
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class SafenodeAnnualTaxRecord < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :ar_dekl, Types::Integer.optional
12
+ attribute? :ink_tj, Types::Float.optional
13
+ attribute? :ink_nrv_akt_tot, Types::Float.optional
14
+ attribute? :ink_nrv_pass_tot, Types::Float.optional
15
+ attribute? :tax_forv_inkomst, Types::Float.optional
16
+ attribute? :beskbar_forv_inkomst, Types::Float.optional
17
+ attribute? :overskott_kapital, Types::Float.optional
18
+ attribute? :underskott_kapital, Types::Float.optional
19
+ attribute? :sk_slut, Types::Float.optional
20
+ attribute? :ink_netto, Types::Float.optional
21
+ attribute? :skatt, Types::Float.optional
22
+ end
23
+
24
+ class SafenodePersonCreditReport < Dry::Struct
25
+ transform_keys { |key| CAMEL.parse(key) }
26
+
27
+ attribute? :blocked, Types::Bool.optional
28
+ attribute? :status, Types::String.optional
29
+ attribute? :details, SafenodePersonDetails.optional
30
+ attribute? :score_value, Types::Integer.optional
31
+ attribute? :score_description, Types::String.optional
32
+ attribute? :recovery_probability, Types::Float.optional
33
+ attribute? :remark_probability, Types::Float.optional
34
+ attribute? :summary_remarks, SafenodeRemarkSummary.optional
35
+ attribute? :summary_emal, SafenodeRemarkSummary.optional
36
+ attribute? :summary_amal, SafenodeRemarkSummary.optional
37
+ attribute? :summary_tredskodomar, SafenodeRemarkSummary.optional
38
+ attribute? :summary_utmatningar, SafenodeRemarkSummary.optional
39
+ attribute? :skuldsaldo, SafenodeSkuldsaldo.optional
40
+ attribute? :skuldsaldo_history, Types::Array.of(SafenodeSkuldsaldo).optional
41
+ attribute? :skuldsanering, SafenodeSkuldsanering.optional
42
+ attribute? :konkurs, Types::String.optional
43
+ attribute? :forvaltarskap, Types::String.optional
44
+ attribute? :remarks, Types::Array.of(SafenodeRemark).optional
45
+ attribute? :annual_tax_records, Types::Array.of(SafenodeAnnualTaxRecord).optional
46
+ end
47
+
48
+ end
49
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class SafenodePersonRemarkControl < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :blocked, Types::Bool.optional
12
+ attribute? :status, Types::String.optional
13
+ attribute? :details, SafenodePersonDetails.optional
14
+ attribute? :summary_remarks, SafenodeRemarkSummary.optional
15
+ attribute? :summary_emal, SafenodeRemarkSummary.optional
16
+ attribute? :summary_amal, SafenodeRemarkSummary.optional
17
+ attribute? :summary_tredskodomar, SafenodeRemarkSummary.optional
18
+ attribute? :summary_utmatningar, SafenodeRemarkSummary.optional
19
+ attribute? :skuldsaldo, SafenodeSkuldsaldo.optional
20
+ attribute? :skuldsaldo_history, Types::Array.of(SafenodeSkuldsaldo).optional
21
+ attribute? :skuldsanering, SafenodeSkuldsanering.optional
22
+ attribute? :konkurs, Types::String.optional
23
+ attribute? :forvaltarskap, Types::String.optional
24
+ attribute? :remarks, Types::Array.of(SafenodeRemark).optional
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class SignatoryOrganization < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :organization_number, Types::String.optional
12
+ attribute? :company_name, Types::String.optional
13
+ attribute? :status_code, Types::String.optional
14
+ attribute? :status_text, Types::String.optional
15
+ attribute? :status_date, Types::String.optional
16
+ attribute? :signatory_list, Types::Array.of(Types::String).optional
17
+ end
18
+
19
+ class SignatoryOrganizationBlock < Dry::Struct
20
+ transform_keys { |key| CAMEL.parse(key) }
21
+
22
+ attribute? :organization, SignatoryOrganization.optional
23
+ end
24
+
25
+ class SignatoryPersonBlock < Dry::Struct
26
+ transform_keys { |key| CAMEL.parse(key) }
27
+
28
+ attribute? :ssn, Types::String.optional
29
+ attribute? :organizations, Types::Array.of(SignatoryOrganization).optional
30
+ end
31
+
32
+ class SignatoryRightToSignBlock < Dry::Struct
33
+ transform_keys { |key| CAMEL.parse(key) }
34
+
35
+ attribute? :right_to_sign, Types::String.optional
36
+ attribute? :organization, SignatoryOrganization.optional
37
+ end
38
+
39
+ end
40
+ end
@@ -0,0 +1,107 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class SparForeignAddress < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :care_of, Types::String.optional
12
+ attribute? :address1, Types::String.optional
13
+ attribute? :address2, Types::String.optional
14
+ attribute? :address3, Types::String.optional
15
+ attribute? :country, Types::String.optional
16
+ attribute? :date_from, Types::String.optional
17
+ attribute? :date_to, Types::String.optional
18
+ end
19
+
20
+ class SparOfficialAddress < Dry::Struct
21
+ transform_keys { |key| CAMEL.parse(key) }
22
+
23
+ attribute? :care_of, Types::String.optional
24
+ attribute? :continuation, Types::String.optional
25
+ attribute? :street_address, Types::String.optional
26
+ attribute? :zip_code, Types::String.optional
27
+ attribute? :city, Types::String.optional
28
+ attribute? :municipality_code, Types::String.optional
29
+ attribute? :district_code, Types::String.optional
30
+ attribute? :county_code, Types::String.optional
31
+ attribute? :date_to, Types::String.optional
32
+ attribute? :date_from, Types::String.optional
33
+ attribute? :registration_date, Types::String.optional
34
+ end
35
+
36
+ class SparPersonDetails < Dry::Struct
37
+ transform_keys { |key| CAMEL.parse(key) }
38
+
39
+ attribute? :first_name, Types::String.optional
40
+ attribute? :given_name, Types::String.optional
41
+ attribute? :middle_name, Types::String.optional
42
+ attribute? :sur_name, Types::String.optional
43
+ attribute? :date_of_birth, Types::String.optional
44
+ attribute? :gender, Types::String.optional
45
+ attribute? :deseased_date, Types::String.optional
46
+ attribute? :de_regstration_code, Types::String.optional
47
+ attribute? :de_registration_date, Types::String.optional
48
+ attribute? :previous_ssn, Types::String.optional
49
+ attribute? :current_ssn, Types::String.optional
50
+ attribute? :protected, Types::Bool.optional
51
+ attribute? :protected_change_date, Types::String.optional
52
+ attribute? :protected_address, Types::Bool.optional
53
+ attribute? :protected_address_change_date, Types::String.optional
54
+ attribute? :swedish_citizen, Types::Bool.optional
55
+ attribute? :birth_parish, Types::String.optional
56
+ attribute? :birth_county_code, Types::String.optional
57
+ attribute? :notification_name, Types::String.optional
58
+ end
59
+
60
+ class SparRelation < Dry::Struct
61
+ transform_keys { |key| CAMEL.parse(key) }
62
+
63
+ attribute? :deseased_date, Types::String.optional
64
+ attribute? :date_from, Types::String.optional
65
+ attribute? :date_to, Types::String.optional
66
+ attribute? :ssn, Types::String.optional
67
+ attribute? :first_name, Types::String.optional
68
+ attribute? :middle_name, Types::String.optional
69
+ attribute? :sur_name, Types::String.optional
70
+ attribute? :date_of_birth, Types::String.optional
71
+ attribute? :relation_type, Types::String.optional
72
+ attribute? :de_regstration_code, Types::String.optional
73
+ attribute? :de_registration_date, Types::String.optional
74
+ end
75
+
76
+ class SparSpecialAddress < Dry::Struct
77
+ transform_keys { |key| CAMEL.parse(key) }
78
+
79
+ attribute? :care_of, Types::String.optional
80
+ attribute? :zip_code, Types::String.optional
81
+ attribute? :city, Types::String.optional
82
+ attribute? :continuation, Types::String.optional
83
+ attribute? :street_address, Types::String.optional
84
+ attribute? :date_to, Types::String.optional
85
+ attribute? :date_from, Types::String.optional
86
+ end
87
+
88
+ class SparBlock < Dry::Struct
89
+ transform_keys { |key| CAMEL.parse(key) }
90
+
91
+ attribute? :protected, Types::Bool.optional
92
+ attribute? :protected_change_date, Types::String.optional
93
+ attribute? :protected_address, Types::Bool.optional
94
+ attribute? :protected_address_change_date, Types::String.optional
95
+ attribute? :ssn, Types::String.optional
96
+ attribute? :last_change_date_spar, Types::String.optional
97
+ attribute? :details, SparPersonDetails.optional
98
+ attribute? :official_addresses, Types::Array.of(SparOfficialAddress).optional
99
+ attribute? :special_addresses, Types::Array.of(SparSpecialAddress).optional
100
+ attribute? :foreign_addresses, Types::Array.of(SparForeignAddress).optional
101
+ attribute? :relations, Types::Array.of(SparRelation).optional
102
+ attribute? :income_year, Types::String.optional
103
+ attribute? :summarized_income, Types::String.optional
104
+ end
105
+
106
+ end
107
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class BasicBlock < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :region, Types::String.optional
12
+ attribute? :age_group, Types::String.optional
13
+ attribute? :amount_total, Types::Integer.optional
14
+ attribute? :amount_men, Types::Integer.optional
15
+ attribute? :amount_female, Types::Integer.optional
16
+ attribute? :amount_household, Types::Integer.optional
17
+ end
18
+
19
+ class EconomyBlock < Dry::Struct
20
+ transform_keys { |key| CAMEL.parse(key) }
21
+
22
+ attribute? :region, Types::String.optional
23
+ attribute? :age_group, Types::String.optional
24
+ attribute? :average_salary_all, Types::Integer.optional
25
+ attribute? :average_salary_male, Types::Integer.optional
26
+ attribute? :average_salary_female, Types::Integer.optional
27
+ attribute? :average_income_all, Types::Integer.optional
28
+ attribute? :average_income_male, Types::Integer.optional
29
+ attribute? :average_income_female, Types::Integer.optional
30
+ end
31
+
32
+ end
33
+ end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class SubscriberCompanyBasicBlock < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :company_name, Types::String.optional
12
+ attribute? :organization_number, Types::String.optional
13
+ attribute? :full_name, Types::String.optional
14
+ attribute? :co, Types::String.optional
15
+ attribute? :street, Types::String.optional
16
+ attribute? :zip_code, Types::String.optional
17
+ attribute? :city, Types::String.optional
18
+ attribute? :company_code, Types::String.optional
19
+ attribute? :company_code_text, Types::String.optional
20
+ attribute? :registration_date, Types::String.optional
21
+ attribute? :status, Types::String.optional
22
+ end
23
+
24
+ class SubscriberInfoBlock < Dry::Struct
25
+ transform_keys { |key| CAMEL.parse(key) }
26
+
27
+ attribute? :company_name, Types::String.optional
28
+ attribute? :organization_number, Types::String.optional
29
+ attribute? :personal_number, Types::String.optional
30
+ attribute? :first_name, Types::String.optional
31
+ attribute? :middle_name, Types::String.optional
32
+ attribute? :last_name, Types::String.optional
33
+ end
34
+
35
+ class SubscriberInfoExtendedBlock < Dry::Struct
36
+ transform_keys { |key| CAMEL.parse(key) }
37
+
38
+ attribute? :operator, Types::String.optional
39
+ attribute? :phone_type, Types::String.optional
40
+ attribute? :sub_type, Types::String.optional
41
+ attribute? :first_seen, Types::String.optional
42
+ attribute? :updated, Types::String.optional
43
+ end
44
+
45
+ class SubscriberPersonBasicBlock < Dry::Struct
46
+ transform_keys { |key| CAMEL.parse(key) }
47
+
48
+ attribute? :ssn, Types::String.optional
49
+ attribute? :ssn_status, Types::String.optional
50
+ attribute? :first_name, Types::String.optional
51
+ attribute? :given_name, Types::String.optional
52
+ attribute? :sur_name, Types::String.optional
53
+ attribute? :middle_name, Types::String.optional
54
+ attribute? :last_name, Types::String.optional
55
+ attribute? :co, Types::String.optional
56
+ attribute? :street, Types::String.optional
57
+ attribute? :zip_code, Types::String.optional
58
+ attribute? :city, Types::String.optional
59
+ end
60
+
61
+ class SubscriberQueryBlock < Dry::Struct
62
+ transform_keys { |key| CAMEL.parse(key) }
63
+
64
+ attribute? :phonenumber, Types::String.optional
65
+ end
66
+
67
+ end
68
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class SubsbriberInfoBasicBlock < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :phone_number_search, Types::String.optional
12
+ attribute? :phone_number, Types::String.optional
13
+ attribute? :organization_number, Types::String.optional
14
+ attribute? :personal_number, Types::String.optional
15
+ attribute? :company_name, Types::String.optional
16
+ attribute? :first_name, Types::String.optional
17
+ attribute? :middle_name, Types::String.optional
18
+ attribute? :last_name, Types::String.optional
19
+ end
20
+
21
+ class SubsbriberInfoExtendedBlock < Dry::Struct
22
+ transform_keys { |key| CAMEL.parse(key) }
23
+
24
+ attribute? :phone_number_search, Types::String.optional
25
+ attribute? :phone_number, Types::String.optional
26
+ attribute? :organization_number, Types::String.optional
27
+ attribute? :personal_number, Types::String.optional
28
+ attribute? :company_name, Types::String.optional
29
+ attribute? :first_name, Types::String.optional
30
+ attribute? :middle_name, Types::String.optional
31
+ attribute? :last_name, Types::String.optional
32
+ attribute? :operator, Types::String.optional
33
+ attribute? :phone_type, Types::String.optional
34
+ attribute? :sub_type, Types::String.optional
35
+ attribute? :first_seen, Types::String.optional
36
+ attribute? :updated, Types::String.optional
37
+ end
38
+
39
+ class SubsbriberInfoKeyBlock < Dry::Struct
40
+ transform_keys { |key| CAMEL.parse(key) }
41
+
42
+ attribute? :phone_number_search, Types::String.optional
43
+ attribute? :phone_number, Types::String.optional
44
+ attribute? :organization_number, Types::String.optional
45
+ attribute? :personal_number, Types::String.optional
46
+ end
47
+
48
+ end
49
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "common"
4
+
5
+ module Checkbiz
6
+ module Types
7
+
8
+ class SubscriberNixBlock < Dry::Struct
9
+ transform_keys { |key| CAMEL.parse(key) }
10
+
11
+ attribute? :nix_code, Types::String.optional
12
+ attribute? :date_added, Types::String.optional
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Checkbiz
4
+ VERSION = "1.0.0"
5
+ end
data/lib/checkbiz.rb ADDED
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rest_easy"
4
+ require "zeitwerk"
5
+
6
+ loader = Zeitwerk::Loader.for_gem
7
+ loader.collapse("#{__dir__}/checkbiz/resources")
8
+ loader.setup
9
+
10
+ module Checkbiz
11
+ extend RestEasy
12
+
13
+ class RequestError < RestEasy::Error; end
14
+ class AttributeError < RestEasy::Error; end
15
+ class ArgumentError < RestEasy::Error; end
16
+
17
+ configure do
18
+ base_url "https://api.checkbiz.se/api"
19
+ max_retries 3
20
+ authentication RestEasy::Auth::PSK.new(
21
+ api_key: "",
22
+ header_prefix: "Basic"
23
+ )
24
+ attribute_convention :CamelCase
25
+ end
26
+ end