e-invoice-api 0.33.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/LICENSE +201 -0
  4. data/README.md +18 -7
  5. data/SECURITY.md +6 -16
  6. data/lib/e_invoice_api/client.rb +16 -0
  7. data/lib/e_invoice_api/internal/transport/base_client.rb +43 -78
  8. data/lib/e_invoice_api/internal/transport/pooled_net_requester.rb +8 -8
  9. data/lib/e_invoice_api/internal/type/array_of.rb +12 -12
  10. data/lib/e_invoice_api/internal/type/base_model.rb +18 -18
  11. data/lib/e_invoice_api/internal/type/boolean.rb +6 -6
  12. data/lib/e_invoice_api/internal/type/converter.rb +24 -24
  13. data/lib/e_invoice_api/internal/type/enum.rb +6 -6
  14. data/lib/e_invoice_api/internal/type/file_input.rb +6 -6
  15. data/lib/e_invoice_api/internal/type/hash_of.rb +12 -12
  16. data/lib/e_invoice_api/internal/type/request_parameters.rb +1 -1
  17. data/lib/e_invoice_api/internal/type/union.rb +10 -10
  18. data/lib/e_invoice_api/internal/type/unknown.rb +6 -6
  19. data/lib/e_invoice_api/internal/util.rb +15 -57
  20. data/lib/e_invoice_api/models/conversion/document_create_from_pdf_task.rb +43 -0
  21. data/lib/e_invoice_api/models/conversion/pdf_create_params.rb +22 -0
  22. data/lib/e_invoice_api/models/conversion/pdf_result_params.rb +22 -0
  23. data/lib/e_invoice_api/models/conversion/pdf_retrieve_params.rb +22 -0
  24. data/lib/e_invoice_api/models/document_create.rb +203 -17
  25. data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +153 -17
  26. data/lib/e_invoice_api/models/document_lifecycle_params.rb +20 -0
  27. data/lib/e_invoice_api/models/document_lifecycle_response.rb +134 -0
  28. data/lib/e_invoice_api/models/document_response.rb +161 -21
  29. data/lib/e_invoice_api/models/document_timeline_params.rb +20 -0
  30. data/lib/e_invoice_api/models/document_timeline_response.rb +71 -0
  31. data/lib/e_invoice_api/models/draft_list_params.rb +113 -0
  32. data/lib/e_invoice_api/models/inbound_email_response.rb +129 -0
  33. data/lib/e_invoice_api/models/mailbox_download_attachment_params.rb +26 -0
  34. data/lib/e_invoice_api/models/mailbox_list_params.rb +129 -0
  35. data/lib/e_invoice_api/models/mailbox_reprocess_params.rb +20 -0
  36. data/lib/e_invoice_api/models/mailbox_retrieve_params.rb +20 -0
  37. data/lib/e_invoice_api/models/me_retrieve_response.rb +8 -7
  38. data/lib/e_invoice_api/models/payment_detail_create.rb +8 -4
  39. data/lib/e_invoice_api/models/stats_retrieve_params.rb +55 -0
  40. data/lib/e_invoice_api/models/stats_retrieve_response.rb +141 -0
  41. data/lib/e_invoice_api/models/ubl_document_validation.rb +10 -1
  42. data/lib/e_invoice_api/models/unit_of_measure_code.rb +1349 -0
  43. data/lib/e_invoice_api/models/webhook_history_params.rb +20 -0
  44. data/lib/e_invoice_api/models/webhook_history_response.rb +17 -0
  45. data/lib/e_invoice_api/models/webhook_test_params.rb +37 -0
  46. data/lib/e_invoice_api/models/webhook_test_response.rb +35 -0
  47. data/lib/e_invoice_api/models.rb +24 -0
  48. data/lib/e_invoice_api/resources/conversion/pdf.rb +76 -0
  49. data/lib/e_invoice_api/resources/conversion.rb +18 -0
  50. data/lib/e_invoice_api/resources/documents/attachments.rb +11 -11
  51. data/lib/e_invoice_api/resources/documents/ubl.rb +4 -4
  52. data/lib/e_invoice_api/resources/documents.rb +130 -69
  53. data/lib/e_invoice_api/resources/drafts.rb +55 -0
  54. data/lib/e_invoice_api/resources/inbox.rb +20 -20
  55. data/lib/e_invoice_api/resources/lookup.rb +5 -5
  56. data/lib/e_invoice_api/resources/mailbox.rb +123 -0
  57. data/lib/e_invoice_api/resources/me.rb +1 -1
  58. data/lib/e_invoice_api/resources/outbox.rb +19 -19
  59. data/lib/e_invoice_api/resources/stats.rb +47 -0
  60. data/lib/e_invoice_api/resources/validate.rb +76 -56
  61. data/lib/e_invoice_api/resources/webhooks.rb +59 -14
  62. data/lib/e_invoice_api/version.rb +1 -1
  63. data/lib/e_invoice_api.rb +25 -1
  64. data/rbi/e_invoice_api/client.rbi +12 -0
  65. data/rbi/e_invoice_api/internal/transport/base_client.rbi +2 -10
  66. data/rbi/e_invoice_api/internal/util.rbi +0 -12
  67. data/rbi/e_invoice_api/models/conversion/document_create_from_pdf_task.rbi +108 -0
  68. data/rbi/e_invoice_api/models/conversion/pdf_create_params.rbi +43 -0
  69. data/rbi/e_invoice_api/models/conversion/pdf_result_params.rbi +40 -0
  70. data/rbi/e_invoice_api/models/conversion/pdf_retrieve_params.rbi +40 -0
  71. data/rbi/e_invoice_api/models/document_create.rbi +366 -15
  72. data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +280 -15
  73. data/rbi/e_invoice_api/models/document_lifecycle_params.rbi +38 -0
  74. data/rbi/e_invoice_api/models/document_lifecycle_response.rbi +353 -0
  75. data/rbi/e_invoice_api/models/document_response.rbi +292 -19
  76. data/rbi/e_invoice_api/models/document_timeline_params.rbi +38 -0
  77. data/rbi/e_invoice_api/models/document_timeline_response.rbi +168 -0
  78. data/rbi/e_invoice_api/models/draft_list_params.rbi +194 -0
  79. data/rbi/e_invoice_api/models/inbound_email_response.rbi +189 -0
  80. data/rbi/e_invoice_api/models/mailbox_download_attachment_params.rbi +46 -0
  81. data/rbi/e_invoice_api/models/mailbox_list_params.rbi +218 -0
  82. data/rbi/e_invoice_api/models/mailbox_reprocess_params.rbi +41 -0
  83. data/rbi/e_invoice_api/models/mailbox_retrieve_params.rbi +41 -0
  84. data/rbi/e_invoice_api/models/me_retrieve_response.rbi +10 -8
  85. data/rbi/e_invoice_api/models/payment_detail_create.rbi +12 -4
  86. data/rbi/e_invoice_api/models/stats_retrieve_params.rbi +111 -0
  87. data/rbi/e_invoice_api/models/stats_retrieve_response.rbi +251 -0
  88. data/rbi/e_invoice_api/models/ubl_document_validation.rbi +11 -1
  89. data/rbi/e_invoice_api/models/unit_of_measure_code.rbi +1349 -0
  90. data/rbi/e_invoice_api/models/webhook_history_params.rbi +38 -0
  91. data/rbi/e_invoice_api/models/webhook_history_response.rbi +32 -0
  92. data/rbi/e_invoice_api/models/webhook_test_params.rbi +57 -0
  93. data/rbi/e_invoice_api/models/webhook_test_response.rbi +57 -0
  94. data/rbi/e_invoice_api/models.rbi +25 -0
  95. data/rbi/e_invoice_api/resources/conversion/pdf.rbi +44 -0
  96. data/rbi/e_invoice_api/resources/conversion.rbi +15 -0
  97. data/rbi/e_invoice_api/resources/documents.rbi +77 -5
  98. data/rbi/e_invoice_api/resources/drafts.rbi +55 -0
  99. data/rbi/e_invoice_api/resources/mailbox.rbi +93 -0
  100. data/rbi/e_invoice_api/resources/stats.rbi +38 -0
  101. data/rbi/e_invoice_api/resources/validate.rbi +52 -6
  102. data/rbi/e_invoice_api/resources/webhooks.rbi +29 -0
  103. data/sig/e_invoice_api/client.rbs +8 -0
  104. data/sig/e_invoice_api/internal/transport/base_client.rbs +1 -4
  105. data/sig/e_invoice_api/internal/util.rbs +0 -4
  106. data/sig/e_invoice_api/models/conversion/document_create_from_pdf_task.rbs +45 -0
  107. data/sig/e_invoice_api/models/conversion/pdf_create_params.rbs +26 -0
  108. data/sig/e_invoice_api/models/conversion/pdf_result_params.rbs +25 -0
  109. data/sig/e_invoice_api/models/conversion/pdf_retrieve_params.rbs +25 -0
  110. data/sig/e_invoice_api/models/document_create.rbs +139 -4
  111. data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +113 -4
  112. data/sig/e_invoice_api/models/document_lifecycle_params.rbs +23 -0
  113. data/sig/e_invoice_api/models/document_lifecycle_response.rbs +151 -0
  114. data/sig/e_invoice_api/models/document_response.rbs +113 -4
  115. data/sig/e_invoice_api/models/document_timeline_params.rbs +23 -0
  116. data/sig/e_invoice_api/models/document_timeline_response.rbs +84 -0
  117. data/sig/e_invoice_api/models/draft_list_params.rbs +112 -0
  118. data/sig/e_invoice_api/models/inbound_email_response.rbs +126 -0
  119. data/sig/e_invoice_api/models/mailbox_download_attachment_params.rbs +28 -0
  120. data/sig/e_invoice_api/models/mailbox_list_params.rbs +112 -0
  121. data/sig/e_invoice_api/models/mailbox_reprocess_params.rbs +24 -0
  122. data/sig/e_invoice_api/models/mailbox_retrieve_params.rbs +24 -0
  123. data/sig/e_invoice_api/models/stats_retrieve_params.rbs +48 -0
  124. data/sig/e_invoice_api/models/stats_retrieve_response.rbs +107 -0
  125. data/sig/e_invoice_api/models/unit_of_measure_code.rbs +2698 -0
  126. data/sig/e_invoice_api/models/webhook_history_params.rbs +23 -0
  127. data/sig/e_invoice_api/models/webhook_history_response.rbs +13 -0
  128. data/sig/e_invoice_api/models/webhook_test_params.rbs +32 -0
  129. data/sig/e_invoice_api/models/webhook_test_response.rbs +30 -0
  130. data/sig/e_invoice_api/models.rbs +24 -0
  131. data/sig/e_invoice_api/resources/conversion/pdf.rbs +24 -0
  132. data/sig/e_invoice_api/resources/conversion.rbs +9 -0
  133. data/sig/e_invoice_api/resources/documents.rbs +19 -0
  134. data/sig/e_invoice_api/resources/drafts.rbs +20 -0
  135. data/sig/e_invoice_api/resources/mailbox.rbs +36 -0
  136. data/sig/e_invoice_api/resources/stats.rbs +14 -0
  137. data/sig/e_invoice_api/resources/validate.rbs +9 -0
  138. data/sig/e_invoice_api/resources/webhooks.rbs +12 -0
  139. metadata +102 -7
@@ -0,0 +1,129 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Mailbox#retrieve
6
+ class InboundEmailResponse < EInvoiceAPI::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute created_at
13
+ #
14
+ # @return [Time]
15
+ required :created_at, Time
16
+
17
+ # @!attribute message_id
18
+ #
19
+ # @return [String]
20
+ required :message_id, String
21
+
22
+ # @!attribute sender_email
23
+ #
24
+ # @return [String]
25
+ required :sender_email, String
26
+
27
+ # @!attribute attachment_count
28
+ #
29
+ # @return [Integer, nil]
30
+ optional :attachment_count, Integer
31
+
32
+ # @!attribute attachments
33
+ #
34
+ # @return [Array<EInvoiceAPI::Models::InboundEmailResponse::Attachment>, nil]
35
+ optional :attachments,
36
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::InboundEmailResponse::Attachment] }
37
+
38
+ # @!attribute bcc_addresses
39
+ #
40
+ # @return [String, nil]
41
+ optional :bcc_addresses, String, nil?: true
42
+
43
+ # @!attribute cc_addresses
44
+ #
45
+ # @return [String, nil]
46
+ optional :cc_addresses, String, nil?: true
47
+
48
+ # @!attribute document_id
49
+ #
50
+ # @return [String, nil]
51
+ optional :document_id, String, nil?: true
52
+
53
+ # @!attribute error_message
54
+ #
55
+ # @return [String, nil]
56
+ optional :error_message, String, nil?: true
57
+
58
+ # @!attribute processed
59
+ #
60
+ # @return [Boolean, nil]
61
+ optional :processed, EInvoiceAPI::Internal::Type::Boolean
62
+
63
+ # @!attribute processed_at
64
+ #
65
+ # @return [Time, nil]
66
+ optional :processed_at, Time, nil?: true
67
+
68
+ # @!attribute received_at
69
+ #
70
+ # @return [Time, nil]
71
+ optional :received_at, Time, nil?: true
72
+
73
+ # @!attribute sender_name
74
+ #
75
+ # @return [String, nil]
76
+ optional :sender_name, String, nil?: true
77
+
78
+ # @!attribute subject
79
+ #
80
+ # @return [String, nil]
81
+ optional :subject, String, nil?: true
82
+
83
+ # @!attribute to_addresses
84
+ #
85
+ # @return [String, nil]
86
+ optional :to_addresses, String, nil?: true
87
+
88
+ # @!method initialize(id:, created_at:, message_id:, sender_email:, attachment_count: nil, attachments: nil, bcc_addresses: nil, cc_addresses: nil, document_id: nil, error_message: nil, processed: nil, processed_at: nil, received_at: nil, sender_name: nil, subject: nil, to_addresses: nil)
89
+ # @param id [String]
90
+ # @param created_at [Time]
91
+ # @param message_id [String]
92
+ # @param sender_email [String]
93
+ # @param attachment_count [Integer]
94
+ # @param attachments [Array<EInvoiceAPI::Models::InboundEmailResponse::Attachment>]
95
+ # @param bcc_addresses [String, nil]
96
+ # @param cc_addresses [String, nil]
97
+ # @param document_id [String, nil]
98
+ # @param error_message [String, nil]
99
+ # @param processed [Boolean]
100
+ # @param processed_at [Time, nil]
101
+ # @param received_at [Time, nil]
102
+ # @param sender_name [String, nil]
103
+ # @param subject [String, nil]
104
+ # @param to_addresses [String, nil]
105
+
106
+ class Attachment < EInvoiceAPI::Internal::Type::BaseModel
107
+ # @!attribute filename
108
+ #
109
+ # @return [String]
110
+ required :filename, String
111
+
112
+ # @!attribute content_type
113
+ #
114
+ # @return [String, nil]
115
+ optional :content_type, String, nil?: true
116
+
117
+ # @!attribute size
118
+ #
119
+ # @return [Integer, nil]
120
+ optional :size, Integer, nil?: true
121
+
122
+ # @!method initialize(filename:, content_type: nil, size: nil)
123
+ # @param filename [String]
124
+ # @param content_type [String, nil]
125
+ # @param size [Integer, nil]
126
+ end
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Mailbox#download_attachment
6
+ class MailboxDownloadAttachmentParams < EInvoiceAPI::Internal::Type::BaseModel
7
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
8
+ include EInvoiceAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute inbound_email_id
11
+ #
12
+ # @return [String]
13
+ required :inbound_email_id, String
14
+
15
+ # @!attribute filename
16
+ #
17
+ # @return [String]
18
+ required :filename, String
19
+
20
+ # @!method initialize(inbound_email_id:, filename:, request_options: {})
21
+ # @param inbound_email_id [String]
22
+ # @param filename [String]
23
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,129 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Mailbox#list
6
+ class MailboxListParams < EInvoiceAPI::Internal::Type::BaseModel
7
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
8
+ include EInvoiceAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute page
11
+ # Page number
12
+ #
13
+ # @return [Integer, nil]
14
+ optional :page, Integer
15
+
16
+ # @!attribute page_size
17
+ # Number of items per page
18
+ #
19
+ # @return [Integer, nil]
20
+ optional :page_size, Integer
21
+
22
+ # @!attribute processed
23
+ # Filter by processing status. If not provided, returns all. Ignored when `status`
24
+ # is set.
25
+ #
26
+ # @return [Boolean, nil]
27
+ optional :processed, EInvoiceAPI::Internal::Type::Boolean, nil?: true
28
+
29
+ # @!attribute received_from
30
+ # Inclusive lower bound on received date (falls back to created_at when
31
+ # received_at is null)
32
+ #
33
+ # @return [Time, nil]
34
+ optional :received_from, Time, nil?: true
35
+
36
+ # @!attribute received_to
37
+ # Inclusive upper bound on received date (falls back to created_at when
38
+ # received_at is null)
39
+ #
40
+ # @return [Time, nil]
41
+ optional :received_to, Time, nil?: true
42
+
43
+ # @!attribute search
44
+ # Case-insensitive search across sender email, subject, message ID, and attachment
45
+ # filenames
46
+ #
47
+ # @return [String, nil]
48
+ optional :search, String, nil?: true
49
+
50
+ # @!attribute sort_by
51
+ # Field to sort by
52
+ #
53
+ # @return [Symbol, EInvoiceAPI::Models::MailboxListParams::SortBy, nil]
54
+ optional :sort_by, enum: -> { EInvoiceAPI::MailboxListParams::SortBy }
55
+
56
+ # @!attribute sort_order
57
+ # Sort direction (asc/desc)
58
+ #
59
+ # @return [Symbol, EInvoiceAPI::Models::MailboxListParams::SortOrder, nil]
60
+ optional :sort_order, enum: -> { EInvoiceAPI::MailboxListParams::SortOrder }
61
+
62
+ # @!attribute status
63
+ # Filter by status: pending, success, or failed. Takes precedence over `processed`
64
+ # if both are provided.
65
+ #
66
+ # @return [Symbol, EInvoiceAPI::Models::MailboxListParams::Status, nil]
67
+ optional :status, enum: -> { EInvoiceAPI::MailboxListParams::Status }, nil?: true
68
+
69
+ # @!method initialize(page: nil, page_size: nil, processed: nil, received_from: nil, received_to: nil, search: nil, sort_by: nil, sort_order: nil, status: nil, request_options: {})
70
+ # Some parameter documentations has been truncated, see
71
+ # {EInvoiceAPI::Models::MailboxListParams} for more details.
72
+ #
73
+ # @param page [Integer] Page number
74
+ #
75
+ # @param page_size [Integer] Number of items per page
76
+ #
77
+ # @param processed [Boolean, nil] Filter by processing status. If not provided, returns all. Ignored when `status`
78
+ #
79
+ # @param received_from [Time, nil] Inclusive lower bound on received date (falls back to created_at when received_a
80
+ #
81
+ # @param received_to [Time, nil] Inclusive upper bound on received date (falls back to created_at when received_a
82
+ #
83
+ # @param search [String, nil] Case-insensitive search across sender email, subject, message ID, and attachment
84
+ #
85
+ # @param sort_by [Symbol, EInvoiceAPI::Models::MailboxListParams::SortBy] Field to sort by
86
+ #
87
+ # @param sort_order [Symbol, EInvoiceAPI::Models::MailboxListParams::SortOrder] Sort direction (asc/desc)
88
+ #
89
+ # @param status [Symbol, EInvoiceAPI::Models::MailboxListParams::Status, nil] Filter by status: pending, success, or failed. Takes precedence over `processed`
90
+ #
91
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
92
+
93
+ # Field to sort by
94
+ module SortBy
95
+ extend EInvoiceAPI::Internal::Type::Enum
96
+
97
+ RECEIVED_AT = :received_at
98
+ CREATED_AT = :created_at
99
+
100
+ # @!method self.values
101
+ # @return [Array<Symbol>]
102
+ end
103
+
104
+ # Sort direction (asc/desc)
105
+ module SortOrder
106
+ extend EInvoiceAPI::Internal::Type::Enum
107
+
108
+ ASC = :asc
109
+ DESC = :desc
110
+
111
+ # @!method self.values
112
+ # @return [Array<Symbol>]
113
+ end
114
+
115
+ # Filter by status: pending, success, or failed. Takes precedence over `processed`
116
+ # if both are provided.
117
+ module Status
118
+ extend EInvoiceAPI::Internal::Type::Enum
119
+
120
+ PENDING = :pending
121
+ SUCCESS = :success
122
+ FAILED = :failed
123
+
124
+ # @!method self.values
125
+ # @return [Array<Symbol>]
126
+ end
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Mailbox#reprocess
6
+ class MailboxReprocessParams < EInvoiceAPI::Internal::Type::BaseModel
7
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
8
+ include EInvoiceAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute inbound_email_id
11
+ #
12
+ # @return [String]
13
+ required :inbound_email_id, String
14
+
15
+ # @!method initialize(inbound_email_id:, request_options: {})
16
+ # @param inbound_email_id [String]
17
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Mailbox#retrieve
6
+ class MailboxRetrieveParams < EInvoiceAPI::Internal::Type::BaseModel
7
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
8
+ include EInvoiceAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute inbound_email_id
11
+ #
12
+ # @return [String]
13
+ required :inbound_email_id, String
14
+
15
+ # @!method initialize(inbound_email_id:, request_options: {})
16
+ # @param inbound_email_id [String]
17
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -54,8 +54,8 @@ module EInvoiceAPI
54
54
  optional :company_number, String, nil?: true
55
55
 
56
56
  # @!attribute company_tax_id
57
- # Company tax ID. For Belgium this is the VAT number. Must include the country
58
- # prefix
57
+ # Company tax ID (VAT number), including the country prefix. Stored in compact
58
+ # form: uppercased with separators removed, e.g. `BE0123456789`.
59
59
  #
60
60
  # @return [String, nil]
61
61
  optional :company_tax_id, String, nil?: true
@@ -96,13 +96,14 @@ module EInvoiceAPI
96
96
  optional :plan, enum: -> { EInvoiceAPI::Models::MeRetrieveResponse::Plan }
97
97
 
98
98
  # @!attribute smp_registration
99
- # Whether the tenant is registered on our SMP
99
+ # Legacy field. Does not show whether a Peppol ID is published: it is usually
100
+ # `false`, also for a tenant whose Peppol IDs are published.
100
101
  #
101
102
  # @return [Boolean, nil]
102
103
  optional :smp_registration, EInvoiceAPI::Internal::Type::Boolean, nil?: true
103
104
 
104
105
  # @!attribute smp_registration_date
105
- # Date when the tenant was registered on SMP
106
+ # Legacy field. Does not show whether or when a Peppol ID was published.
106
107
  #
107
108
  # @return [Time, nil]
108
109
  optional :smp_registration_date, Time, nil?: true
@@ -127,7 +128,7 @@ module EInvoiceAPI
127
128
  #
128
129
  # @param company_number [String, nil] Company number. For Belgium this is the CBE number or their EUID (European Uniqu
129
130
  #
130
- # @param company_tax_id [String, nil] Company tax ID. For Belgium this is the VAT number. Must include the country pre
131
+ # @param company_tax_id [String, nil] Company tax ID (VAT number), including the country prefix. Stored in compact for
131
132
  #
132
133
  # @param company_zip [String, nil] Zip code of the company
133
134
  #
@@ -141,9 +142,9 @@ module EInvoiceAPI
141
142
  #
142
143
  # @param plan [Symbol, EInvoiceAPI::Models::MeRetrieveResponse::Plan] Plan of the tenant
143
144
  #
144
- # @param smp_registration [Boolean, nil] Whether the tenant is registered on our SMP
145
+ # @param smp_registration [Boolean, nil] Legacy field. Does not show whether a Peppol ID is published: it is usually `fal
145
146
  #
146
- # @param smp_registration_date [Time, nil] Date when the tenant was registered on SMP
147
+ # @param smp_registration_date [Time, nil] Legacy field. Does not show whether or when a Peppol ID was published.
147
148
 
148
149
  # Plan of the tenant
149
150
  #
@@ -4,7 +4,9 @@ module EInvoiceAPI
4
4
  module Models
5
5
  class PaymentDetailCreate < EInvoiceAPI::Internal::Type::BaseModel
6
6
  # @!attribute bank_account_number
7
- # Bank account number (for non-IBAN accounts)
7
+ # Bank account number (for non-IBAN accounts). With `swift` `SE:BANKGIRO` or
8
+ # `SE:PLUSGIRO`, the bankgiro or plusgiro number, with `iban` left empty; spaces
9
+ # and hyphens are removed.
8
10
  #
9
11
  # @return [String, nil]
10
12
  optional :bank_account_number, String, nil?: true
@@ -23,7 +25,9 @@ module EInvoiceAPI
23
25
  optional :payment_reference, String, nil?: true
24
26
 
25
27
  # @!attribute swift
26
- # SWIFT/BIC code of the bank
28
+ # The payment service provider identifier (BT-86): the BIC of the payee's bank, or
29
+ # `SE:BANKGIRO` / `SE:PLUSGIRO` when `bank_account_number` is a Swedish bankgiro
30
+ # or plusgiro number.
27
31
  #
28
32
  # @return [String, nil]
29
33
  optional :swift, String, nil?: true
@@ -32,13 +36,13 @@ module EInvoiceAPI
32
36
  # Some parameter documentations has been truncated, see
33
37
  # {EInvoiceAPI::Models::PaymentDetailCreate} for more details.
34
38
  #
35
- # @param bank_account_number [String, nil] Bank account number (for non-IBAN accounts)
39
+ # @param bank_account_number [String, nil] Bank account number (for non-IBAN accounts). With `swift` `SE:BANKGIRO` or
36
40
  #
37
41
  # @param iban [String, nil] International Bank Account Number for payment transfers
38
42
  #
39
43
  # @param payment_reference [String, nil] Structured payment reference or communication (e.g., structured communication fo
40
44
  #
41
- # @param swift [String, nil] SWIFT/BIC code of the bank
45
+ # @param swift [String, nil] The payment service provider identifier (BT-86): the BIC of the payee's bank, or
42
46
  end
43
47
  end
44
48
  end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Stats#retrieve
6
+ class StatsRetrieveParams < EInvoiceAPI::Internal::Type::BaseModel
7
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
8
+ include EInvoiceAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute aggregation
11
+ # Aggregation type: DAY, WEEK, or MONTH. Defaults to DAY.
12
+ #
13
+ # @return [Symbol, EInvoiceAPI::Models::StatsRetrieveParams::Aggregation, nil]
14
+ optional :aggregation, enum: -> { EInvoiceAPI::StatsRetrieveParams::Aggregation }, nil?: true
15
+
16
+ # @!attribute end_date
17
+ # End date in yyyy-mm-dd format. If not provided, queries to latest available
18
+ # data.
19
+ #
20
+ # @return [Date, nil]
21
+ optional :end_date, Date, nil?: true
22
+
23
+ # @!attribute start_date
24
+ # Start date in yyyy-mm-dd format. If not provided, queries from earliest
25
+ # available data.
26
+ #
27
+ # @return [Date, nil]
28
+ optional :start_date, Date, nil?: true
29
+
30
+ # @!method initialize(aggregation: nil, end_date: nil, start_date: nil, request_options: {})
31
+ # Some parameter documentations has been truncated, see
32
+ # {EInvoiceAPI::Models::StatsRetrieveParams} for more details.
33
+ #
34
+ # @param aggregation [Symbol, EInvoiceAPI::Models::StatsRetrieveParams::Aggregation, nil] Aggregation type: DAY, WEEK, or MONTH. Defaults to DAY.
35
+ #
36
+ # @param end_date [Date, nil] End date in yyyy-mm-dd format. If not provided, queries to latest available data
37
+ #
38
+ # @param start_date [Date, nil] Start date in yyyy-mm-dd format. If not provided, queries from earliest availabl
39
+ #
40
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
41
+
42
+ # Aggregation type: DAY, WEEK, or MONTH. Defaults to DAY.
43
+ module Aggregation
44
+ extend EInvoiceAPI::Internal::Type::Enum
45
+
46
+ DAY = :DAY
47
+ WEEK = :WEEK
48
+ MONTH = :MONTH
49
+
50
+ # @!method self.values
51
+ # @return [Array<Symbol>]
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Stats#retrieve
6
+ class StatsRetrieveResponse < EInvoiceAPI::Internal::Type::BaseModel
7
+ # @!attribute actions
8
+ # List of action statistics, one entry per aggregation period per action
9
+ #
10
+ # @return [Array<EInvoiceAPI::Models::StatsRetrieveResponse::Action>]
11
+ required :actions,
12
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::Models::StatsRetrieveResponse::Action] }
13
+
14
+ # @!attribute aggregation
15
+ # Aggregation type used
16
+ #
17
+ # @return [Symbol, EInvoiceAPI::Models::StatsRetrieveResponse::Aggregation]
18
+ required :aggregation, enum: -> { EInvoiceAPI::Models::StatsRetrieveResponse::Aggregation }
19
+
20
+ # @!attribute average_daily_usage
21
+ # Average daily usage (total actions / total days)
22
+ #
23
+ # @return [Float]
24
+ required :average_daily_usage, Float
25
+
26
+ # @!attribute period_end
27
+ # End date of the period
28
+ #
29
+ # @return [Date]
30
+ required :period_end, Date
31
+
32
+ # @!attribute period_start
33
+ # Start date of the period
34
+ #
35
+ # @return [Date]
36
+ required :period_start, Date
37
+
38
+ # @!attribute tenant_id
39
+ # Tenant ID
40
+ #
41
+ # @return [String]
42
+ required :tenant_id, String
43
+
44
+ # @!attribute total_days
45
+ # Number of days in the period
46
+ #
47
+ # @return [Integer]
48
+ required :total_days, Integer
49
+
50
+ # @!attribute budget_estimation_days
51
+ # Estimated days until credits run out (credit_balance / average_daily_usage). 0.0
52
+ # if average_daily_usage is 0 or credit_balance is None
53
+ #
54
+ # @return [Float, nil]
55
+ optional :budget_estimation_days, Float
56
+
57
+ # @!method initialize(actions:, aggregation:, average_daily_usage:, period_end:, period_start:, tenant_id:, total_days:, budget_estimation_days: nil)
58
+ # Some parameter documentations has been truncated, see
59
+ # {EInvoiceAPI::Models::StatsRetrieveResponse} for more details.
60
+ #
61
+ # Statistics response for a tenant.
62
+ #
63
+ # @param actions [Array<EInvoiceAPI::Models::StatsRetrieveResponse::Action>] List of action statistics, one entry per aggregation period per action
64
+ #
65
+ # @param aggregation [Symbol, EInvoiceAPI::Models::StatsRetrieveResponse::Aggregation] Aggregation type used
66
+ #
67
+ # @param average_daily_usage [Float] Average daily usage (total actions / total days)
68
+ #
69
+ # @param period_end [Date] End date of the period
70
+ #
71
+ # @param period_start [Date] Start date of the period
72
+ #
73
+ # @param tenant_id [String] Tenant ID
74
+ #
75
+ # @param total_days [Integer] Number of days in the period
76
+ #
77
+ # @param budget_estimation_days [Float] Estimated days until credits run out (credit_balance / average_daily_usage). 0.0
78
+
79
+ class Action < EInvoiceAPI::Internal::Type::BaseModel
80
+ # @!attribute action
81
+ # Type of action
82
+ #
83
+ # @return [Symbol, EInvoiceAPI::Models::StatsRetrieveResponse::Action::Action]
84
+ required :action, enum: -> { EInvoiceAPI::Models::StatsRetrieveResponse::Action::Action }
85
+
86
+ # @!attribute count
87
+ # Number of occurrences of this action in this period
88
+ #
89
+ # @return [Integer]
90
+ required :count, Integer
91
+
92
+ # @!attribute stat_date
93
+ # The date/period this stat represents. For DAY aggregation this is the specific
94
+ # day, for WEEK it's the start of the week, for MONTH it's the first day of the
95
+ # month
96
+ #
97
+ # @return [Date]
98
+ required :stat_date, Date
99
+
100
+ # @!method initialize(action:, count:, stat_date:)
101
+ # Some parameter documentations has been truncated, see
102
+ # {EInvoiceAPI::Models::StatsRetrieveResponse::Action} for more details.
103
+ #
104
+ # Statistics for a specific action in a specific time period.
105
+ #
106
+ # @param action [Symbol, EInvoiceAPI::Models::StatsRetrieveResponse::Action::Action] Type of action
107
+ #
108
+ # @param count [Integer] Number of occurrences of this action in this period
109
+ #
110
+ # @param stat_date [Date] The date/period this stat represents. For DAY aggregation this is the specific d
111
+
112
+ # Type of action
113
+ #
114
+ # @see EInvoiceAPI::Models::StatsRetrieveResponse::Action#action
115
+ module Action
116
+ extend EInvoiceAPI::Internal::Type::Enum
117
+
118
+ DOCUMENT_SENT = :DOCUMENT_SENT
119
+ DOCUMENT_RECEIVED = :DOCUMENT_RECEIVED
120
+
121
+ # @!method self.values
122
+ # @return [Array<Symbol>]
123
+ end
124
+ end
125
+
126
+ # Aggregation type used
127
+ #
128
+ # @see EInvoiceAPI::Models::StatsRetrieveResponse#aggregation
129
+ module Aggregation
130
+ extend EInvoiceAPI::Internal::Type::Enum
131
+
132
+ DAY = :DAY
133
+ WEEK = :WEEK
134
+ MONTH = :MONTH
135
+
136
+ # @!method self.values
137
+ # @return [Array<Symbol>]
138
+ end
139
+ end
140
+ end
141
+ end
@@ -25,16 +25,25 @@ module EInvoiceAPI
25
25
  required :issues, -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::UblDocumentValidation::Issue] }
26
26
 
27
27
  # @!attribute ubl_document
28
+ # The UBL document as an XML string, returned whenever it could be generated, also
29
+ # when the document is not valid. Only is_valid tells whether it is valid.
28
30
  #
29
31
  # @return [String, nil]
30
32
  optional :ubl_document, String, nil?: true
31
33
 
32
34
  # @!method initialize(id:, file_name:, is_valid:, issues:, ubl_document: nil)
35
+ # Some parameter documentations has been truncated, see
36
+ # {EInvoiceAPI::Models::UblDocumentValidation} for more details.
37
+ #
33
38
  # @param id [String]
39
+ #
34
40
  # @param file_name [String, nil]
41
+ #
35
42
  # @param is_valid [Boolean]
43
+ #
36
44
  # @param issues [Array<EInvoiceAPI::Models::UblDocumentValidation::Issue>]
37
- # @param ubl_document [String, nil]
45
+ #
46
+ # @param ubl_document [String, nil] The UBL document as an XML string, returned whenever it could be generated, also
38
47
 
39
48
  class Issue < EInvoiceAPI::Internal::Type::BaseModel
40
49
  # @!attribute message