nordlet 0.5.4 → 0.5.6

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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nordlet/account/client.rb +125 -0
  3. data/lib/nordlet/account/types/login_link_request_account_request.rb +2 -0
  4. data/lib/nordlet/account/types/login_link_request_account_request_app.rb +13 -0
  5. data/lib/nordlet/agreements/client.rb +49 -0
  6. data/lib/nordlet/assets/client.rb +42 -0
  7. data/lib/nordlet/audit/client.rb +4 -0
  8. data/lib/nordlet/bank/client.rb +218 -0
  9. data/lib/nordlet/billing/client.rb +45 -0
  10. data/lib/nordlet/calendar/client.rb +18 -0
  11. data/lib/nordlet/capture/client.rb +33 -0
  12. data/lib/nordlet/cash/client.rb +36 -0
  13. data/lib/nordlet/catalog/client.rb +77 -0
  14. data/lib/nordlet/consolidation/client.rb +29 -0
  15. data/lib/nordlet/declarations/client.rb +209 -0
  16. data/lib/nordlet/document_series/client.rb +20 -0
  17. data/lib/nordlet/ecommerce/client.rb +41 -0
  18. data/lib/nordlet/files/client.rb +10 -0
  19. data/lib/nordlet/fleet/client.rb +26 -0
  20. data/lib/nordlet/hr/client.rb +93 -0
  21. data/lib/nordlet/inventory/client.rb +91 -0
  22. data/lib/nordlet/leads/client.rb +49 -0
  23. data/lib/nordlet/ledger/client.rb +74 -0
  24. data/lib/nordlet/officers/client.rb +8 -0
  25. data/lib/nordlet/operation_types/client.rb +20 -0
  26. data/lib/nordlet/partners/client.rb +239 -0
  27. data/lib/nordlet/partners/types/debt_reminders_list_partners_response_rows_item.rb +2 -0
  28. data/lib/nordlet/partners/types/debt_reminders_list_partners_response_rows_item_kind.rb +14 -0
  29. data/lib/nordlet/partners/types/debt_reminders_settings_get_partners_request.rb +9 -0
  30. data/lib/nordlet/partners/types/debt_reminders_settings_get_partners_response.rb +13 -0
  31. data/lib/nordlet/partners/types/debt_reminders_settings_update_partners_request.rb +13 -0
  32. data/lib/nordlet/partners/types/debt_reminders_settings_update_partners_response.rb +13 -0
  33. data/lib/nordlet/partners/types/debt_reminders_upcoming_partners_request.rb +9 -0
  34. data/lib/nordlet/partners/types/debt_reminders_upcoming_partners_response.rb +11 -0
  35. data/lib/nordlet/partners/types/debt_reminders_upcoming_partners_response_rows_item.rb +27 -0
  36. data/lib/nordlet/partners/types/debt_reminders_upcoming_partners_response_rows_item_kind.rb +14 -0
  37. data/lib/nordlet/payroll/client.rb +62 -0
  38. data/lib/nordlet/peppol/client.rb +7 -0
  39. data/lib/nordlet/platform_sellers/client.rb +13 -0
  40. data/lib/nordlet/pos/client.rb +46 -0
  41. data/lib/nordlet/production/client.rb +78 -0
  42. data/lib/nordlet/projects/client.rb +35 -0
  43. data/lib/nordlet/public/client.rb +9 -0
  44. data/lib/nordlet/purchases/client.rb +102 -0
  45. data/lib/nordlet/reference/client.rb +74 -0
  46. data/lib/nordlet/reports/client.rb +108 -0
  47. data/lib/nordlet/sales/client.rb +408 -0
  48. data/lib/nordlet/sales/types/invoices_apply_advance_sales_response.rb +4 -0
  49. data/lib/nordlet/sales/types/invoices_create_sales_request.rb +2 -0
  50. data/lib/nordlet/sales/types/invoices_create_sales_request_locale.rb +15 -0
  51. data/lib/nordlet/sales/types/invoices_create_sales_response.rb +4 -0
  52. data/lib/nordlet/sales/types/invoices_get_sales_response.rb +4 -0
  53. data/lib/nordlet/sales/types/invoices_issue_sales_response.rb +4 -0
  54. data/lib/nordlet/sales/types/invoices_list_sales_response_rows_item.rb +4 -0
  55. data/lib/nordlet/sales/types/invoices_lock_sales_response.rb +4 -0
  56. data/lib/nordlet/sales/types/invoices_unlock_sales_response.rb +4 -0
  57. data/lib/nordlet/sales/types/invoices_update_sales_request.rb +2 -0
  58. data/lib/nordlet/sales/types/invoices_update_sales_request_locale.rb +15 -0
  59. data/lib/nordlet/sales/types/invoices_update_sales_response.rb +4 -0
  60. data/lib/nordlet/sales/types/recurring_invoices_create_sales_request.rb +29 -0
  61. data/lib/nordlet/sales/types/recurring_invoices_create_sales_request_frequency.rb +16 -0
  62. data/lib/nordlet/sales/types/recurring_invoices_create_sales_request_locale.rb +15 -0
  63. data/lib/nordlet/sales/types/recurring_invoices_create_sales_response.rb +51 -0
  64. data/lib/nordlet/sales/types/recurring_invoices_create_sales_response_frequency.rb +16 -0
  65. data/lib/nordlet/sales/types/recurring_invoices_create_sales_response_status.rb +15 -0
  66. data/lib/nordlet/sales/types/recurring_invoices_delete_sales_request.rb +11 -0
  67. data/lib/nordlet/sales/types/recurring_invoices_delete_sales_response.rb +11 -0
  68. data/lib/nordlet/sales/types/recurring_invoices_generate_sales_request.rb +11 -0
  69. data/lib/nordlet/sales/types/recurring_invoices_generate_sales_response.rb +21 -0
  70. data/lib/nordlet/sales/types/recurring_invoices_generate_sales_response_recurring_invoice.rb +51 -0
  71. data/lib/nordlet/sales/types/recurring_invoices_generate_sales_response_recurring_invoice_frequency.rb +16 -0
  72. data/lib/nordlet/sales/types/recurring_invoices_generate_sales_response_recurring_invoice_status.rb +15 -0
  73. data/lib/nordlet/sales/types/recurring_invoices_get_sales_request.rb +11 -0
  74. data/lib/nordlet/sales/types/recurring_invoices_get_sales_response.rb +51 -0
  75. data/lib/nordlet/sales/types/recurring_invoices_get_sales_response_frequency.rb +16 -0
  76. data/lib/nordlet/sales/types/recurring_invoices_get_sales_response_status.rb +15 -0
  77. data/lib/nordlet/sales/types/recurring_invoices_list_sales_request.rb +19 -0
  78. data/lib/nordlet/sales/types/recurring_invoices_list_sales_request_filter_item.rb +15 -0
  79. data/lib/nordlet/sales/types/recurring_invoices_list_sales_request_filter_item_op.rb +18 -0
  80. data/lib/nordlet/sales/types/recurring_invoices_list_sales_request_filter_item_value.rb +19 -0
  81. data/lib/nordlet/sales/types/recurring_invoices_list_sales_request_filter_item_value_three_item.rb +15 -0
  82. data/lib/nordlet/sales/types/recurring_invoices_list_sales_request_sort_item.rb +13 -0
  83. data/lib/nordlet/sales/types/recurring_invoices_list_sales_request_sort_item_dir.rb +14 -0
  84. data/lib/nordlet/sales/types/recurring_invoices_list_sales_response.rb +21 -0
  85. data/lib/nordlet/sales/types/recurring_invoices_list_sales_response_rows_item.rb +51 -0
  86. data/lib/nordlet/sales/types/recurring_invoices_list_sales_response_rows_item_frequency.rb +16 -0
  87. data/lib/nordlet/sales/types/recurring_invoices_list_sales_response_rows_item_status.rb +15 -0
  88. data/lib/nordlet/sales/types/recurring_invoices_run_sales_request.rb +11 -0
  89. data/lib/nordlet/sales/types/recurring_invoices_run_sales_response.rb +13 -0
  90. data/lib/nordlet/sales/types/recurring_invoices_run_sales_response_errors_item.rb +13 -0
  91. data/lib/nordlet/sales/types/recurring_invoices_run_sales_response_generated_item.rb +19 -0
  92. data/lib/nordlet/sales/types/recurring_invoices_update_sales_request.rb +35 -0
  93. data/lib/nordlet/sales/types/recurring_invoices_update_sales_request_frequency.rb +16 -0
  94. data/lib/nordlet/sales/types/recurring_invoices_update_sales_request_locale.rb +15 -0
  95. data/lib/nordlet/sales/types/recurring_invoices_update_sales_request_status.rb +14 -0
  96. data/lib/nordlet/sales/types/recurring_invoices_update_sales_response.rb +51 -0
  97. data/lib/nordlet/sales/types/recurring_invoices_update_sales_response_frequency.rb +16 -0
  98. data/lib/nordlet/sales/types/recurring_invoices_update_sales_response_status.rb +15 -0
  99. data/lib/nordlet/transport/client.rb +20 -0
  100. data/lib/nordlet/version.rb +1 -1
  101. data/lib/nordlet/webhooks/client.rb +20 -0
  102. data/lib/nordlet/webhooks/types/subscriptions_create_webhooks_request_events_item.rb +1 -0
  103. data/lib/nordlet/webhooks/types/subscriptions_update_webhooks_request_events_item.rb +1 -0
  104. data/lib/nordlet.rb +51 -0
  105. data/reference.md +11974 -2959
  106. metadata +53 -2
@@ -10,6 +10,15 @@ module Nordlet
10
10
  @client = client
11
11
  end
12
12
 
13
+ # Create an operation type: a `code` with the flags that say what it is for (`isSale`, `isPurchase`, ...), an
14
+ # optional `invoiceType` (`invoice`, `credit_note`, `proforma`, `advance`) and optional account codes. An invoice
15
+ # names it in `operationTypeId`: a sale invoice needs `isSale` and a matching `invoiceType`, a purchase invoice
16
+ # `isPurchase`, and the type's account codes then replace the default posting accounts when the invoice is issued
17
+ # (`sales/invoices/issue`) or registered (`purchases/invoices/register`). `includeInVatRegister: false` keeps the
18
+ # type's invoices out of the Lithuanian i.SAF and FR0600, `includeInSaft: false` out of the SAF-T file. Account
19
+ # codes must exist and be postable and `payerPartnerId` must be an active partner (422 otherwise); a repeated
20
+ # `code` is refused with 409.
21
+ #
13
22
  # @param request_options [Hash]
14
23
  # @param params [Nordlet::OperationTypes::Types::CreateOperationTypesRequest]
15
24
  # @option request_options [String] :base_url
@@ -42,6 +51,9 @@ module Nordlet
42
51
  end
43
52
  end
44
53
 
54
+ # Change an operation type's fields; omitted ones keep their value. A `code` already used by another type is
55
+ # refused with 409, a body without changes with 400.
56
+ #
45
57
  # @param request_options [Hash]
46
58
  # @param params [Nordlet::OperationTypes::Types::UpdateOperationTypesRequest]
47
59
  # @option request_options [String] :base_url
@@ -74,6 +86,8 @@ module Nordlet
74
86
  end
75
87
  end
76
88
 
89
+ # Read one operation type.
90
+ #
77
91
  # @param request_options [Hash]
78
92
  # @param params [Nordlet::OperationTypes::Types::GetOperationTypesRequest]
79
93
  # @option request_options [String] :base_url
@@ -106,6 +120,9 @@ module Nordlet
106
120
  end
107
121
  end
108
122
 
123
+ # Delete an operation type that no sale invoice, purchase invoice or document series refers to. Otherwise the call
124
+ # is refused with 409; deactivate the type with `operation-types/update` instead.
125
+ #
109
126
  # @param request_options [Hash]
110
127
  # @param params [Nordlet::OperationTypes::Types::DeleteOperationTypesRequest]
111
128
  # @option request_options [String] :base_url
@@ -138,6 +155,9 @@ module Nordlet
138
155
  end
139
156
  end
140
157
 
158
+ # List operation types. Filterable by `code`, `name`, `isSale`, `isPurchase` and `isActive`; sortable by `code`,
159
+ # `name`, `sortOrder` and `createdAt`.
160
+ #
141
161
  # @param request_options [Hash]
142
162
  # @param params [Nordlet::OperationTypes::Types::ListOperationTypesRequest]
143
163
  # @option request_options [String] :base_url
@@ -10,6 +10,8 @@ module Nordlet
10
10
  @client = client
11
11
  end
12
12
 
13
+ # Adds an address of type billing, shipping, registered or other to the partner in `partnerId`.
14
+ #
13
15
  # @param request_options [Hash]
14
16
  # @param params [Nordlet::Partners::Types::AddressesCreatePartnersRequest]
15
17
  # @option request_options [String] :base_url
@@ -42,6 +44,8 @@ module Nordlet
42
44
  end
43
45
  end
44
46
 
47
+ # Changes the given fields of a partner address.
48
+ #
45
49
  # @param request_options [Hash]
46
50
  # @param params [Nordlet::Partners::Types::AddressesUpdatePartnersRequest]
47
51
  # @option request_options [String] :base_url
@@ -74,6 +78,8 @@ module Nordlet
74
78
  end
75
79
  end
76
80
 
81
+ # Deletes a partner address.
82
+ #
77
83
  # @param request_options [Hash]
78
84
  # @param params [Nordlet::Partners::Types::AddressesDeletePartnersRequest]
79
85
  # @option request_options [String] :base_url
@@ -106,6 +112,8 @@ module Nordlet
106
112
  end
107
113
  end
108
114
 
115
+ # Lists partner addresses; filterable by `partnerId`, `type` and `city`, sortable by `createdAt`.
116
+ #
109
117
  # @param request_options [Hash]
110
118
  # @param params [Nordlet::Partners::Types::AddressesListPartnersRequest]
111
119
  # @option request_options [String] :base_url
@@ -138,6 +146,8 @@ module Nordlet
138
146
  end
139
147
  end
140
148
 
149
+ # Adds a contact person to the partner in `partnerId`.
150
+ #
141
151
  # @param request_options [Hash]
142
152
  # @param params [Nordlet::Partners::Types::ContactsCreatePartnersRequest]
143
153
  # @option request_options [String] :base_url
@@ -170,6 +180,8 @@ module Nordlet
170
180
  end
171
181
  end
172
182
 
183
+ # Changes the given fields of a partner contact.
184
+ #
173
185
  # @param request_options [Hash]
174
186
  # @param params [Nordlet::Partners::Types::ContactsUpdatePartnersRequest]
175
187
  # @option request_options [String] :base_url
@@ -202,6 +214,8 @@ module Nordlet
202
214
  end
203
215
  end
204
216
 
217
+ # Deletes a partner contact.
218
+ #
205
219
  # @param request_options [Hash]
206
220
  # @param params [Nordlet::Partners::Types::ContactsDeletePartnersRequest]
207
221
  # @option request_options [String] :base_url
@@ -234,6 +248,8 @@ module Nordlet
234
248
  end
235
249
  end
236
250
 
251
+ # Lists partner contacts; filterable by `partnerId`, `name` and `email`, sortable by `createdAt`.
252
+ #
237
253
  # @param request_options [Hash]
238
254
  # @param params [Nordlet::Partners::Types::ContactsListPartnersRequest]
239
255
  # @option request_options [String] :base_url
@@ -266,6 +282,10 @@ module Nordlet
266
282
  end
267
283
  end
268
284
 
285
+ # Adds a bank account to the partner in `partnerId`. The IBAN is stored without spaces in upper case; an IBAN the
286
+ # partner already has is refused with 409. With `isDefault` true the partner's other accounts lose their default
287
+ # mark.
288
+ #
269
289
  # @param request_options [Hash]
270
290
  # @param params [Nordlet::Partners::Types::BankAccountsCreatePartnersRequest]
271
291
  # @option request_options [String] :base_url
@@ -298,6 +318,10 @@ module Nordlet
298
318
  end
299
319
  end
300
320
 
321
+ # Changes the given fields of a partner bank account. A new IBAN is stored without spaces in upper case and is
322
+ # refused with 409 when the partner already has it; when the account is the default after the change, the
323
+ # partner's other accounts lose their default mark.
324
+ #
301
325
  # @param request_options [Hash]
302
326
  # @param params [Nordlet::Partners::Types::BankAccountsUpdatePartnersRequest]
303
327
  # @option request_options [String] :base_url
@@ -330,6 +354,8 @@ module Nordlet
330
354
  end
331
355
  end
332
356
 
357
+ # Deletes a partner bank account.
358
+ #
333
359
  # @param request_options [Hash]
334
360
  # @param params [Nordlet::Partners::Types::BankAccountsDeletePartnersRequest]
335
361
  # @option request_options [String] :base_url
@@ -362,6 +388,8 @@ module Nordlet
362
388
  end
363
389
  end
364
390
 
391
+ # Lists partner bank accounts; filterable by `partnerId` and `iban`, sortable by `createdAt`.
392
+ #
365
393
  # @param request_options [Hash]
366
394
  # @param params [Nordlet::Partners::Types::BankAccountsListPartnersRequest]
367
395
  # @option request_options [String] :base_url
@@ -394,6 +422,9 @@ module Nordlet
394
422
  end
395
423
  end
396
424
 
425
+ # Lists the files attached to a partner, newest first. `partners/create` attaches one with `documentRef`, and
426
+ # `leads/convert` moves the lead's files here.
427
+ #
397
428
  # @param request_options [Hash]
398
429
  # @param params [Nordlet::Partners::Types::FilesListPartnersRequest]
399
430
  # @option request_options [String] :base_url
@@ -426,6 +457,14 @@ module Nordlet
426
457
  end
427
458
  end
428
459
 
460
+ # Runs the overdue selection of the daily debt-reminder job for this company as of the company's current date and
461
+ # returns the overdue reminders it would send, without sending or recording anything. A partner is included when
462
+ # it has `autoDebtReminder`, is active, has an e-mail address, got no overdue reminder in the last `repeatDays`
463
+ # days (`partners/debt-reminders/settings/get`) and has issued invoices or advance invoices past their due date
464
+ # with an unpaid remainder; the interest per invoice is the remainder times the partner's `lateInterestPercent`
465
+ # times the days late over 365, and the totals are per currency. Sent reminders are listed by
466
+ # `partners/debt-reminders/list`.
467
+ #
429
468
  # @param request_options [Hash]
430
469
  # @param params [Nordlet::Partners::Types::DebtRemindersPreviewPartnersRequest]
431
470
  # @option request_options [String] :base_url
@@ -458,6 +497,9 @@ module Nordlet
458
497
  end
459
498
  end
460
499
 
500
+ # Lists the debt reminders the daily job has sent, one row per partner and currency with the ids of the invoices
501
+ # it covered and its `kind` (`before_due` or `overdue`); filterable by `partnerId`, sortable by `sentAt`.
502
+ #
461
503
  # @param request_options [Hash]
462
504
  # @param params [Nordlet::Partners::Types::DebtRemindersListPartnersRequest]
463
505
  # @option request_options [String] :base_url
@@ -490,6 +532,126 @@ module Nordlet
490
532
  end
491
533
  end
492
534
 
535
+ # Returns the debt-reminder schedule of the company: `daysBefore`, the days before the due date on which the first
536
+ # reminder is sent (null when no reminder is sent before the due date), and `repeatDays`, the days between overdue
537
+ # reminders to a partner.
538
+ #
539
+ # @param request_options [Hash]
540
+ # @param params [Nordlet::Partners::Types::DebtRemindersSettingsGetPartnersRequest]
541
+ # @option request_options [String] :base_url
542
+ # @option request_options [Hash{String => Object}] :additional_headers
543
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
544
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
545
+ # @option request_options [Integer] :timeout_in_seconds
546
+ #
547
+ # @return [Nordlet::Partners::Types::DebtRemindersSettingsGetPartnersResponse]
548
+ def debt_reminders_settings_get(request_options: {}, **params)
549
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
550
+ request = Nordlet::Internal::JSON::Request.new(
551
+ base_url: request_options[:base_url],
552
+ method: "POST",
553
+ path: "v1/partners/debt-reminders/settings/get",
554
+ body: Nordlet::Partners::Types::DebtRemindersSettingsGetPartnersRequest.new(params).to_h,
555
+ request_options: request_options
556
+ )
557
+ begin
558
+ response = @client.send(request)
559
+ rescue Net::HTTPRequestTimeout
560
+ raise Nordlet::Errors::TimeoutError
561
+ end
562
+ code = response.code.to_i
563
+ if code.between?(200, 299)
564
+ Nordlet::Partners::Types::DebtRemindersSettingsGetPartnersResponse.load(response.body)
565
+ else
566
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
567
+ raise error_class.new(response.body, code: code)
568
+ end
569
+ end
570
+
571
+ # Changes the given fields of the company's debt-reminder schedule. `daysBefore` (1 to 90, or null to send nothing
572
+ # before the due date) makes the daily job send one "payment due soon" reminder per invoice that many days before
573
+ # its due date; `repeatDays` (1 to 90) is the number of days between overdue reminders to a partner. Only partners
574
+ # with `autoDebtReminder` get reminders. A body without fields is refused with 400.
575
+ #
576
+ # @param request_options [Hash]
577
+ # @param params [Nordlet::Partners::Types::DebtRemindersSettingsUpdatePartnersRequest]
578
+ # @option request_options [String] :base_url
579
+ # @option request_options [Hash{String => Object}] :additional_headers
580
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
581
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
582
+ # @option request_options [Integer] :timeout_in_seconds
583
+ #
584
+ # @return [Nordlet::Partners::Types::DebtRemindersSettingsUpdatePartnersResponse]
585
+ def debt_reminders_settings_update(request_options: {}, **params)
586
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
587
+ request = Nordlet::Internal::JSON::Request.new(
588
+ base_url: request_options[:base_url],
589
+ method: "POST",
590
+ path: "v1/partners/debt-reminders/settings/update",
591
+ body: Nordlet::Partners::Types::DebtRemindersSettingsUpdatePartnersRequest.new(params).to_h,
592
+ request_options: request_options
593
+ )
594
+ begin
595
+ response = @client.send(request)
596
+ rescue Net::HTTPRequestTimeout
597
+ raise Nordlet::Errors::TimeoutError
598
+ end
599
+ code = response.code.to_i
600
+ if code.between?(200, 299)
601
+ Nordlet::Partners::Types::DebtRemindersSettingsUpdatePartnersResponse.load(response.body)
602
+ else
603
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
604
+ raise error_class.new(response.body, code: code)
605
+ end
606
+ end
607
+
608
+ # Returns the next reminder the daily debt-reminder job would send for each unpaid issued invoice or advance
609
+ # invoice of the partners that get reminders (`autoDebtReminder`, active, with an e-mail address), as of the
610
+ # company's current date and sorted by `date`. A `before_due` reminder is sent once per invoice, `daysBefore` days
611
+ # before its due date or on the first daily run after that while the due date is still ahead; `overdue` reminders
612
+ # start the day after the due date and repeat every `repeatDays` days per partner, counting only overdue
613
+ # reminders. Nothing is sent or recorded.
614
+ #
615
+ # @param request_options [Hash]
616
+ # @param params [Nordlet::Partners::Types::DebtRemindersUpcomingPartnersRequest]
617
+ # @option request_options [String] :base_url
618
+ # @option request_options [Hash{String => Object}] :additional_headers
619
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
620
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
621
+ # @option request_options [Integer] :timeout_in_seconds
622
+ #
623
+ # @return [Nordlet::Partners::Types::DebtRemindersUpcomingPartnersResponse]
624
+ def debt_reminders_upcoming(request_options: {}, **params)
625
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
626
+ request = Nordlet::Internal::JSON::Request.new(
627
+ base_url: request_options[:base_url],
628
+ method: "POST",
629
+ path: "v1/partners/debt-reminders/upcoming",
630
+ body: Nordlet::Partners::Types::DebtRemindersUpcomingPartnersRequest.new(params).to_h,
631
+ request_options: request_options
632
+ )
633
+ begin
634
+ response = @client.send(request)
635
+ rescue Net::HTTPRequestTimeout
636
+ raise Nordlet::Errors::TimeoutError
637
+ end
638
+ code = response.code.to_i
639
+ if code.between?(200, 299)
640
+ Nordlet::Partners::Types::DebtRemindersUpcomingPartnersResponse.load(response.body)
641
+ else
642
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
643
+ raise error_class.new(response.body, code: code)
644
+ end
645
+ end
646
+
647
+ # Checks a VAT number against VIES, either a free `vatCode` or the VAT code of the partner in `partnerId` (exactly
648
+ # one of the two); a code without an EU country prefix and 2 to 12 alphanumeric characters is refused with 422, as
649
+ # is a partner without a VAT code, and a VIES outage answers 503. With a partner the outcome is written to it
650
+ # (`vatValid`, `vatValidatedAt`): an invalid number or a VIES name that shares no word with the partner's name
651
+ # opens or refreshes the partner's VAT review (`vat_review.opened`), a VIES failure opens one with reason
652
+ # `service_error`, and a valid matching number resolves the open review as `revalidated` (`vat_review.resolved`).
653
+ # Reviews are listed and closed with `partners/vat-reviews/list` and `partners/vat-reviews/resolve`.
654
+ #
493
655
  # @param request_options [Hash]
494
656
  # @param params [Nordlet::Partners::Types::ValidateVatPartnersRequest]
495
657
  # @option request_options [String] :base_url
@@ -522,6 +684,9 @@ module Nordlet
522
684
  end
523
685
  end
524
686
 
687
+ # Lists the VAT reviews opened by VIES checks of partners' VAT codes, with reason `invalid`, `name_mismatch` or
688
+ # `service_error`; filterable by `partnerId`, `status` and `reason`, sortable by `createdAt`.
689
+ #
525
690
  # @param request_options [Hash]
526
691
  # @param params [Nordlet::Partners::Types::VatReviewsListPartnersRequest]
527
692
  # @option request_options [String] :base_url
@@ -554,6 +719,11 @@ module Nordlet
554
719
  end
555
720
  end
556
721
 
722
+ # Closes an open VAT review as `confirmed_valid`, `confirmed_invalid` or `dismissed`, with an optional note. The
723
+ # first two also set the partner's `vatValid` and stamp `vatValidatedAt` when the partner still carries the
724
+ # reviewed VAT code; `dismissed` leaves the partner unchanged. A review that is already resolved answers 409;
725
+ # emits `vat_review.resolved`.
726
+ #
557
727
  # @param request_options [Hash]
558
728
  # @param params [Nordlet::Partners::Types::VatReviewsResolvePartnersRequest]
559
729
  # @option request_options [String] :base_url
@@ -586,6 +756,14 @@ module Nordlet
586
756
  end
587
757
  end
588
758
 
759
+ # Creates a partner. `groupId`, `statusId` and `priceListId` must belong to the company; without
760
+ # `legalCountryClass` the class is derived from the address country (`lt`, `eu` or `non_eu`); `documentRef`
761
+ # attaches an uploaded file that is not yet linked to a record; a `code` already used by a live partner of the
762
+ # company is refused with 409. A `vatCode` is checked against VIES at once and the result stored on the partner:
763
+ # an invalid number, a VIES name that shares no word with the partner's name, or a VIES failure opens a VAT review
764
+ # (`vat_review.opened`), while a code that is not an EU VAT number is stored unchecked (see
765
+ # `partners/validate-vat`).
766
+ #
589
767
  # @param request_options [Hash]
590
768
  # @param params [Nordlet::Partners::Types::CreatePartnersRequest]
591
769
  # @option request_options [String] :base_url
@@ -618,6 +796,10 @@ module Nordlet
618
796
  end
619
797
  end
620
798
 
799
+ # Returns the live partner matched by `code`, then `vatCode`, then `email` (at least one is required), or creates
800
+ # one from the body with the same validation and VIES check as `partners/create`; `created` says which happened. A
801
+ # creation that loses a race on the partner code returns the partner the other call created.
802
+ #
621
803
  # @param request_options [Hash]
622
804
  # @param params [Nordlet::Partners::Types::FindOrCreatePartnersRequest]
623
805
  # @option request_options [String] :base_url
@@ -650,6 +832,8 @@ module Nordlet
650
832
  end
651
833
  end
652
834
 
835
+ # Returns one partner; a deleted partner answers 404.
836
+ #
653
837
  # @param request_options [Hash]
654
838
  # @param params [Nordlet::Partners::Types::GetPartnersRequest]
655
839
  # @option request_options [String] :base_url
@@ -682,6 +866,12 @@ module Nordlet
682
866
  end
683
867
  end
684
868
 
869
+ # Changes the given fields of a partner; the clearable fields accept null. A new address country re-derives
870
+ # `legalCountryClass` unless the class is given, and a `code` already used by another live partner of the company
871
+ # is refused with 409. A changed `vatCode` resets the VIES result and is checked at once as in `partners/create`;
872
+ # a removed code, or one that is not an EU VAT number, resolves the partner's open VAT review as `superseded`
873
+ # (`vat_review.resolved`).
874
+ #
685
875
  # @param request_options [Hash]
686
876
  # @param params [Nordlet::Partners::Types::UpdatePartnersRequest]
687
877
  # @option request_options [String] :base_url
@@ -714,6 +904,8 @@ module Nordlet
714
904
  end
715
905
  end
716
906
 
907
+ # Marks a partner as deleted; it no longer appears in lists or lookups.
908
+ #
717
909
  # @param request_options [Hash]
718
910
  # @param params [Nordlet::Partners::Types::DeletePartnersRequest]
719
911
  # @option request_options [String] :base_url
@@ -746,6 +938,13 @@ module Nordlet
746
938
  end
747
939
  end
748
940
 
941
+ # Moves every row that references the duplicate `sourceId` through a foreign key to partners (looked up in the
942
+ # database catalogue, within the company) to `targetId`, then marks the source partner as deleted; `moved` lists
943
+ # the tables, columns and row counts. Merging a partner into itself is 422, and when both partners hold the same
944
+ # unique entry (for example the same IBAN or item supplier row) the merge is refused with 409 until it is removed
945
+ # from one of them. When the kept partner has an open VAT review, the duplicate's open review is resolved as
946
+ # `superseded` (`vat_review.resolved`).
947
+ #
749
948
  # @param request_options [Hash]
750
949
  # @param params [Nordlet::Partners::Types::MergePartnersRequest]
751
950
  # @option request_options [String] :base_url
@@ -814,6 +1013,10 @@ module Nordlet
814
1013
  end
815
1014
  end
816
1015
 
1016
+ # Lists live partners; filterable by `name`, `code`, `vatCode`, `email`, `type`, `isCustomer`, `isSupplier`,
1017
+ # `isActive`, `legalCountryClass`, `isEmployee`, `groupId`, `statusId` and `nextCallDate`, sortable by `name`,
1018
+ # `code`, `createdAt`, `nextCallDate` and `rating`.
1019
+ #
817
1020
  # @param request_options [Hash]
818
1021
  # @param params [Nordlet::Partners::Types::ListPartnersRequest]
819
1022
  # @option request_options [String] :base_url
@@ -846,6 +1049,8 @@ module Nordlet
846
1049
  end
847
1050
  end
848
1051
 
1052
+ # Creates a partner group; a `code` already used by a group of the company is refused with 409.
1053
+ #
849
1054
  # @param request_options [Hash]
850
1055
  # @param params [Nordlet::Partners::Types::GroupsCreatePartnersRequest]
851
1056
  # @option request_options [String] :base_url
@@ -878,6 +1083,9 @@ module Nordlet
878
1083
  end
879
1084
  end
880
1085
 
1086
+ # Changes the code or name of a partner group; a code already used by another group of the company is refused with
1087
+ # 409.
1088
+ #
881
1089
  # @param request_options [Hash]
882
1090
  # @param params [Nordlet::Partners::Types::GroupsUpdatePartnersRequest]
883
1091
  # @option request_options [String] :base_url
@@ -910,6 +1118,8 @@ module Nordlet
910
1118
  end
911
1119
  end
912
1120
 
1121
+ # Deletes a partner group; a group still assigned to a live partner is refused with 409.
1122
+ #
913
1123
  # @param request_options [Hash]
914
1124
  # @param params [Nordlet::Partners::Types::GroupsDeletePartnersRequest]
915
1125
  # @option request_options [String] :base_url
@@ -942,6 +1152,8 @@ module Nordlet
942
1152
  end
943
1153
  end
944
1154
 
1155
+ # Lists the company's partner groups ordered by code.
1156
+ #
945
1157
  # @param request_options [Hash]
946
1158
  # @param params [Nordlet::Partners::Types::GroupsListPartnersRequest]
947
1159
  # @option request_options [String] :base_url
@@ -974,6 +1186,9 @@ module Nordlet
974
1186
  end
975
1187
  end
976
1188
 
1189
+ # Creates a partner status with a `sortOrder`; a `code` already used by a status of the company is refused with
1190
+ # 409.
1191
+ #
977
1192
  # @param request_options [Hash]
978
1193
  # @param params [Nordlet::Partners::Types::StatusesCreatePartnersRequest]
979
1194
  # @option request_options [String] :base_url
@@ -1006,6 +1221,9 @@ module Nordlet
1006
1221
  end
1007
1222
  end
1008
1223
 
1224
+ # Changes the code, name or sort order of a partner status; a code already used by another status of the company
1225
+ # is refused with 409.
1226
+ #
1009
1227
  # @param request_options [Hash]
1010
1228
  # @param params [Nordlet::Partners::Types::StatusesUpdatePartnersRequest]
1011
1229
  # @option request_options [String] :base_url
@@ -1038,6 +1256,8 @@ module Nordlet
1038
1256
  end
1039
1257
  end
1040
1258
 
1259
+ # Deletes a partner status; a status still assigned to a live partner is refused with 409.
1260
+ #
1041
1261
  # @param request_options [Hash]
1042
1262
  # @param params [Nordlet::Partners::Types::StatusesDeletePartnersRequest]
1043
1263
  # @option request_options [String] :base_url
@@ -1070,6 +1290,8 @@ module Nordlet
1070
1290
  end
1071
1291
  end
1072
1292
 
1293
+ # Lists the company's partner statuses ordered by sort order, then code.
1294
+ #
1073
1295
  # @param request_options [Hash]
1074
1296
  # @param params [Nordlet::Partners::Types::StatusesListPartnersRequest]
1075
1297
  # @option request_options [String] :base_url
@@ -1102,6 +1324,10 @@ module Nordlet
1102
1324
  end
1103
1325
  end
1104
1326
 
1327
+ # Records an inquiry in status `new`, from a partner (`partnerId`) or from a contact given by `contactName` or
1328
+ # `contactEmail`; without any of the three it is refused with 422. `assignedUserId` must be a member of the
1329
+ # company. Emits `partner_inquiry.created`.
1330
+ #
1105
1331
  # @param request_options [Hash]
1106
1332
  # @param params [Nordlet::Partners::Types::InquiriesCreatePartnersRequest]
1107
1333
  # @option request_options [String] :base_url
@@ -1134,6 +1360,9 @@ module Nordlet
1134
1360
  end
1135
1361
  end
1136
1362
 
1363
+ # Changes the given fields of an inquiry; `partnerId` and `assignedUserId` accept null. Setting `status` to
1364
+ # `closed` stamps `closedAt`, and moving a closed inquiry to another status clears it.
1365
+ #
1137
1366
  # @param request_options [Hash]
1138
1367
  # @param params [Nordlet::Partners::Types::InquiriesUpdatePartnersRequest]
1139
1368
  # @option request_options [String] :base_url
@@ -1166,6 +1395,8 @@ module Nordlet
1166
1395
  end
1167
1396
  end
1168
1397
 
1398
+ # Returns one inquiry with the name of its partner.
1399
+ #
1169
1400
  # @param request_options [Hash]
1170
1401
  # @param params [Nordlet::Partners::Types::InquiriesGetPartnersRequest]
1171
1402
  # @option request_options [String] :base_url
@@ -1198,6 +1429,9 @@ module Nordlet
1198
1429
  end
1199
1430
  end
1200
1431
 
1432
+ # Lists inquiries with their partner names; filterable by `status`, `channel`, `partnerId`, `assignedUserId` and
1433
+ # `subject`, sortable by `createdAt` and `updatedAt`.
1434
+ #
1201
1435
  # @param request_options [Hash]
1202
1436
  # @param params [Nordlet::Partners::Types::InquiriesListPartnersRequest]
1203
1437
  # @option request_options [String] :base_url
@@ -1230,6 +1464,11 @@ module Nordlet
1230
1464
  end
1231
1465
  end
1232
1466
 
1467
+ # Compares a partner's open receivables plus an optional `additionalAmount` with its `creditLimit`. The open
1468
+ # receivables are the unpaid remainder of the partner's issued invoices, advance invoices and credit notes (credit
1469
+ # notes negative), converted to the company's base currency at each invoice's `fxRate`. Without a credit limit
1470
+ # `available` is null and `exceeded` is false.
1471
+ #
1233
1472
  # @param request_options [Hash]
1234
1473
  # @param params [Nordlet::Partners::Types::CreditCheckPartnersRequest]
1235
1474
  # @option request_options [String] :base_url
@@ -8,6 +8,8 @@ module Nordlet
8
8
 
9
9
  field :partner_id, -> { String }, optional: false, nullable: false, api_name: "partnerId"
10
10
 
11
+ field :kind, -> { Nordlet::Partners::Types::DebtRemindersListPartnersResponseRowsItemKind }, optional: false, nullable: false
12
+
11
13
  field :sent_to, -> { String }, optional: false, nullable: false, api_name: "sentTo"
12
14
 
13
15
  field :invoice_count, -> { Integer }, optional: false, nullable: false, api_name: "invoiceCount"
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Partners
5
+ module Types
6
+ module DebtRemindersListPartnersResponseRowsItemKind
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ BEFORE_DUE = "before_due"
10
+ OVERDUE = "overdue"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Partners
5
+ module Types
6
+ class DebtRemindersSettingsGetPartnersRequest < Internal::Types::Model; end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Partners
5
+ module Types
6
+ class DebtRemindersSettingsGetPartnersResponse < Internal::Types::Model
7
+ field :days_before, -> { Integer }, optional: false, nullable: true, api_name: "daysBefore"
8
+
9
+ field :repeat_days, -> { Integer }, optional: false, nullable: false, api_name: "repeatDays"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Partners
5
+ module Types
6
+ class DebtRemindersSettingsUpdatePartnersRequest < Internal::Types::Model
7
+ field :days_before, -> { Integer }, optional: true, nullable: false, api_name: "daysBefore"
8
+
9
+ field :repeat_days, -> { Integer }, optional: true, nullable: false, api_name: "repeatDays"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Partners
5
+ module Types
6
+ class DebtRemindersSettingsUpdatePartnersResponse < Internal::Types::Model
7
+ field :days_before, -> { Integer }, optional: false, nullable: true, api_name: "daysBefore"
8
+
9
+ field :repeat_days, -> { Integer }, optional: false, nullable: false, api_name: "repeatDays"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Partners
5
+ module Types
6
+ class DebtRemindersUpcomingPartnersRequest < Internal::Types::Model; end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Partners
5
+ module Types
6
+ class DebtRemindersUpcomingPartnersResponse < Internal::Types::Model
7
+ field :rows, -> { Internal::Types::Array[Nordlet::Partners::Types::DebtRemindersUpcomingPartnersResponseRowsItem] }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Partners
5
+ module Types
6
+ class DebtRemindersUpcomingPartnersResponseRowsItem < Internal::Types::Model
7
+ field :date, -> { String }, optional: false, nullable: false
8
+
9
+ field :kind, -> { Nordlet::Partners::Types::DebtRemindersUpcomingPartnersResponseRowsItemKind }, optional: false, nullable: false
10
+
11
+ field :invoice_id, -> { String }, optional: false, nullable: false, api_name: "invoiceId"
12
+
13
+ field :full_number, -> { String }, optional: false, nullable: false, api_name: "fullNumber"
14
+
15
+ field :partner_id, -> { String }, optional: false, nullable: false, api_name: "partnerId"
16
+
17
+ field :partner_name, -> { String }, optional: false, nullable: false, api_name: "partnerName"
18
+
19
+ field :due_date, -> { String }, optional: false, nullable: false, api_name: "dueDate"
20
+
21
+ field :remaining, -> { String }, optional: false, nullable: false
22
+
23
+ field :currency, -> { String }, optional: false, nullable: false
24
+ end
25
+ end
26
+ end
27
+ end