nordlet 0.2.1 → 0.2.2

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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nordlet/client.rb +5 -0
  3. data/lib/nordlet/migration/client.rb +86 -0
  4. data/lib/nordlet/migration/types/post_v1migration_books_import_request.rb +33 -0
  5. data/lib/nordlet/migration/types/post_v1migration_books_import_request_accounts_item.rb +19 -0
  6. data/lib/nordlet/migration/types/post_v1migration_books_import_request_accounts_item_type.rb +17 -0
  7. data/lib/nordlet/migration/types/post_v1migration_books_import_request_asset_groups_item.rb +21 -0
  8. data/lib/nordlet/migration/types/post_v1migration_books_import_request_fixed_assets_item.rb +31 -0
  9. data/lib/nordlet/migration/types/post_v1migration_books_import_request_items_item.rb +27 -0
  10. data/lib/nordlet/migration/types/post_v1migration_books_import_request_items_item_type.rb +14 -0
  11. data/lib/nordlet/migration/types/post_v1migration_books_import_request_journal_item.rb +17 -0
  12. data/lib/nordlet/migration/types/post_v1migration_books_import_request_journal_item_entries_item.rb +17 -0
  13. data/lib/nordlet/migration/types/post_v1migration_books_import_request_open_payables_item.rb +29 -0
  14. data/lib/nordlet/migration/types/post_v1migration_books_import_request_open_receivables_item.rb +29 -0
  15. data/lib/nordlet/migration/types/post_v1migration_books_import_request_opening_balances.rb +15 -0
  16. data/lib/nordlet/migration/types/post_v1migration_books_import_request_opening_balances_entries_item.rb +17 -0
  17. data/lib/nordlet/migration/types/post_v1migration_books_import_request_partners_item.rb +31 -0
  18. data/lib/nordlet/migration/types/post_v1migration_books_import_request_partners_item_address.rb +17 -0
  19. data/lib/nordlet/migration/types/post_v1migration_books_import_request_partners_item_type.rb +14 -0
  20. data/lib/nordlet/migration/types/post_v1migration_books_import_request_stock_item.rb +21 -0
  21. data/lib/nordlet/migration/types/post_v1migration_books_import_response.rb +37 -0
  22. data/lib/nordlet/migration/types/post_v1migration_books_import_response_accounts.rb +13 -0
  23. data/lib/nordlet/migration/types/post_v1migration_books_import_response_asset_groups.rb +13 -0
  24. data/lib/nordlet/migration/types/post_v1migration_books_import_response_fixed_assets.rb +15 -0
  25. data/lib/nordlet/migration/types/post_v1migration_books_import_response_items.rb +13 -0
  26. data/lib/nordlet/migration/types/post_v1migration_books_import_response_journal.rb +13 -0
  27. data/lib/nordlet/migration/types/post_v1migration_books_import_response_number_series_item.rb +15 -0
  28. data/lib/nordlet/migration/types/post_v1migration_books_import_response_open_payables.rb +13 -0
  29. data/lib/nordlet/migration/types/post_v1migration_books_import_response_open_receivables.rb +13 -0
  30. data/lib/nordlet/migration/types/post_v1migration_books_import_response_opening_balances.rb +21 -0
  31. data/lib/nordlet/migration/types/post_v1migration_books_import_response_partners.rb +13 -0
  32. data/lib/nordlet/migration/types/post_v1migration_books_import_response_stock.rb +13 -0
  33. data/lib/nordlet/migration/types/post_v1migration_books_validate_request.rb +33 -0
  34. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_accounts_item.rb +19 -0
  35. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_accounts_item_type.rb +17 -0
  36. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_asset_groups_item.rb +21 -0
  37. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_fixed_assets_item.rb +31 -0
  38. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_items_item.rb +27 -0
  39. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_items_item_type.rb +14 -0
  40. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_journal_item.rb +17 -0
  41. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_journal_item_entries_item.rb +17 -0
  42. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_open_payables_item.rb +29 -0
  43. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_open_receivables_item.rb +29 -0
  44. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_opening_balances.rb +15 -0
  45. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_opening_balances_entries_item.rb +17 -0
  46. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_partners_item.rb +31 -0
  47. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_partners_item_address.rb +17 -0
  48. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_partners_item_type.rb +14 -0
  49. data/lib/nordlet/migration/types/post_v1migration_books_validate_request_stock_item.rb +21 -0
  50. data/lib/nordlet/migration/types/post_v1migration_books_validate_response.rb +37 -0
  51. data/lib/nordlet/migration/types/post_v1migration_books_validate_response_accounts.rb +13 -0
  52. data/lib/nordlet/migration/types/post_v1migration_books_validate_response_asset_groups.rb +13 -0
  53. data/lib/nordlet/migration/types/post_v1migration_books_validate_response_fixed_assets.rb +15 -0
  54. data/lib/nordlet/migration/types/post_v1migration_books_validate_response_items.rb +13 -0
  55. data/lib/nordlet/migration/types/post_v1migration_books_validate_response_journal.rb +13 -0
  56. data/lib/nordlet/migration/types/post_v1migration_books_validate_response_number_series_item.rb +15 -0
  57. data/lib/nordlet/migration/types/post_v1migration_books_validate_response_open_payables.rb +13 -0
  58. data/lib/nordlet/migration/types/post_v1migration_books_validate_response_open_receivables.rb +13 -0
  59. data/lib/nordlet/migration/types/post_v1migration_books_validate_response_opening_balances.rb +21 -0
  60. data/lib/nordlet/migration/types/post_v1migration_books_validate_response_partners.rb +13 -0
  61. data/lib/nordlet/migration/types/post_v1migration_books_validate_response_stock.rb +13 -0
  62. data/lib/nordlet/version.rb +1 -1
  63. data/lib/nordlet.rb +59 -0
  64. data/reference.md +301 -0
  65. metadata +61 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aef43a0d6f75188c00fb567a77c6f66b6cd7a4842fb7f6d1bc68015560316f7b
4
- data.tar.gz: 924c9ebb05a9db2bcb0c061acd973692a61ee0846c5f7fab4aadd2115d56a1c2
3
+ metadata.gz: a261cc00c0f87370865e449e922cefb2da2e2a2fbbccf55caaea4d7d43aa64b6
4
+ data.tar.gz: 958281f4acfa38e833691a53cdf67eb02ece58e7791852904a2be65fbe1620eb
5
5
  SHA512:
6
- metadata.gz: 53612f790a144882fa19959a70b476fa6e3ac2f4280a3be0d9fe6192ec4ee0c8d12602e45d2da40f2397845b6cd668c8e468903eab88a55a1dc97d45514ebd19
7
- data.tar.gz: bf0284401938d4e7e2e9a33e59b132c15e25902e421098c2e90e30636eafea449f471ba22cac4d00dc57d3db2f6cde1fe8ab195f46f0200d44ba3f346ea28756
6
+ metadata.gz: d19122eff83a0d3224f2aa61b0d2ce410437e97788bfd73e021f031cf237843d3c691d67897d87888208da4ab58bfeb39ea4a4229b367f446b7d1f871e099b45
7
+ data.tar.gz: f1bf57f19ba43d7fcb747876a9677330b3903da11b042c851e57ea7f489271a82f9fb0e5c5878805482407cc52b964a5f45d51177360ed2daa30192cb75c6aeb
@@ -58,6 +58,11 @@ module Nordlet
58
58
  @ledger ||= Nordlet::Ledger::Client.new(client: @raw_client)
59
59
  end
60
60
 
61
+ # @return [Nordlet::Migration::Client]
62
+ def migration
63
+ @migration ||= Nordlet::Migration::Client.new(client: @raw_client)
64
+ end
65
+
61
66
  # @return [Nordlet::Assets::Client]
62
67
  def assets
63
68
  @assets ||= Nordlet::Assets::Client.new(client: @raw_client)
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ class Client
6
+ # @param client [Nordlet::Internal::Http::RawClient]
7
+ #
8
+ # @return [void]
9
+ def initialize(client:)
10
+ @client = client
11
+ end
12
+
13
+ # Runs every check the import runs (accounts, partners, balances, open invoices, assets, stock) and returns the
14
+ # same summary and warnings, then rolls everything back. Nothing is stored.
15
+ #
16
+ # @param request_options [Hash]
17
+ # @param params [Nordlet::Migration::Types::PostV1MigrationBooksValidateRequest]
18
+ # @option request_options [String] :base_url
19
+ # @option request_options [Hash{String => Object}] :additional_headers
20
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
21
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
22
+ # @option request_options [Integer] :timeout_in_seconds
23
+ #
24
+ # @return [Nordlet::Migration::Types::PostV1MigrationBooksValidateResponse]
25
+ def check_a_historical_books_package_without_writing_anything(request_options: {}, **params)
26
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
27
+ request = Nordlet::Internal::JSON::Request.new(
28
+ base_url: request_options[:base_url],
29
+ method: "POST",
30
+ path: "v1/migration/books/validate",
31
+ body: Nordlet::Migration::Types::PostV1MigrationBooksValidateRequest.new(params).to_h,
32
+ request_options: request_options
33
+ )
34
+ begin
35
+ response = @client.send(request)
36
+ rescue Net::HTTPRequestTimeout
37
+ raise Nordlet::Errors::TimeoutError
38
+ end
39
+ code = response.code.to_i
40
+ if code.between?(200, 299)
41
+ Nordlet::Migration::Types::PostV1MigrationBooksValidateResponse.load(response.body)
42
+ else
43
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
44
+ raise error_class.new(response.body, code: code)
45
+ end
46
+ end
47
+
48
+ # Brings a company over from another system in one call: chart of accounts, partners, items, opening balances (or
49
+ # the full journal history), open customer and supplier invoices, fixed assets with their accumulated
50
+ # depreciation, and stock on hand. The whole package is written in one database transaction — if any row fails,
51
+ # nothing is stored.
52
+ #
53
+ # @param request_options [Hash]
54
+ # @param params [Nordlet::Migration::Types::PostV1MigrationBooksImportRequest]
55
+ # @option request_options [String] :base_url
56
+ # @option request_options [Hash{String => Object}] :additional_headers
57
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
58
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
59
+ # @option request_options [Integer] :timeout_in_seconds
60
+ #
61
+ # @return [Nordlet::Migration::Types::PostV1MigrationBooksImportResponse]
62
+ def import_historical_books_from_a_previous_accounting_system(request_options: {}, **params)
63
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
64
+ request = Nordlet::Internal::JSON::Request.new(
65
+ base_url: request_options[:base_url],
66
+ method: "POST",
67
+ path: "v1/migration/books/import",
68
+ body: Nordlet::Migration::Types::PostV1MigrationBooksImportRequest.new(params).to_h,
69
+ request_options: request_options
70
+ )
71
+ begin
72
+ response = @client.send(request)
73
+ rescue Net::HTTPRequestTimeout
74
+ raise Nordlet::Errors::TimeoutError
75
+ end
76
+ code = response.code.to_i
77
+ if code.between?(200, 299)
78
+ Nordlet::Migration::Types::PostV1MigrationBooksImportResponse.load(response.body)
79
+ else
80
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
81
+ raise error_class.new(response.body, code: code)
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequest < Internal::Types::Model
7
+ field :cutover_date, -> { String }, optional: false, nullable: false, api_name: "cutoverDate"
8
+
9
+ field :source, -> { String }, optional: true, nullable: false
10
+
11
+ field :accounts, -> { Internal::Types::Array[Nordlet::Migration::Types::PostV1MigrationBooksImportRequestAccountsItem] }, optional: true, nullable: false
12
+
13
+ field :partners, -> { Internal::Types::Array[Nordlet::Migration::Types::PostV1MigrationBooksImportRequestPartnersItem] }, optional: true, nullable: false
14
+
15
+ field :items, -> { Internal::Types::Array[Nordlet::Migration::Types::PostV1MigrationBooksImportRequestItemsItem] }, optional: true, nullable: false
16
+
17
+ field :opening_balances, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportRequestOpeningBalances }, optional: true, nullable: false, api_name: "openingBalances"
18
+
19
+ field :journal, -> { Internal::Types::Array[Nordlet::Migration::Types::PostV1MigrationBooksImportRequestJournalItem] }, optional: true, nullable: false
20
+
21
+ field :open_receivables, -> { Internal::Types::Array[Nordlet::Migration::Types::PostV1MigrationBooksImportRequestOpenReceivablesItem] }, optional: true, nullable: false, api_name: "openReceivables"
22
+
23
+ field :open_payables, -> { Internal::Types::Array[Nordlet::Migration::Types::PostV1MigrationBooksImportRequestOpenPayablesItem] }, optional: true, nullable: false, api_name: "openPayables"
24
+
25
+ field :asset_groups, -> { Internal::Types::Array[Nordlet::Migration::Types::PostV1MigrationBooksImportRequestAssetGroupsItem] }, optional: true, nullable: false, api_name: "assetGroups"
26
+
27
+ field :fixed_assets, -> { Internal::Types::Array[Nordlet::Migration::Types::PostV1MigrationBooksImportRequestFixedAssetsItem] }, optional: true, nullable: false, api_name: "fixedAssets"
28
+
29
+ field :stock, -> { Internal::Types::Array[Nordlet::Migration::Types::PostV1MigrationBooksImportRequestStockItem] }, optional: true, nullable: false
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestAccountsItem < Internal::Types::Model
7
+ field :code, -> { String }, optional: false, nullable: false
8
+
9
+ field :name, -> { String }, optional: false, nullable: false
10
+
11
+ field :type, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportRequestAccountsItemType }, optional: false, nullable: false
12
+
13
+ field :parent_code, -> { String }, optional: true, nullable: false, api_name: "parentCode"
14
+
15
+ field :is_postable, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "isPostable"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ module PostV1MigrationBooksImportRequestAccountsItemType
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ ASSET = "asset"
10
+ LIABILITY = "liability"
11
+ EQUITY = "equity"
12
+ INCOME = "income"
13
+ EXPENSE = "expense"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestAssetGroupsItem < Internal::Types::Model
7
+ field :code, -> { String }, optional: false, nullable: false
8
+
9
+ field :name, -> { String }, optional: false, nullable: false
10
+
11
+ field :asset_account_code, -> { String }, optional: false, nullable: false, api_name: "assetAccountCode"
12
+
13
+ field :depreciation_account_code, -> { String }, optional: false, nullable: false, api_name: "depreciationAccountCode"
14
+
15
+ field :expense_account_code, -> { String }, optional: true, nullable: false, api_name: "expenseAccountCode"
16
+
17
+ field :default_useful_life_months, -> { Integer }, optional: true, nullable: false, api_name: "defaultUsefulLifeMonths"
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestFixedAssetsItem < Internal::Types::Model
7
+ field :group_code, -> { String }, optional: false, nullable: false, api_name: "groupCode"
8
+
9
+ field :code, -> { String }, optional: false, nullable: false
10
+
11
+ field :name, -> { String }, optional: false, nullable: false
12
+
13
+ field :acquisition_date, -> { String }, optional: false, nullable: false, api_name: "acquisitionDate"
14
+
15
+ field :depreciation_start_date, -> { String }, optional: true, nullable: false, api_name: "depreciationStartDate"
16
+
17
+ field :acquisition_cost, -> { String }, optional: false, nullable: false, api_name: "acquisitionCost"
18
+
19
+ field :salvage_value, -> { String }, optional: true, nullable: false, api_name: "salvageValue"
20
+
21
+ field :useful_life_months, -> { Integer }, optional: true, nullable: false, api_name: "usefulLifeMonths"
22
+
23
+ field :accumulated_depreciation, -> { String }, optional: true, nullable: false, api_name: "accumulatedDepreciation"
24
+
25
+ field :depreciated_months, -> { Integer }, optional: true, nullable: false, api_name: "depreciatedMonths"
26
+
27
+ field :notes, -> { String }, optional: true, nullable: false
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestItemsItem < Internal::Types::Model
7
+ field :code, -> { String }, optional: false, nullable: false
8
+
9
+ field :name, -> { String }, optional: false, nullable: false
10
+
11
+ field :type, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportRequestItemsItemType }, optional: true, nullable: false
12
+
13
+ field :unit, -> { String }, optional: true, nullable: false
14
+
15
+ field :barcode, -> { String }, optional: true, nullable: false
16
+
17
+ field :vat_rate_percent, -> { String }, optional: true, nullable: false, api_name: "vatRatePercent"
18
+
19
+ field :sale_price_excl_vat, -> { String }, optional: true, nullable: false, api_name: "salePriceExclVat"
20
+
21
+ field :purchase_price_excl_vat, -> { String }, optional: true, nullable: false, api_name: "purchasePriceExclVat"
22
+
23
+ field :description, -> { String }, optional: true, nullable: false
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ module PostV1MigrationBooksImportRequestItemsItemType
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ PRODUCT = "product"
10
+ SERVICE = "service"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestJournalItem < Internal::Types::Model
7
+ field :date, -> { String }, optional: false, nullable: false
8
+
9
+ field :description, -> { String }, optional: true, nullable: false
10
+
11
+ field :reference, -> { String }, optional: true, nullable: false
12
+
13
+ field :entries, -> { Internal::Types::Array[Nordlet::Migration::Types::PostV1MigrationBooksImportRequestJournalItemEntriesItem] }, optional: false, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestJournalItemEntriesItem < Internal::Types::Model
7
+ field :account_code, -> { String }, optional: false, nullable: false, api_name: "accountCode"
8
+
9
+ field :debit, -> { String }, optional: true, nullable: false
10
+
11
+ field :credit, -> { String }, optional: true, nullable: false
12
+
13
+ field :description, -> { String }, optional: true, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestOpenPayablesItem < Internal::Types::Model
7
+ field :partner_code, -> { String }, optional: false, nullable: false, api_name: "partnerCode"
8
+
9
+ field :due_date, -> { String }, optional: true, nullable: false, api_name: "dueDate"
10
+
11
+ field :currency, -> { String }, optional: true, nullable: false
12
+
13
+ field :gross_total, -> { String }, optional: false, nullable: false, api_name: "grossTotal"
14
+
15
+ field :vat_total, -> { String }, optional: true, nullable: false, api_name: "vatTotal"
16
+
17
+ field :outstanding, -> { String }, optional: true, nullable: false
18
+
19
+ field :fx_rate, -> { String }, optional: true, nullable: false, api_name: "fxRate"
20
+
21
+ field :notes, -> { String }, optional: true, nullable: false
22
+
23
+ field :document_number, -> { String }, optional: false, nullable: false, api_name: "documentNumber"
24
+
25
+ field :document_date, -> { String }, optional: false, nullable: false, api_name: "documentDate"
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestOpenReceivablesItem < Internal::Types::Model
7
+ field :partner_code, -> { String }, optional: false, nullable: false, api_name: "partnerCode"
8
+
9
+ field :due_date, -> { String }, optional: true, nullable: false, api_name: "dueDate"
10
+
11
+ field :currency, -> { String }, optional: true, nullable: false
12
+
13
+ field :gross_total, -> { String }, optional: false, nullable: false, api_name: "grossTotal"
14
+
15
+ field :vat_total, -> { String }, optional: true, nullable: false, api_name: "vatTotal"
16
+
17
+ field :outstanding, -> { String }, optional: true, nullable: false
18
+
19
+ field :fx_rate, -> { String }, optional: true, nullable: false, api_name: "fxRate"
20
+
21
+ field :notes, -> { String }, optional: true, nullable: false
22
+
23
+ field :number, -> { String }, optional: false, nullable: false
24
+
25
+ field :issue_date, -> { String }, optional: false, nullable: false, api_name: "issueDate"
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestOpeningBalances < Internal::Types::Model
7
+ field :date, -> { String }, optional: true, nullable: false
8
+
9
+ field :balancing_account_code, -> { String }, optional: true, nullable: false, api_name: "balancingAccountCode"
10
+
11
+ field :entries, -> { Internal::Types::Array[Nordlet::Migration::Types::PostV1MigrationBooksImportRequestOpeningBalancesEntriesItem] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestOpeningBalancesEntriesItem < Internal::Types::Model
7
+ field :account_code, -> { String }, optional: false, nullable: false, api_name: "accountCode"
8
+
9
+ field :debit, -> { String }, optional: true, nullable: false
10
+
11
+ field :credit, -> { String }, optional: true, nullable: false
12
+
13
+ field :description, -> { String }, optional: true, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestPartnersItem < Internal::Types::Model
7
+ field :code, -> { String }, optional: false, nullable: false
8
+
9
+ field :name, -> { String }, optional: false, nullable: false
10
+
11
+ field :type, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportRequestPartnersItemType }, optional: true, nullable: false
12
+
13
+ field :vat_code, -> { String }, optional: true, nullable: false, api_name: "vatCode"
14
+
15
+ field :email, -> { String }, optional: true, nullable: false
16
+
17
+ field :phone, -> { String }, optional: true, nullable: false
18
+
19
+ field :is_customer, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "isCustomer"
20
+
21
+ field :is_supplier, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "isSupplier"
22
+
23
+ field :payment_term_days, -> { Integer }, optional: true, nullable: false, api_name: "paymentTermDays"
24
+
25
+ field :address, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportRequestPartnersItemAddress }, optional: true, nullable: false
26
+
27
+ field :notes, -> { String }, optional: true, nullable: false
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestPartnersItemAddress < Internal::Types::Model
7
+ field :street, -> { String }, optional: true, nullable: false
8
+
9
+ field :city, -> { String }, optional: true, nullable: false
10
+
11
+ field :postal_code, -> { String }, optional: true, nullable: false, api_name: "postalCode"
12
+
13
+ field :country_code, -> { String }, optional: true, nullable: false, api_name: "countryCode"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ module PostV1MigrationBooksImportRequestPartnersItemType
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ COMPANY = "company"
10
+ PERSON = "person"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportRequestStockItem < Internal::Types::Model
7
+ field :warehouse_code, -> { String }, optional: true, nullable: false, api_name: "warehouseCode"
8
+
9
+ field :item_code, -> { String }, optional: false, nullable: false, api_name: "itemCode"
10
+
11
+ field :quantity, -> { String }, optional: false, nullable: false
12
+
13
+ field :unit_cost, -> { String }, optional: false, nullable: false, api_name: "unitCost"
14
+
15
+ field :lot_number, -> { String }, optional: true, nullable: false, api_name: "lotNumber"
16
+
17
+ field :expiry_date, -> { String }, optional: true, nullable: false, api_name: "expiryDate"
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportResponse < Internal::Types::Model
7
+ field :dry_run, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "dryRun"
8
+
9
+ field :cutover_date, -> { String }, optional: false, nullable: false, api_name: "cutoverDate"
10
+
11
+ field :accounts, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportResponseAccounts }, optional: false, nullable: false
12
+
13
+ field :partners, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportResponsePartners }, optional: false, nullable: false
14
+
15
+ field :items, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportResponseItems }, optional: false, nullable: false
16
+
17
+ field :asset_groups, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportResponseAssetGroups }, optional: false, nullable: false, api_name: "assetGroups"
18
+
19
+ field :opening_balances, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportResponseOpeningBalances }, optional: false, nullable: true, api_name: "openingBalances"
20
+
21
+ field :journal, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportResponseJournal }, optional: false, nullable: false
22
+
23
+ field :open_receivables, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportResponseOpenReceivables }, optional: false, nullable: false, api_name: "openReceivables"
24
+
25
+ field :open_payables, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportResponseOpenPayables }, optional: false, nullable: false, api_name: "openPayables"
26
+
27
+ field :fixed_assets, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportResponseFixedAssets }, optional: false, nullable: false, api_name: "fixedAssets"
28
+
29
+ field :stock, -> { Nordlet::Migration::Types::PostV1MigrationBooksImportResponseStock }, optional: false, nullable: false
30
+
31
+ field :number_series, -> { Internal::Types::Array[Nordlet::Migration::Types::PostV1MigrationBooksImportResponseNumberSeriesItem] }, optional: false, nullable: false, api_name: "numberSeries"
32
+
33
+ field :warnings, -> { Internal::Types::Array[String] }, optional: false, nullable: false
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportResponseAccounts < Internal::Types::Model
7
+ field :created, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :existing, -> { Integer }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportResponseAssetGroups < Internal::Types::Model
7
+ field :created, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :existing, -> { Integer }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportResponseFixedAssets < Internal::Types::Model
7
+ field :created, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :cost_total, -> { String }, optional: false, nullable: false, api_name: "costTotal"
10
+
11
+ field :accumulated_depreciation_total, -> { String }, optional: false, nullable: false, api_name: "accumulatedDepreciationTotal"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportResponseItems < Internal::Types::Model
7
+ field :created, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :existing, -> { Integer }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportResponseJournal < Internal::Types::Model
7
+ field :transactions, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :entries, -> { Integer }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportResponseNumberSeriesItem < Internal::Types::Model
7
+ field :prefix, -> { String }, optional: false, nullable: false
8
+
9
+ field :year, -> { Integer }, optional: false, nullable: false
10
+
11
+ field :next_number, -> { Integer }, optional: false, nullable: false, api_name: "nextNumber"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Migration
5
+ module Types
6
+ class PostV1MigrationBooksImportResponseOpenPayables < Internal::Types::Model
7
+ field :created, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :outstanding_total, -> { String }, optional: false, nullable: false, api_name: "outstandingTotal"
10
+ end
11
+ end
12
+ end
13
+ end