nordlet 0.6.6 → 0.6.9

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 (131) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nordlet/account/client.rb +89 -6
  3. data/lib/nordlet/account/types/brand_get_account_request.rb +9 -0
  4. data/lib/nordlet/account/types/brand_get_account_response.rb +17 -0
  5. data/lib/nordlet/account/types/brand_update_account_request.rb +17 -0
  6. data/lib/nordlet/account/types/brand_update_account_response.rb +17 -0
  7. data/lib/nordlet/account/types/companies_create_account_response.rb +10 -0
  8. data/lib/nordlet/account/types/companies_create_account_response_vat_period.rb +17 -0
  9. data/lib/nordlet/account/types/me_account_response_companies_item.rb +10 -0
  10. data/lib/nordlet/account/types/me_account_response_companies_item_vat_period.rb +17 -0
  11. data/lib/nordlet/account/types/me_account_response_user.rb +2 -0
  12. data/lib/nordlet/bank/client.rb +186 -15
  13. data/lib/nordlet/bank/types/reconciliation_get_bank_request.rb +15 -0
  14. data/lib/nordlet/bank/types/reconciliation_get_bank_response.rb +35 -0
  15. data/lib/nordlet/bank/types/reconciliation_get_bank_response_statement_balance_source.rb +14 -0
  16. data/lib/nordlet/bank/types/reconciliation_get_bank_response_unbooked_lines_item.rb +43 -0
  17. data/lib/nordlet/bank/types/reconciliation_get_bank_response_unbooked_lines_item_status.rb +15 -0
  18. data/lib/nordlet/bank/types/transactions_ignore_bank_request.rb +13 -0
  19. data/lib/nordlet/bank/types/transactions_ignore_bank_response.rb +43 -0
  20. data/lib/nordlet/bank/types/transactions_ignore_bank_response_status.rb +15 -0
  21. data/lib/nordlet/bank/types/transactions_import_bank_request.rb +4 -0
  22. data/lib/nordlet/bank/types/transactions_import_bank_response.rb +2 -0
  23. data/lib/nordlet/bank/types/transactions_import_bank_response_duplicates_item.rb +17 -0
  24. data/lib/nordlet/bank/types/transactions_list_bank_response_rows_item.rb +6 -0
  25. data/lib/nordlet/bank/types/transactions_list_bank_response_rows_item_status.rb +1 -0
  26. data/lib/nordlet/bank/types/transactions_match_bank_request.rb +2 -0
  27. data/lib/nordlet/bank/types/transactions_match_bank_request_remainder.rb +13 -0
  28. data/lib/nordlet/bank/types/transactions_match_bank_request_remainder_treatment.rb +15 -0
  29. data/lib/nordlet/bank/types/transactions_match_bank_response.rb +6 -0
  30. data/lib/nordlet/bank/types/transactions_match_bank_response_status.rb +1 -0
  31. data/lib/nordlet/bank/types/transactions_match_many_bank_response.rb +6 -0
  32. data/lib/nordlet/bank/types/transactions_match_many_bank_response_status.rb +1 -0
  33. data/lib/nordlet/bank/types/transactions_post_bank_request.rb +25 -0
  34. data/lib/nordlet/bank/types/transactions_post_bank_response.rb +43 -0
  35. data/lib/nordlet/bank/types/transactions_post_bank_response_status.rb +15 -0
  36. data/lib/nordlet/bank/types/transactions_record_bank_response.rb +6 -0
  37. data/lib/nordlet/bank/types/transactions_record_bank_response_status.rb +1 -0
  38. data/lib/nordlet/bank/types/transactions_unignore_bank_request.rb +11 -0
  39. data/lib/nordlet/bank/types/transactions_unignore_bank_response.rb +43 -0
  40. data/lib/nordlet/bank/types/transactions_unignore_bank_response_status.rb +15 -0
  41. data/lib/nordlet/bank/types/transactions_unmatch_bank_response.rb +6 -0
  42. data/lib/nordlet/bank/types/transactions_unmatch_bank_response_status.rb +1 -0
  43. data/lib/nordlet/billing/client.rb +3 -2
  44. data/lib/nordlet/billing/types/account_get_billing_response_month_to_date.rb +0 -2
  45. data/lib/nordlet/billing/types/account_set_account_type_billing_response_month_to_date.rb +0 -2
  46. data/lib/nordlet/billing/types/account_set_auto_top_up_billing_response_month_to_date.rb +0 -2
  47. data/lib/nordlet/billing/types/account_set_overdraft_cap_billing_response_month_to_date.rb +0 -2
  48. data/lib/nordlet/billing/types/account_set_plan_billing_response_month_to_date.rb +0 -2
  49. data/lib/nordlet/billing/types/flat_rate_confirm_billing_response_month_to_date.rb +0 -2
  50. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_month_to_date.rb +0 -2
  51. data/lib/nordlet/billing/types/subscription_cancel_billing_response_month_to_date.rb +0 -2
  52. data/lib/nordlet/billing/types/topup_confirm_billing_response_month_to_date.rb +0 -2
  53. data/lib/nordlet/calendar/client.rb +3 -1
  54. data/lib/nordlet/capture/client.rb +6 -188
  55. data/lib/nordlet/capture/types/documents_confirm_capture_response_invoice.rb +6 -0
  56. data/lib/nordlet/capture/types/documents_confirm_capture_response_invoice_status.rb +1 -0
  57. data/lib/nordlet/capture/types/documents_confirm_capture_response_opposite_invoice.rb +6 -0
  58. data/lib/nordlet/capture/types/documents_confirm_capture_response_opposite_invoice_status.rb +1 -0
  59. data/lib/nordlet/cash/client.rb +11 -10
  60. data/lib/nordlet/declarations/client.rb +7 -3
  61. data/lib/nordlet/declarations/types/configs_list_declarations_response_rows_item_fields_item.rb +2 -0
  62. data/lib/nordlet/declarations/types/configs_update_declarations_response_fields_item.rb +2 -0
  63. data/lib/nordlet/hr/client.rb +3 -2
  64. data/lib/nordlet/ledger/client.rb +46 -5
  65. data/lib/nordlet/ledger/types/journal_transactions_get_ledger_response.rb +2 -0
  66. data/lib/nordlet/ledger/types/journal_transactions_reverse_ledger_request.rb +15 -0
  67. data/lib/nordlet/ledger/types/journal_transactions_reverse_ledger_response.rb +27 -0
  68. data/lib/nordlet/ledger/types/journal_transactions_reverse_ledger_response_status.rb +14 -0
  69. data/lib/nordlet/ledger/types/periods_lock_ledger_response.rb +2 -0
  70. data/lib/nordlet/ledger/types/periods_lock_ledger_response_warnings_item.rb +17 -0
  71. data/lib/nordlet/ledger/types/periods_lock_ledger_response_warnings_item_code.rb +21 -0
  72. data/lib/nordlet/partners/client.rb +10 -8
  73. data/lib/nordlet/public/types/invoices_get_public_response.rb +2 -0
  74. data/lib/nordlet/purchases/client.rb +77 -20
  75. data/lib/nordlet/purchases/types/invoices_create_purchases_request.rb +6 -0
  76. data/lib/nordlet/purchases/types/invoices_create_purchases_response.rb +8 -0
  77. data/lib/nordlet/purchases/types/invoices_create_purchases_response_status.rb +1 -0
  78. data/lib/nordlet/purchases/types/invoices_create_purchases_response_warnings_item.rb +13 -0
  79. data/lib/nordlet/purchases/types/invoices_get_purchases_response.rb +6 -0
  80. data/lib/nordlet/purchases/types/invoices_get_purchases_response_status.rb +1 -0
  81. data/lib/nordlet/purchases/types/invoices_list_purchases_response_rows_item.rb +6 -0
  82. data/lib/nordlet/purchases/types/invoices_list_purchases_response_rows_item_status.rb +1 -0
  83. data/lib/nordlet/purchases/types/invoices_register_purchases_response.rb +8 -0
  84. data/lib/nordlet/purchases/types/invoices_register_purchases_response_status.rb +1 -0
  85. data/lib/nordlet/purchases/types/invoices_register_purchases_response_warnings_item.rb +13 -0
  86. data/lib/nordlet/purchases/types/invoices_reverse_purchases_request.rb +15 -0
  87. data/lib/nordlet/purchases/types/invoices_reverse_purchases_response.rb +71 -0
  88. data/lib/nordlet/purchases/types/invoices_reverse_purchases_response_lines_item.rb +53 -0
  89. data/lib/nordlet/purchases/types/invoices_reverse_purchases_response_payment_status.rb +15 -0
  90. data/lib/nordlet/purchases/types/invoices_reverse_purchases_response_status.rb +15 -0
  91. data/lib/nordlet/{capture/types/documents_upload_capture_response_extraction_document_type.rb → purchases/types/invoices_reverse_purchases_response_type.rb} +2 -2
  92. data/lib/nordlet/purchases/types/invoices_update_purchases_request.rb +6 -0
  93. data/lib/nordlet/purchases/types/invoices_update_purchases_response.rb +6 -0
  94. data/lib/nordlet/purchases/types/invoices_update_purchases_response_status.rb +1 -0
  95. data/lib/nordlet/reference/client.rb +8 -2
  96. data/lib/nordlet/reference/types/vat_resolve_reference_request.rb +2 -0
  97. data/lib/nordlet/reference/types/vat_resolve_reference_request_side.rb +14 -0
  98. data/lib/nordlet/reference/types/vat_resolve_reference_response.rb +2 -0
  99. data/lib/nordlet/reports/client.rb +42 -0
  100. data/lib/nordlet/reports/types/period_checklist_reports_request.rb +11 -0
  101. data/lib/nordlet/reports/types/period_checklist_reports_response.rb +17 -0
  102. data/lib/nordlet/reports/types/period_checklist_reports_response_items_item.rb +17 -0
  103. data/lib/nordlet/reports/types/period_checklist_reports_response_items_item_code.rb +21 -0
  104. data/lib/nordlet/sales/client.rb +19 -8
  105. data/lib/nordlet/sales/types/invoices_create_sales_response.rb +2 -0
  106. data/lib/nordlet/sales/types/invoices_create_sales_response_warnings_item.rb +13 -0
  107. data/lib/nordlet/sales/types/invoices_issue_sales_response.rb +2 -0
  108. data/lib/nordlet/sales/types/invoices_issue_sales_response_warnings_item.rb +13 -0
  109. data/lib/nordlet/sales/types/invoices_view_sales_response.rb +2 -0
  110. data/lib/nordlet/version.rb +1 -1
  111. data/lib/nordlet.rb +43 -19
  112. data/reference.md +864 -469
  113. metadata +45 -21
  114. data/lib/nordlet/capture/types/documents_upload_capture_request.rb +0 -15
  115. data/lib/nordlet/capture/types/documents_upload_capture_response.rb +0 -43
  116. data/lib/nordlet/capture/types/documents_upload_capture_response_extraction.rb +0 -33
  117. data/lib/nordlet/capture/types/documents_upload_capture_response_extraction_lines_item.rb +0 -25
  118. data/lib/nordlet/capture/types/documents_upload_capture_response_extraction_opposite_lines_item.rb +0 -25
  119. data/lib/nordlet/capture/types/documents_upload_capture_response_extraction_supplier.rb +0 -19
  120. data/lib/nordlet/capture/types/documents_upload_capture_response_status.rb +0 -16
  121. data/lib/nordlet/capture/types/inbound_email_capture_request.rb +0 -27
  122. data/lib/nordlet/capture/types/inbound_email_capture_request_attachments_item.rb +0 -21
  123. data/lib/nordlet/capture/types/inbound_email_capture_request_to.rb +0 -15
  124. data/lib/nordlet/capture/types/inbound_email_capture_request_to_full_item.rb +0 -11
  125. data/lib/nordlet/capture/types/inbound_email_capture_response.rb +0 -15
  126. data/lib/nordlet/capture/types/settings_get_capture_request.rb +0 -9
  127. data/lib/nordlet/capture/types/settings_get_capture_response.rb +0 -17
  128. data/lib/nordlet/capture/types/settings_regenerate_intake_capture_request.rb +0 -9
  129. data/lib/nordlet/capture/types/settings_regenerate_intake_capture_response.rb +0 -17
  130. data/lib/nordlet/capture/types/settings_update_capture_request.rb +0 -13
  131. data/lib/nordlet/capture/types/settings_update_capture_response.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eedd5efc8df32359e54a246907c9a3b325d2e9dffa7d452b9752c9eb8f745274
4
- data.tar.gz: 835276e28ec2eb23311f6f7d0ea94e2e6b3a5eff234ef55336d725b2a2dd87e4
3
+ metadata.gz: 8cd4322ecb70ae6e7a92415d8e62784d375470eb0542dabac4e9e680f1029c6e
4
+ data.tar.gz: 54c385e52e560d090c103e905435f94f60dec78fc14365e2021da4281f23e72e
5
5
  SHA512:
6
- metadata.gz: d449387fa1acf0a830054dde08f75fca36b31437c95786111823e0af5a5b61be6e75e3a690af72c36291824ef898774df9be3e45ce8e4adf22f3de7a4966a764
7
- data.tar.gz: e2b7200ef78d6055fc2b4f6a4e7f878b28b53bf0e4fc44dda77ed70f4905668d58fd14c82141eac4bdb13bd2210585f1ba7546a5d1d89179bc6f7f6be0ee6e02
6
+ metadata.gz: bb9a1bcef9a194b5331be8d6cf2d94a628c642841f23b142e731b3aa348ce5ac6aa45f44bb2dfb17ae34f0bae0bd438d3156d7eeff07aad114145df70ee2aff0
7
+ data.tar.gz: fb54c998c3149283d2db58cc0457ef75bfaef8dd12b19138388d7f3bc9b01c93c992fad645056ed4dfe49ee4790f9460575ba5260e8cdeac34668cdf946923e8
@@ -130,9 +130,11 @@ module Nordlet
130
130
  # Return the signed-in user, their active company and role in it, the companies they belong to and their consent
131
131
  # state. `billing` is the billing account of the request's site (the `x-nordlet-site` header, `app` when absent)
132
132
  # that pays for the active company (its payer, or the user when there is none or no company), with `isPayer`
133
- # saying whether that is the user; `referralPoints` is the user's current points balance. An API key may call it
134
- # too: the active company is then the one named in the `x-nordlet-company` header, and `companies` lists every
135
- # company the key works in.
133
+ # saying whether that is the user; `referralPoints` is the user's current points balance; `user.whiteLabel` says
134
+ # the user is a white-label partner, who may call `account/brand/get` and `account/brand/update`. An API key may
135
+ # call it too: the active company is then the one named in the `x-nordlet-company` header, and `companies` lists
136
+ # every company the key works in, each with its country, base currency, VAT payer flag, VAT period and the month
137
+ # its fiscal year ends in.
136
138
  #
137
139
  # @param request_options [Hash]
138
140
  # @param params [Nordlet::Account::Types::MeAccountRequest]
@@ -525,7 +527,8 @@ module Nordlet
525
527
  # to true and `defaultInvoiceCurrency` to the base currency. Without a paid plan the caller may create only one
526
528
  # sandbox company, which starts the free sandbox plan; a live company, a second sandbox company, or a sandbox
527
529
  # company after the free sandbox has ended is refused with 402. Refused with 422 when `baseCurrency` is not a
528
- # supported currency.
530
+ # supported currency. An API key may call it when it holds the `account:write` scope (403 otherwise): the company
531
+ # is created for the person the key belongs to, and the key works in it like in their other companies.
529
532
  #
530
533
  # @param request_options [Hash]
531
534
  # @param params [Nordlet::Account::Types::CompaniesCreateAccountRequest]
@@ -595,7 +598,8 @@ module Nordlet
595
598
  end
596
599
  end
597
600
 
598
- # Return the profile of the active company.
601
+ # Return the profile of the active company. An API key reads the company named in the `x-nordlet-company` header
602
+ # and needs the `account:read` scope.
599
603
  #
600
604
  # @param request_options [Hash]
601
605
  # @param params [Nordlet::Account::Types::CompaniesProfileAccountRequest]
@@ -632,7 +636,11 @@ module Nordlet
632
636
  # Change the profile of the active company; owners and admins may call it. Only the fields sent are changed, and
633
637
  # the nullable ones can be sent as null to clear them. `logo` stores a base64-encoded image as a file of the
634
638
  # company and sets `logoFileId`. The country, base currency, sandbox flag and cash-basis flag are fixed at
635
- # creation.
639
+ # creation. An API key changes the company named in the `x-nordlet-company` header, needs the `account:write`
640
+ # scope and the owner or admin role there, and may send only `code`, `vatCode`, `smeExemptionNumber`, `legalForm`,
641
+ # `registryName`, `incorporatedOn`, `shareCapital`, `address`, `email`, `phone`, `accountsKeptBy`,
642
+ # `bookkeeperName`, `auditorName`, `auditorRegistrationNumber`, `auditRequired`; any other field is refused with
643
+ # 403.
636
644
  #
637
645
  # @param request_options [Hash]
638
646
  # @param params [Nordlet::Account::Types::CompaniesUpdateAccountRequest]
@@ -1026,6 +1034,81 @@ module Nordlet
1026
1034
  end
1027
1035
  end
1028
1036
 
1037
+ # Return the brand settings of the signed-in white-label partner: `name`, `logoUrl`, `color` and `footer`, each
1038
+ # null when not set. Refused with 403 when the user is not a white-label partner.
1039
+ #
1040
+ # @param request_options [Hash]
1041
+ # @param params [Nordlet::Account::Types::BrandGetAccountRequest]
1042
+ # @option request_options [String] :base_url
1043
+ # @option request_options [Hash{String => Object}] :additional_headers
1044
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
1045
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
1046
+ # @option request_options [Integer] :timeout_in_seconds
1047
+ #
1048
+ # @return [Nordlet::Account::Types::BrandGetAccountResponse]
1049
+ def brand_get(request_options: {}, **params)
1050
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
1051
+ request = Nordlet::Internal::JSON::Request.new(
1052
+ base_url: request_options[:base_url],
1053
+ method: "POST",
1054
+ path: "v1/account/brand/get",
1055
+ body: Nordlet::Account::Types::BrandGetAccountRequest.new(params).to_h,
1056
+ request_options: request_options
1057
+ )
1058
+ begin
1059
+ response = @client.send(request)
1060
+ rescue Net::HTTPRequestTimeout
1061
+ raise Nordlet::Errors::TimeoutError
1062
+ end
1063
+ code = response.code.to_i
1064
+ if code.between?(200, 299)
1065
+ Nordlet::Account::Types::BrandGetAccountResponse.load(response.body)
1066
+ else
1067
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
1068
+ raise error_class.new(response.body, code: code)
1069
+ end
1070
+ end
1071
+
1072
+ # Set the brand settings of the signed-in white-label partner; all four fields are sent and null clears one. They
1073
+ # apply to every company the user pays for: the invoice, quote and payment reminder e-mails show `logoUrl` (an
1074
+ # https address of an image) in the header, use `color` (`#rrggbb`) for the top line, the brand name and the
1075
+ # buttons, and print `footer`, or `name` when there is no footer, in place of the Nordlet footer line; the public
1076
+ # invoice page prints `name` in its "Sent with" line and leaves the line out when there is no name (`sentWith` of
1077
+ # `public/invoices/get`); filled official form PDFs carry `name` as their producer and creator. Refused with 403
1078
+ # when the user is not a white-label partner.
1079
+ #
1080
+ # @param request_options [Hash]
1081
+ # @param params [Nordlet::Account::Types::BrandUpdateAccountRequest]
1082
+ # @option request_options [String] :base_url
1083
+ # @option request_options [Hash{String => Object}] :additional_headers
1084
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
1085
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
1086
+ # @option request_options [Integer] :timeout_in_seconds
1087
+ #
1088
+ # @return [Nordlet::Account::Types::BrandUpdateAccountResponse]
1089
+ def brand_update(request_options: {}, **params)
1090
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
1091
+ request = Nordlet::Internal::JSON::Request.new(
1092
+ base_url: request_options[:base_url],
1093
+ method: "POST",
1094
+ path: "v1/account/brand/update",
1095
+ body: Nordlet::Account::Types::BrandUpdateAccountRequest.new(params).to_h,
1096
+ request_options: request_options
1097
+ )
1098
+ begin
1099
+ response = @client.send(request)
1100
+ rescue Net::HTTPRequestTimeout
1101
+ raise Nordlet::Errors::TimeoutError
1102
+ end
1103
+ code = response.code.to_i
1104
+ if code.between?(200, 299)
1105
+ Nordlet::Account::Types::BrandUpdateAccountResponse.load(response.body)
1106
+ else
1107
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
1108
+ raise error_class.new(response.body, code: code)
1109
+ end
1110
+ end
1111
+
1029
1112
  # Send a confirmation link for the change to `newEmail` to the user's current address. When it is consumed with
1030
1113
  # `account/login-link/consume`, a second link goes to `newEmail`, and the address changes when that one is
1031
1114
  # consumed. When an unused link for `newEmail` was created within the last minute, the call answers `sent` without
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class BrandGetAccountRequest < Internal::Types::Model; end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class BrandGetAccountResponse < Internal::Types::Model
7
+ field :name, -> { String }, optional: false, nullable: true
8
+
9
+ field :logo_url, -> { String }, optional: false, nullable: true, api_name: "logoUrl"
10
+
11
+ field :color, -> { String }, optional: false, nullable: true
12
+
13
+ field :footer, -> { String }, optional: false, nullable: true
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class BrandUpdateAccountRequest < Internal::Types::Model
7
+ field :name, -> { String }, optional: false, nullable: true
8
+
9
+ field :logo_url, -> { String }, optional: false, nullable: true, api_name: "logoUrl"
10
+
11
+ field :color, -> { String }, optional: false, nullable: true
12
+
13
+ field :footer, -> { String }, optional: false, nullable: true
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class BrandUpdateAccountResponse < Internal::Types::Model
7
+ field :name, -> { String }, optional: false, nullable: true
8
+
9
+ field :logo_url, -> { String }, optional: false, nullable: true, api_name: "logoUrl"
10
+
11
+ field :color, -> { String }, optional: false, nullable: true
12
+
13
+ field :footer, -> { String }, optional: false, nullable: true
14
+ end
15
+ end
16
+ end
17
+ end
@@ -17,6 +17,16 @@ module Nordlet
17
17
  field :is_sandbox, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isSandbox"
18
18
 
19
19
  field :cash_basis, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "cashBasis"
20
+
21
+ field :country_code, -> { String }, optional: false, nullable: false, api_name: "countryCode"
22
+
23
+ field :base_currency, -> { String }, optional: false, nullable: false, api_name: "baseCurrency"
24
+
25
+ field :is_vat_payer, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isVatPayer"
26
+
27
+ field :vat_period, -> { Nordlet::Account::Types::CompaniesCreateAccountResponseVatPeriod }, optional: false, nullable: true, api_name: "vatPeriod"
28
+
29
+ field :fiscal_year_end_month, -> { Integer }, optional: false, nullable: true, api_name: "fiscalYearEndMonth"
20
30
  end
21
31
  end
22
32
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ module CompaniesCreateAccountResponseVatPeriod
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ MONTHLY = "monthly"
10
+ BIMONTHLY = "bimonthly"
11
+ QUARTERLY = "quarterly"
12
+ SEMIANNUAL = "semiannual"
13
+ ANNUAL = "annual"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -18,6 +18,16 @@ module Nordlet
18
18
 
19
19
  field :cash_basis, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "cashBasis"
20
20
 
21
+ field :country_code, -> { String }, optional: false, nullable: false, api_name: "countryCode"
22
+
23
+ field :base_currency, -> { String }, optional: false, nullable: false, api_name: "baseCurrency"
24
+
25
+ field :is_vat_payer, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isVatPayer"
26
+
27
+ field :vat_period, -> { Nordlet::Account::Types::MeAccountResponseCompaniesItemVatPeriod }, optional: false, nullable: true, api_name: "vatPeriod"
28
+
29
+ field :fiscal_year_end_month, -> { Integer }, optional: false, nullable: true, api_name: "fiscalYearEndMonth"
30
+
21
31
  field :status, -> { Nordlet::Account::Types::MeAccountResponseCompaniesItemStatus }, optional: false, nullable: false
22
32
 
23
33
  field :deleted_at, -> { String }, optional: false, nullable: true, api_name: "deletedAt"
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ module MeAccountResponseCompaniesItemVatPeriod
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ MONTHLY = "monthly"
10
+ BIMONTHLY = "bimonthly"
11
+ QUARTERLY = "quarterly"
12
+ SEMIANNUAL = "semiannual"
13
+ ANNUAL = "annual"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -15,6 +15,8 @@ module Nordlet
15
15
  field :plan, -> { String }, optional: false, nullable: false
16
16
 
17
17
  field :is_super_admin, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isSuperAdmin"
18
+
19
+ field :white_label, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "whiteLabel"
18
20
  end
19
21
  end
20
22
  end
@@ -119,8 +119,13 @@ module Nordlet
119
119
 
120
120
  # Insert statement lines (up to 1000 per call) into a bank account as new transactions. A line without `currency`
121
121
  # takes the account currency; a line in another currency is refused with 422. A line whose `externalId` is already
122
- # on the account is skipped and counted in `skipped`. An incoming line that an active match rule
123
- # (`bank/match-rules/create`) recognises is linked to its settlement batch.
122
+ # on the account is skipped and counted in `skipped`. A line without `externalId` that is identical to a line
123
+ # already on the account (same booking date, amount, counterparty IBAN, or name when either IBAN is missing, and
124
+ # description) is skipped, counted in `skipped` and listed in `duplicates`. When `openingBalance` and
125
+ # `closingBalance` are both given, the opening balance plus the lines must give the closing balance (422 with both
126
+ # figures otherwise), and the closing balance is kept for `bank/reconciliation/get` as the balance on the latest
127
+ # line date. An incoming line that an active match rule (`bank/match-rules/create`) recognises is linked to its
128
+ # settlement batch.
124
129
  #
125
130
  # @param request_options [Hash]
126
131
  # @param params [Nordlet::Bank::Types::TransactionsImportBankRequest]
@@ -157,8 +162,10 @@ module Nordlet
157
162
  # Import a statement file into a bank account: camt.053 XML, MT940, a Stripe balance CSV or a Revolut Business
158
163
  # CSV, chosen by `format` or by the type of `templateId` (an iso20022 template also takes MT940 content).
159
164
  # Statements whose IBAN or currency differ from the account are left out; the call is refused with 422 when none
160
- # remains, when a line is in another currency, when the file lacks the columns or elements the template requires
161
- # or when it holds more than 50000 lines. Lines already on the account are skipped, and Stripe movements already
165
+ # remains, when a line is in another currency, when the opening balance plus the lines of a camt.053 or MT940
166
+ # statement does not give its closing balance (the message names both figures), when the file lacks the columns or
167
+ # elements the template requires or when it holds more than 50000 lines. The closing balance of each statement is
168
+ # kept for `bank/reconciliation/get`. Lines already on the account are skipped, and Stripe movements already
162
169
  # posted through a settlement payout are skipped with a warning. With a template, the mapped fields are posted to
163
170
  # their ledger accounts, partners are created, payments are matched to the invoices they reference, and invoices,
164
171
  # credit notes or advance invoices are issued where the template asks for them (`invoiceMetaField`,
@@ -198,7 +205,9 @@ module Nordlet
198
205
  end
199
206
 
200
207
  # List the bank transactions of the company. Filterable by id, bankAccountId, status, matchedDocumentId, date,
201
- # amount, counterpartyIban, counterpartyName and externalId; sortable by date, createdAt and amount.
208
+ # amount, counterpartyIban, counterpartyName, partnerId and externalId; sortable by date, createdAt and amount.
209
+ # `counterpartyName` is the name as the bank wrote it; `partnerId` and `partnerName` are the partner the line
210
+ # belongs to.
202
211
  #
203
212
  # @param request_options [Hash]
204
213
  # @param params [Nordlet::Bank::Types::TransactionsListBankRequest]
@@ -239,10 +248,15 @@ module Nordlet
239
248
  # with any exchange difference on the gain or loss account, raises the paid amount of the document and sets the
240
249
  # line to matched. A payment in another currency is converted into the invoice currency at the rate of the line
241
250
  # date, and the difference against the invoice's own rate is the exchange difference; `invoiceAmount` states the
242
- # amount settled instead; in the same currency it must equal the payment (422). Answers 409 when the line is
243
- # already matched, when the amount (converted, beyond one cent of the payment) exceeds the remaining balance of
244
- # the document or when the accounting period of the line date is locked. A document that becomes fully paid is
245
- # announced as `sale_invoice.paid` or `purchase_invoice.paid`.
251
+ # amount settled instead; in the same currency it must equal the payment (422). `remainder` settles a payment that
252
+ # differs from the remaining balance of a sale or purchase invoice in its own currency: `advance` books an
253
+ # overpayment beyond the balance to the advances-received posting rule (customer payments) or to
254
+ # `remainder.accountCode`, which a supplier overpayment must name, on the line's partner; `write_off` books the
255
+ # over- or underpayment to `remainder.accountCode` and settles the invoice in full; `leave_open` settles an
256
+ # underpayment as a partial payment and leaves the rest open. Answers 409 when the line is already matched or
257
+ # ignored, when the amount (converted, beyond one cent of the payment) exceeds the remaining balance of the
258
+ # document and no `remainder` is given, or when the accounting period of the line date is locked. A document that
259
+ # becomes fully paid is announced as `sale_invoice.paid` or `purchase_invoice.paid`.
246
260
  #
247
261
  # @param request_options [Hash]
248
262
  # @param params [Nordlet::Bank::Types::TransactionsMatchBankRequest]
@@ -316,9 +330,11 @@ module Nordlet
316
330
  end
317
331
  end
318
332
 
319
- # Undo a match. A payment matched to an invoice, or a line posted by an import template, gets a reversing journal
320
- # transaction dated date (default: today) and the invoice paid amount and payment status are restored; a line
321
- # linked to a payment-provider settlement is only unlinked. The line returns to status new.
333
+ # Undo a match. A payment matched to an invoice, a line posted by an import template or by
334
+ # `bank/transactions/post` (to an account or a tax payment) gets a reversing journal transaction dated date
335
+ # (default: today) and the invoice paid amount and payment status are restored; a line linked to a
336
+ # payment-provider settlement is only unlinked; an ignored line is restored as with `bank/transactions/unignore`.
337
+ # The line returns to status new.
322
338
  #
323
339
  # @param request_options [Hash]
324
340
  # @param params [Nordlet::Bank::Types::TransactionsUnmatchBankRequest]
@@ -352,10 +368,165 @@ module Nordlet
352
368
  end
353
369
  end
354
370
 
371
+ # Book one new bank transaction against a ledger account, for lines that settle no invoice (bank fees, interest,
372
+ # tax payments, transfers). Posts a journal transaction dated on the line's booking date between the bank
373
+ # account's ledger account and `accountCode` (incoming money: debit bank, credit the account; outgoing money the
374
+ # reverse), with the optional `partnerId` on the transaction and `costCenterId` and `projectId` on the counter
375
+ # entry, and sets the line to matched with `matchedDocumentType` `journal_transaction`. With `taxPaymentId` the
376
+ # line settles a tax payment recorded with `declarations/tax-payments/create`: an outgoing line for a payment, an
377
+ # incoming line for a refund, in the company currency and for the same amount (422 otherwise), not yet booked from
378
+ # another line (409); the line is matched as `tax_payment`. VAT is not booked here, because VAT returns are built
379
+ # from documents: a `vatClassifierCode` answers 422, and a fee with VAT is registered as a purchase invoice and
380
+ # the line matched to it. Answers 409 when the line is already matched or ignored or when the accounting period of
381
+ # the line date is locked. `bank/transactions/unmatch` reverses the posting.
382
+ #
383
+ # @param request_options [Hash]
384
+ # @param params [Nordlet::Bank::Types::TransactionsPostBankRequest]
385
+ # @option request_options [String] :base_url
386
+ # @option request_options [Hash{String => Object}] :additional_headers
387
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
388
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
389
+ # @option request_options [Integer] :timeout_in_seconds
390
+ #
391
+ # @return [Nordlet::Bank::Types::TransactionsPostBankResponse]
392
+ def transactions_post(request_options: {}, **params)
393
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
394
+ request = Nordlet::Internal::JSON::Request.new(
395
+ base_url: request_options[:base_url],
396
+ method: "POST",
397
+ path: "v1/bank/transactions/post",
398
+ body: Nordlet::Bank::Types::TransactionsPostBankRequest.new(params).to_h,
399
+ request_options: request_options
400
+ )
401
+ begin
402
+ response = @client.send(request)
403
+ rescue Net::HTTPRequestTimeout
404
+ raise Nordlet::Errors::TimeoutError
405
+ end
406
+ code = response.code.to_i
407
+ if code.between?(200, 299)
408
+ Nordlet::Bank::Types::TransactionsPostBankResponse.load(response.body)
409
+ else
410
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
411
+ raise error_class.new(response.body, code: code)
412
+ end
413
+ end
414
+
415
+ # Mark a new bank transaction as ignored, for a line that needs no booking (a duplicate the bank sent, a line
416
+ # booked another way), with the reason kept on the line. Nothing is posted. Answers 409 when the line is matched
417
+ # or already ignored; `bank/transactions/unignore` returns it to new.
418
+ #
419
+ # @param request_options [Hash]
420
+ # @param params [Nordlet::Bank::Types::TransactionsIgnoreBankRequest]
421
+ # @option request_options [String] :base_url
422
+ # @option request_options [Hash{String => Object}] :additional_headers
423
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
424
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
425
+ # @option request_options [Integer] :timeout_in_seconds
426
+ #
427
+ # @return [Nordlet::Bank::Types::TransactionsIgnoreBankResponse]
428
+ def transactions_ignore(request_options: {}, **params)
429
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
430
+ request = Nordlet::Internal::JSON::Request.new(
431
+ base_url: request_options[:base_url],
432
+ method: "POST",
433
+ path: "v1/bank/transactions/ignore",
434
+ body: Nordlet::Bank::Types::TransactionsIgnoreBankRequest.new(params).to_h,
435
+ request_options: request_options
436
+ )
437
+ begin
438
+ response = @client.send(request)
439
+ rescue Net::HTTPRequestTimeout
440
+ raise Nordlet::Errors::TimeoutError
441
+ end
442
+ code = response.code.to_i
443
+ if code.between?(200, 299)
444
+ Nordlet::Bank::Types::TransactionsIgnoreBankResponse.load(response.body)
445
+ else
446
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
447
+ raise error_class.new(response.body, code: code)
448
+ end
449
+ end
450
+
451
+ # Return an ignored bank transaction to status new and clear its reason. Answers 409 when the line is not ignored.
452
+ #
453
+ # @param request_options [Hash]
454
+ # @param params [Nordlet::Bank::Types::TransactionsUnignoreBankRequest]
455
+ # @option request_options [String] :base_url
456
+ # @option request_options [Hash{String => Object}] :additional_headers
457
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
458
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
459
+ # @option request_options [Integer] :timeout_in_seconds
460
+ #
461
+ # @return [Nordlet::Bank::Types::TransactionsUnignoreBankResponse]
462
+ def transactions_unignore(request_options: {}, **params)
463
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
464
+ request = Nordlet::Internal::JSON::Request.new(
465
+ base_url: request_options[:base_url],
466
+ method: "POST",
467
+ path: "v1/bank/transactions/unignore",
468
+ body: Nordlet::Bank::Types::TransactionsUnignoreBankRequest.new(params).to_h,
469
+ request_options: request_options
470
+ )
471
+ begin
472
+ response = @client.send(request)
473
+ rescue Net::HTTPRequestTimeout
474
+ raise Nordlet::Errors::TimeoutError
475
+ end
476
+ code = response.code.to_i
477
+ if code.between?(200, 299)
478
+ Nordlet::Bank::Types::TransactionsUnignoreBankResponse.load(response.body)
479
+ else
480
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
481
+ raise error_class.new(response.body, code: code)
482
+ end
483
+ end
484
+
485
+ # Compare a bank account's statement balance with its ledger balance on `date`. The statement balance is
486
+ # `statementBalance` when given, else the latest closing balance kept from an imported statement on or before
487
+ # `date` (`statementClosingDate`) plus the lines on the account dated after it up to `date`. The ledger balance is
488
+ # the posted balance of the bank account's ledger account up to `date`, in the account currency (for an account in
489
+ # another currency than the company's, the sum of the entries' currency amounts in that currency). `difference` is
490
+ # the statement balance less the ledger balance. `unbookedLines` are the lines up to `date` still in status new
491
+ # (at most 1000; `unbookedCount` and `unbookedTotal` cover all of them). Answers 404 when the bank account does
492
+ # not exist.
493
+ #
494
+ # @param request_options [Hash]
495
+ # @param params [Nordlet::Bank::Types::ReconciliationGetBankRequest]
496
+ # @option request_options [String] :base_url
497
+ # @option request_options [Hash{String => Object}] :additional_headers
498
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
499
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
500
+ # @option request_options [Integer] :timeout_in_seconds
501
+ #
502
+ # @return [Nordlet::Bank::Types::ReconciliationGetBankResponse]
503
+ def reconciliation_get(request_options: {}, **params)
504
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
505
+ request = Nordlet::Internal::JSON::Request.new(
506
+ base_url: request_options[:base_url],
507
+ method: "POST",
508
+ path: "v1/bank/reconciliation/get",
509
+ body: Nordlet::Bank::Types::ReconciliationGetBankRequest.new(params).to_h,
510
+ request_options: request_options
511
+ )
512
+ begin
513
+ response = @client.send(request)
514
+ rescue Net::HTTPRequestTimeout
515
+ raise Nordlet::Errors::TimeoutError
516
+ end
517
+ code = response.code.to_i
518
+ if code.between?(200, 299)
519
+ Nordlet::Bank::Types::ReconciliationGetBankResponse.load(response.body)
520
+ else
521
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
522
+ raise error_class.new(response.body, code: code)
523
+ end
524
+ end
525
+
355
526
  # Record a payment that is on no imported statement: inserts a bank transaction on the account dated `date`
356
- # (positive for a sale invoice, negative for a purchase invoice or payroll run, in the account currency) and
357
- # matches it to the document with the checks, posting and `sale_invoice.paid` or `purchase_invoice.paid` event of
358
- # `bank/transactions/match`.
527
+ # (`amount` is always positive, in the account currency: money received for a sale invoice, money paid out for a
528
+ # purchase invoice or payroll run) and matches it to the document with the checks, posting and `sale_invoice.paid`
529
+ # or `purchase_invoice.paid` event of `bank/transactions/match`.
359
530
  #
360
531
  # @param request_options [Hash]
361
532
  # @param params [Nordlet::Bank::Types::TransactionsRecordBankRequest]
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Bank
5
+ module Types
6
+ class ReconciliationGetBankRequest < Internal::Types::Model
7
+ field :bank_account_id, -> { String }, optional: false, nullable: false, api_name: "bankAccountId"
8
+
9
+ field :date, -> { String }, optional: false, nullable: false
10
+
11
+ field :statement_balance, -> { String }, optional: true, nullable: false, api_name: "statementBalance"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Bank
5
+ module Types
6
+ class ReconciliationGetBankResponse < Internal::Types::Model
7
+ field :bank_account_id, -> { String }, optional: false, nullable: false, api_name: "bankAccountId"
8
+
9
+ field :account_code, -> { String }, optional: false, nullable: false, api_name: "accountCode"
10
+
11
+ field :currency, -> { String }, optional: false, nullable: false
12
+
13
+ field :date, -> { String }, optional: false, nullable: false
14
+
15
+ field :statement_balance, -> { String }, optional: false, nullable: true, api_name: "statementBalance"
16
+
17
+ field :statement_balance_source, -> { Nordlet::Bank::Types::ReconciliationGetBankResponseStatementBalanceSource }, optional: false, nullable: true, api_name: "statementBalanceSource"
18
+
19
+ field :statement_closing_date, -> { String }, optional: false, nullable: true, api_name: "statementClosingDate"
20
+
21
+ field :ledger_balance, -> { String }, optional: false, nullable: false, api_name: "ledgerBalance"
22
+
23
+ field :difference, -> { String }, optional: false, nullable: true
24
+
25
+ field :unbooked_count, -> { Integer }, optional: false, nullable: false, api_name: "unbookedCount"
26
+
27
+ field :unbooked_total, -> { String }, optional: false, nullable: false, api_name: "unbookedTotal"
28
+
29
+ field :unbooked_lines, -> { Internal::Types::Array[Nordlet::Bank::Types::ReconciliationGetBankResponseUnbookedLinesItem] }, optional: false, nullable: false, api_name: "unbookedLines"
30
+
31
+ field :warnings, -> { Internal::Types::Array[String] }, optional: false, nullable: false
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Bank
5
+ module Types
6
+ module ReconciliationGetBankResponseStatementBalanceSource
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ REQUEST = "request"
10
+ STATEMENT = "statement"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Bank
5
+ module Types
6
+ class ReconciliationGetBankResponseUnbookedLinesItem < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :bank_account_id, -> { String }, optional: false, nullable: false, api_name: "bankAccountId"
10
+
11
+ field :date, -> { String }, optional: false, nullable: false
12
+
13
+ field :amount, -> { String }, optional: false, nullable: false
14
+
15
+ field :currency, -> { String }, optional: false, nullable: false
16
+
17
+ field :counterparty_name, -> { String }, optional: false, nullable: true, api_name: "counterpartyName"
18
+
19
+ field :counterparty_iban, -> { String }, optional: false, nullable: true, api_name: "counterpartyIban"
20
+
21
+ field :partner_id, -> { String }, optional: false, nullable: true, api_name: "partnerId"
22
+
23
+ field :partner_name, -> { String }, optional: false, nullable: true, api_name: "partnerName"
24
+
25
+ field :description, -> { String }, optional: false, nullable: true
26
+
27
+ field :external_id, -> { String }, optional: false, nullable: true, api_name: "externalId"
28
+
29
+ field :status, -> { Nordlet::Bank::Types::ReconciliationGetBankResponseUnbookedLinesItemStatus }, optional: false, nullable: false
30
+
31
+ field :matched_document_type, -> { String }, optional: false, nullable: true, api_name: "matchedDocumentType"
32
+
33
+ field :matched_document_id, -> { String }, optional: false, nullable: true, api_name: "matchedDocumentId"
34
+
35
+ field :journal_transaction_id, -> { String }, optional: false, nullable: true, api_name: "journalTransactionId"
36
+
37
+ field :ignore_reason, -> { String }, optional: false, nullable: true, api_name: "ignoreReason"
38
+
39
+ field :created_at, -> { String }, optional: false, nullable: false, api_name: "createdAt"
40
+ end
41
+ end
42
+ end
43
+ end