e-invoice-api 0.33.0 → 0.34.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 (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/e_invoice_api/client.rb +16 -0
  5. data/lib/e_invoice_api/models/conversion/document_create_from_pdf_task.rb +43 -0
  6. data/lib/e_invoice_api/models/conversion/pdf_create_params.rb +22 -0
  7. data/lib/e_invoice_api/models/conversion/pdf_result_params.rb +22 -0
  8. data/lib/e_invoice_api/models/conversion/pdf_retrieve_params.rb +22 -0
  9. data/lib/e_invoice_api/models/document_create.rb +158 -5
  10. data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +108 -5
  11. data/lib/e_invoice_api/models/document_lifecycle_params.rb +20 -0
  12. data/lib/e_invoice_api/models/document_lifecycle_response.rb +134 -0
  13. data/lib/e_invoice_api/models/document_response.rb +112 -7
  14. data/lib/e_invoice_api/models/document_timeline_params.rb +20 -0
  15. data/lib/e_invoice_api/models/document_timeline_response.rb +71 -0
  16. data/lib/e_invoice_api/models/draft_list_params.rb +113 -0
  17. data/lib/e_invoice_api/models/inbound_email_response.rb +129 -0
  18. data/lib/e_invoice_api/models/mailbox_download_attachment_params.rb +26 -0
  19. data/lib/e_invoice_api/models/mailbox_list_params.rb +129 -0
  20. data/lib/e_invoice_api/models/mailbox_reprocess_params.rb +20 -0
  21. data/lib/e_invoice_api/models/mailbox_retrieve_params.rb +20 -0
  22. data/lib/e_invoice_api/models/me_retrieve_response.rb +8 -7
  23. data/lib/e_invoice_api/models/payment_detail_create.rb +4 -2
  24. data/lib/e_invoice_api/models/stats_retrieve_params.rb +55 -0
  25. data/lib/e_invoice_api/models/stats_retrieve_response.rb +141 -0
  26. data/lib/e_invoice_api/models/ubl_document_validation.rb +10 -1
  27. data/lib/e_invoice_api/models/webhook_history_params.rb +20 -0
  28. data/lib/e_invoice_api/models/webhook_history_response.rb +17 -0
  29. data/lib/e_invoice_api/models/webhook_test_params.rb +37 -0
  30. data/lib/e_invoice_api/models/webhook_test_response.rb +35 -0
  31. data/lib/e_invoice_api/models.rb +24 -0
  32. data/lib/e_invoice_api/resources/conversion/pdf.rb +76 -0
  33. data/lib/e_invoice_api/resources/conversion.rb +18 -0
  34. data/lib/e_invoice_api/resources/documents.rb +62 -1
  35. data/lib/e_invoice_api/resources/drafts.rb +55 -0
  36. data/lib/e_invoice_api/resources/mailbox.rb +123 -0
  37. data/lib/e_invoice_api/resources/stats.rb +47 -0
  38. data/lib/e_invoice_api/resources/validate.rb +22 -2
  39. data/lib/e_invoice_api/resources/webhooks.rb +45 -0
  40. data/lib/e_invoice_api/version.rb +1 -1
  41. data/lib/e_invoice_api.rb +25 -0
  42. data/rbi/e_invoice_api/client.rbi +12 -0
  43. data/rbi/e_invoice_api/models/conversion/document_create_from_pdf_task.rbi +108 -0
  44. data/rbi/e_invoice_api/models/conversion/pdf_create_params.rbi +43 -0
  45. data/rbi/e_invoice_api/models/conversion/pdf_result_params.rbi +40 -0
  46. data/rbi/e_invoice_api/models/conversion/pdf_retrieve_params.rbi +40 -0
  47. data/rbi/e_invoice_api/models/document_create.rbi +210 -3
  48. data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +124 -3
  49. data/rbi/e_invoice_api/models/document_lifecycle_params.rbi +38 -0
  50. data/rbi/e_invoice_api/models/document_lifecycle_response.rbi +353 -0
  51. data/rbi/e_invoice_api/models/document_response.rbi +130 -5
  52. data/rbi/e_invoice_api/models/document_timeline_params.rbi +38 -0
  53. data/rbi/e_invoice_api/models/document_timeline_response.rbi +168 -0
  54. data/rbi/e_invoice_api/models/draft_list_params.rbi +194 -0
  55. data/rbi/e_invoice_api/models/inbound_email_response.rbi +189 -0
  56. data/rbi/e_invoice_api/models/mailbox_download_attachment_params.rbi +46 -0
  57. data/rbi/e_invoice_api/models/mailbox_list_params.rbi +218 -0
  58. data/rbi/e_invoice_api/models/mailbox_reprocess_params.rbi +41 -0
  59. data/rbi/e_invoice_api/models/mailbox_retrieve_params.rbi +41 -0
  60. data/rbi/e_invoice_api/models/me_retrieve_response.rbi +10 -8
  61. data/rbi/e_invoice_api/models/payment_detail_create.rbi +6 -2
  62. data/rbi/e_invoice_api/models/stats_retrieve_params.rbi +111 -0
  63. data/rbi/e_invoice_api/models/stats_retrieve_response.rbi +251 -0
  64. data/rbi/e_invoice_api/models/ubl_document_validation.rbi +11 -1
  65. data/rbi/e_invoice_api/models/webhook_history_params.rbi +38 -0
  66. data/rbi/e_invoice_api/models/webhook_history_response.rbi +32 -0
  67. data/rbi/e_invoice_api/models/webhook_test_params.rbi +57 -0
  68. data/rbi/e_invoice_api/models/webhook_test_response.rbi +57 -0
  69. data/rbi/e_invoice_api/models.rbi +25 -0
  70. data/rbi/e_invoice_api/resources/conversion/pdf.rbi +44 -0
  71. data/rbi/e_invoice_api/resources/conversion.rbi +15 -0
  72. data/rbi/e_invoice_api/resources/documents.rbi +67 -0
  73. data/rbi/e_invoice_api/resources/drafts.rbi +55 -0
  74. data/rbi/e_invoice_api/resources/mailbox.rbi +93 -0
  75. data/rbi/e_invoice_api/resources/stats.rbi +38 -0
  76. data/rbi/e_invoice_api/resources/validate.rbi +44 -1
  77. data/rbi/e_invoice_api/resources/webhooks.rbi +29 -0
  78. data/sig/e_invoice_api/client.rbs +8 -0
  79. data/sig/e_invoice_api/models/conversion/document_create_from_pdf_task.rbs +45 -0
  80. data/sig/e_invoice_api/models/conversion/pdf_create_params.rbs +26 -0
  81. data/sig/e_invoice_api/models/conversion/pdf_result_params.rbs +25 -0
  82. data/sig/e_invoice_api/models/conversion/pdf_retrieve_params.rbs +25 -0
  83. data/sig/e_invoice_api/models/document_create.rbs +87 -4
  84. data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +61 -4
  85. data/sig/e_invoice_api/models/document_lifecycle_params.rbs +23 -0
  86. data/sig/e_invoice_api/models/document_lifecycle_response.rbs +151 -0
  87. data/sig/e_invoice_api/models/document_response.rbs +61 -4
  88. data/sig/e_invoice_api/models/document_timeline_params.rbs +23 -0
  89. data/sig/e_invoice_api/models/document_timeline_response.rbs +84 -0
  90. data/sig/e_invoice_api/models/draft_list_params.rbs +112 -0
  91. data/sig/e_invoice_api/models/inbound_email_response.rbs +126 -0
  92. data/sig/e_invoice_api/models/mailbox_download_attachment_params.rbs +28 -0
  93. data/sig/e_invoice_api/models/mailbox_list_params.rbs +112 -0
  94. data/sig/e_invoice_api/models/mailbox_reprocess_params.rbs +24 -0
  95. data/sig/e_invoice_api/models/mailbox_retrieve_params.rbs +24 -0
  96. data/sig/e_invoice_api/models/stats_retrieve_params.rbs +48 -0
  97. data/sig/e_invoice_api/models/stats_retrieve_response.rbs +107 -0
  98. data/sig/e_invoice_api/models/webhook_history_params.rbs +23 -0
  99. data/sig/e_invoice_api/models/webhook_history_response.rbs +13 -0
  100. data/sig/e_invoice_api/models/webhook_test_params.rbs +32 -0
  101. data/sig/e_invoice_api/models/webhook_test_response.rbs +30 -0
  102. data/sig/e_invoice_api/models.rbs +24 -0
  103. data/sig/e_invoice_api/resources/conversion/pdf.rbs +24 -0
  104. data/sig/e_invoice_api/resources/conversion.rbs +9 -0
  105. data/sig/e_invoice_api/resources/documents.rbs +19 -0
  106. data/sig/e_invoice_api/resources/drafts.rbs +20 -0
  107. data/sig/e_invoice_api/resources/mailbox.rbs +36 -0
  108. data/sig/e_invoice_api/resources/stats.rbs +14 -0
  109. data/sig/e_invoice_api/resources/validate.rbs +9 -0
  110. data/sig/e_invoice_api/resources/webhooks.rbs +12 -0
  111. metadata +77 -2
@@ -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
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Webhooks#history
6
+ class WebhookHistoryParams < EInvoiceAPI::Internal::Type::BaseModel
7
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
8
+ include EInvoiceAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute webhook_id
11
+ #
12
+ # @return [String]
13
+ required :webhook_id, String
14
+
15
+ # @!method initialize(webhook_id:, request_options: {})
16
+ # @param webhook_id [String]
17
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Webhooks#history
6
+ class WebhookHistoryResponse < EInvoiceAPI::Internal::Type::BaseModel
7
+ # @!attribute history
8
+ #
9
+ # @return [Array<Hash{Symbol=>Object}>]
10
+ required :history,
11
+ EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::Internal::Type::HashOf[EInvoiceAPI::Internal::Type::Unknown]]
12
+
13
+ # @!method initialize(history:)
14
+ # @param history [Array<Hash{Symbol=>Object}>]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Webhooks#test_
6
+ class WebhookTestParams < EInvoiceAPI::Internal::Type::BaseModel
7
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
8
+ include EInvoiceAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute webhook_id
11
+ #
12
+ # @return [String]
13
+ required :webhook_id, String
14
+
15
+ # @!attribute data
16
+ # Custom event data payload
17
+ #
18
+ # @return [Hash{Symbol=>Object}]
19
+ required :data, EInvoiceAPI::Internal::Type::HashOf[EInvoiceAPI::Internal::Type::Unknown]
20
+
21
+ # @!attribute event_type
22
+ # Must be valid WebhookEventType
23
+ #
24
+ # @return [String]
25
+ required :event_type, String
26
+
27
+ # @!method initialize(webhook_id:, data:, event_type:, request_options: {})
28
+ # @param webhook_id [String]
29
+ #
30
+ # @param data [Hash{Symbol=>Object}] Custom event data payload
31
+ #
32
+ # @param event_type [String] Must be valid WebhookEventType
33
+ #
34
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Webhooks#test_
6
+ class WebhookTestResponse < EInvoiceAPI::Internal::Type::BaseModel
7
+ # @!attribute message
8
+ # Descriptive message about the test result
9
+ #
10
+ # @return [String]
11
+ required :message, String
12
+
13
+ # @!attribute success
14
+ # Whether the test completed successfully
15
+ #
16
+ # @return [Boolean]
17
+ required :success, EInvoiceAPI::Internal::Type::Boolean
18
+
19
+ # @!attribute webhook_delivery_result
20
+ # Result from process_webhook_task
21
+ #
22
+ # @return [Hash{Symbol=>Object}]
23
+ required :webhook_delivery_result, EInvoiceAPI::Internal::Type::HashOf[EInvoiceAPI::Internal::Type::Unknown]
24
+
25
+ # @!method initialize(message:, success:, webhook_delivery_result:)
26
+ # Schema for webhook test response.
27
+ #
28
+ # @param message [String] Descriptive message about the test result
29
+ #
30
+ # @param success [Boolean] Whether the test completed successfully
31
+ #
32
+ # @param webhook_delivery_result [Hash{Symbol=>Object}] Result from process_webhook_task
33
+ end
34
+ end
35
+ end
@@ -45,6 +45,8 @@ module EInvoiceAPI
45
45
 
46
46
  Charge = EInvoiceAPI::Models::Charge
47
47
 
48
+ Conversion = EInvoiceAPI::Models::Conversion
49
+
48
50
  CurrencyCode = EInvoiceAPI::Models::CurrencyCode
49
51
 
50
52
  DocumentAttachmentCreate = EInvoiceAPI::Models::DocumentAttachmentCreate
@@ -59,6 +61,8 @@ module EInvoiceAPI
59
61
 
60
62
  DocumentDirection = EInvoiceAPI::Models::DocumentDirection
61
63
 
64
+ DocumentLifecycleParams = EInvoiceAPI::Models::DocumentLifecycleParams
65
+
62
66
  DocumentResponse = EInvoiceAPI::Models::DocumentResponse
63
67
 
64
68
  DocumentRetrieveParams = EInvoiceAPI::Models::DocumentRetrieveParams
@@ -69,10 +73,16 @@ module EInvoiceAPI
69
73
 
70
74
  DocumentState = EInvoiceAPI::Models::DocumentState
71
75
 
76
+ DocumentTimelineParams = EInvoiceAPI::Models::DocumentTimelineParams
77
+
72
78
  DocumentType = EInvoiceAPI::Models::DocumentType
73
79
 
74
80
  DocumentValidateParams = EInvoiceAPI::Models::DocumentValidateParams
75
81
 
82
+ DraftListParams = EInvoiceAPI::Models::DraftListParams
83
+
84
+ InboundEmailResponse = EInvoiceAPI::Models::InboundEmailResponse
85
+
76
86
  InboxListCreditNotesParams = EInvoiceAPI::Models::InboxListCreditNotesParams
77
87
 
78
88
  InboxListInvoicesParams = EInvoiceAPI::Models::InboxListInvoicesParams
@@ -83,6 +93,14 @@ module EInvoiceAPI
83
93
 
84
94
  LookupRetrieveParticipantsParams = EInvoiceAPI::Models::LookupRetrieveParticipantsParams
85
95
 
96
+ MailboxDownloadAttachmentParams = EInvoiceAPI::Models::MailboxDownloadAttachmentParams
97
+
98
+ MailboxListParams = EInvoiceAPI::Models::MailboxListParams
99
+
100
+ MailboxReprocessParams = EInvoiceAPI::Models::MailboxReprocessParams
101
+
102
+ MailboxRetrieveParams = EInvoiceAPI::Models::MailboxRetrieveParams
103
+
86
104
  MeRetrieveParams = EInvoiceAPI::Models::MeRetrieveParams
87
105
 
88
106
  OutboxListDraftDocumentsParams = EInvoiceAPI::Models::OutboxListDraftDocumentsParams
@@ -93,6 +111,8 @@ module EInvoiceAPI
93
111
 
94
112
  PaymentDetailCreate = EInvoiceAPI::Models::PaymentDetailCreate
95
113
 
114
+ StatsRetrieveParams = EInvoiceAPI::Models::StatsRetrieveParams
115
+
96
116
  UblDocumentValidation = EInvoiceAPI::Models::UblDocumentValidation
97
117
 
98
118
  UnitOfMeasureCode = EInvoiceAPI::Models::UnitOfMeasureCode
@@ -107,11 +127,15 @@ module EInvoiceAPI
107
127
 
108
128
  WebhookDeleteParams = EInvoiceAPI::Models::WebhookDeleteParams
109
129
 
130
+ WebhookHistoryParams = EInvoiceAPI::Models::WebhookHistoryParams
131
+
110
132
  WebhookListParams = EInvoiceAPI::Models::WebhookListParams
111
133
 
112
134
  WebhookResponse = EInvoiceAPI::Models::WebhookResponse
113
135
 
114
136
  WebhookRetrieveParams = EInvoiceAPI::Models::WebhookRetrieveParams
115
137
 
138
+ WebhookTestParams = EInvoiceAPI::Models::WebhookTestParams
139
+
116
140
  WebhookUpdateParams = EInvoiceAPI::Models::WebhookUpdateParams
117
141
  end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Resources
5
+ class Conversion
6
+ class Pdf
7
+ # Convert a PDF to a document
8
+ #
9
+ # @overload create(file:, request_options: {})
10
+ #
11
+ # @param file [Pathname, StringIO, IO, String, EInvoiceAPI::FilePart]
12
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
13
+ #
14
+ # @return [EInvoiceAPI::Models::Conversion::DocumentCreateFromPdfTask]
15
+ #
16
+ # @see EInvoiceAPI::Models::Conversion::PdfCreateParams
17
+ def create(params)
18
+ parsed, options = EInvoiceAPI::Conversion::PdfCreateParams.dump_request(params)
19
+ @client.request(
20
+ method: :post,
21
+ path: "api/conversion/pdf",
22
+ headers: {"content-type" => "multipart/form-data"},
23
+ body: parsed,
24
+ model: EInvoiceAPI::Conversion::DocumentCreateFromPdfTask,
25
+ options: options
26
+ )
27
+ end
28
+
29
+ # Get the status of a PDF conversion task
30
+ #
31
+ # @overload retrieve(task_id, request_options: {})
32
+ #
33
+ # @param task_id [String]
34
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
35
+ #
36
+ # @return [EInvoiceAPI::Models::Conversion::DocumentCreateFromPdfTask]
37
+ #
38
+ # @see EInvoiceAPI::Models::Conversion::PdfRetrieveParams
39
+ def retrieve(task_id, params = {})
40
+ @client.request(
41
+ method: :get,
42
+ path: ["api/conversion/pdf/%1$s", task_id],
43
+ model: EInvoiceAPI::Conversion::DocumentCreateFromPdfTask,
44
+ options: params[:request_options]
45
+ )
46
+ end
47
+
48
+ # Get the result of a PDF conversion task
49
+ #
50
+ # @overload result(task_id, request_options: {})
51
+ #
52
+ # @param task_id [String]
53
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
54
+ #
55
+ # @return [EInvoiceAPI::Models::DocumentCreateFromPdfResponse]
56
+ #
57
+ # @see EInvoiceAPI::Models::Conversion::PdfResultParams
58
+ def result(task_id, params = {})
59
+ @client.request(
60
+ method: :get,
61
+ path: ["api/conversion/pdf/%1$s/result", task_id],
62
+ model: EInvoiceAPI::Models::DocumentCreateFromPdfResponse,
63
+ options: params[:request_options]
64
+ )
65
+ end
66
+
67
+ # @api private
68
+ #
69
+ # @param client [EInvoiceAPI::Client]
70
+ def initialize(client:)
71
+ @client = client
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Resources
5
+ class Conversion
6
+ # @return [EInvoiceAPI::Resources::Conversion::Pdf]
7
+ attr_reader :pdf
8
+
9
+ # @api private
10
+ #
11
+ # @param client [EInvoiceAPI::Client]
12
+ def initialize(client:)
13
+ @client = client
14
+ @pdf = EInvoiceAPI::Resources::Conversion::Pdf.new(client: client)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -14,7 +14,7 @@ module EInvoiceAPI
14
14
  #
15
15
  # Create a new invoice or credit note
16
16
  #
17
- # @overload create(construct_pdf: nil, allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_company_id: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_peppol_id: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_company_id: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil, request_options: {})
17
+ # @overload create(construct_pdf: nil, allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, buyer_reference: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_company_id: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_peppol_id: nil, customer_phone: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, preceding_invoice_date: nil, preceding_invoice_id: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, rounding_amount: nil, sales_order: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_currency: nil, tax_details: nil, total_discount: nil, total_tax: nil, total_tax_in_tax_currency: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_company_id: nil, vendor_email: nil, vendor_name: nil, vendor_phone: nil, vendor_tax_id: nil, request_options: {})
18
18
  #
19
19
  # @param construct_pdf [Boolean] Query param: If true, generate a constructed PDF from the document and include i
20
20
  #
@@ -28,6 +28,8 @@ module EInvoiceAPI
28
28
  #
29
29
  # @param billing_address_recipient [String, nil] Body param: The recipient name at the billing address
30
30
  #
31
+ # @param buyer_reference [String, nil] Body param: The buyer reference (BT-10), e.g. a cost centre or accounting refere
32
+ #
31
33
  # @param charges [Array<EInvoiceAPI::Models::DocumentCreate::Charge>, nil] Body param
32
34
  #
33
35
  # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Body param: Currency of the invoice (ISO 4217 currency code)
@@ -46,6 +48,8 @@ module EInvoiceAPI
46
48
  #
47
49
  # @param customer_peppol_id [String, nil] Body param: Customer Peppol ID
48
50
  #
51
+ # @param customer_phone [String, nil] Body param: The telephone number of the customer contact (BT-57)
52
+ #
49
53
  # @param customer_tax_id [String, nil] Body param: Customer tax ID. For Belgium this is the VAT number. Must include th
50
54
  #
51
55
  # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection] Body param: The direction of the document: INBOUND (purchases) or OUTBOUND (sale
@@ -68,6 +72,10 @@ module EInvoiceAPI
68
72
  #
69
73
  # @param payment_term [String, nil] Body param: The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
70
74
  #
75
+ # @param preceding_invoice_date [Date, nil] Body param: The preceding invoice issue date (BT-26)
76
+ #
77
+ # @param preceding_invoice_id [String, nil] Body param: The preceding invoice reference (BT-25): the number of the invoice t
78
+ #
71
79
  # @param previous_unpaid_balance [Float, String, nil] Body param: The previous unpaid balance from prior invoices, if any. Must be pos
72
80
  #
73
81
  # @param purchase_order [String, nil] Body param: The purchase order reference number
@@ -76,6 +84,10 @@ module EInvoiceAPI
76
84
  #
77
85
  # @param remittance_address_recipient [String, nil] Body param: The recipient name at the remittance address
78
86
  #
87
+ # @param rounding_amount [Float, String, nil] Body param: The amount added to the invoice total to round the amount for paymen
88
+ #
89
+ # @param sales_order [String, nil] Body param: The sales order reference (BT-14) assigned by the seller
90
+ #
79
91
  # @param service_address [String, nil] Body param: The address where services were performed or goods were delivered
80
92
  #
81
93
  # @param service_address_recipient [String, nil] Body param: The recipient name at the service address
@@ -94,12 +106,16 @@ module EInvoiceAPI
94
106
  #
95
107
  # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::TaxCode] Body param: Tax category code of the invoice (e.g., S for standard rate, Z for z
96
108
  #
109
+ # @param tax_currency [String, nil] Body param: The VAT accounting currency (BT-6, ISO 4217 currency code), when VAT
110
+ #
97
111
  # @param tax_details [Array<EInvoiceAPI::Models::DocumentCreate::TaxDetail>, nil] Body param
98
112
  #
99
113
  # @param total_discount [Float, String, nil] Body param: The net financial discount/charge of the invoice (non-VAT charges mi
100
114
  #
101
115
  # @param total_tax [Float, String, nil] Body param: The total tax amount of the invoice. Must be positive and rounded to
102
116
  #
117
+ # @param total_tax_in_tax_currency [Float, String, nil] Body param: The total VAT amount in the VAT accounting currency tax_currency (BT
118
+ #
103
119
  # @param vatex [Symbol, EInvoiceAPI::Models::DocumentCreate::Vatex, nil] Body param: VATEX code list for VAT exemption reasons
104
120
  #
105
121
  # @param vatex_note [String, nil] Body param: Textual explanation for VAT exemption
@@ -114,6 +130,8 @@ module EInvoiceAPI
114
130
  #
115
131
  # @param vendor_name [String, nil] Body param: The name of the vendor/seller/supplier
116
132
  #
133
+ # @param vendor_phone [String, nil] Body param: The telephone number of the vendor contact (BT-42). Required when ve
134
+ #
117
135
  # @param vendor_tax_id [String, nil] Body param: Vendor tax ID. For Belgium this is the VAT number. Must include the
118
136
  #
119
137
  # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -258,6 +276,49 @@ module EInvoiceAPI
258
276
  )
259
277
  end
260
278
 
279
+ # Get the timeline of events for an invoice or credit note, including creation,
280
+ # validation, transmission, and delivery events
281
+ #
282
+ # @overload timeline(document_id, request_options: {})
283
+ #
284
+ # @param document_id [String]
285
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
286
+ #
287
+ # @return [EInvoiceAPI::Models::DocumentTimelineResponse]
288
+ #
289
+ # @see EInvoiceAPI::Models::DocumentTimelineParams
290
+ def timeline(document_id, params = {})
291
+ @client.request(
292
+ method: :get,
293
+ path: ["api/documents/%1$s/timeline", document_id],
294
+ model: EInvoiceAPI::Models::DocumentTimelineResponse,
295
+ options: params[:request_options]
296
+ )
297
+ end
298
+
299
+ # Get the lifecycle events stated about an invoice or credit note after creation
300
+ # (Peppol Message Level and Invoice Responses, partner status events), oldest
301
+ # first. Each event carries a route-agnostic canonical status next to the
302
+ # untouched native code of its source; native codes without a canonical equivalent
303
+ # have canonical_status null.
304
+ #
305
+ # @overload lifecycle(document_id, request_options: {})
306
+ #
307
+ # @param document_id [String]
308
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
309
+ #
310
+ # @return [EInvoiceAPI::Models::DocumentLifecycleResponse]
311
+ #
312
+ # @see EInvoiceAPI::Models::DocumentLifecycleParams
313
+ def lifecycle(document_id, params = {})
314
+ @client.request(
315
+ method: :get,
316
+ path: ["api/documents/%1$s/lifecycle", document_id],
317
+ model: EInvoiceAPI::Models::DocumentLifecycleResponse,
318
+ options: params[:request_options]
319
+ )
320
+ end
321
+
261
322
  # @api private
262
323
  #
263
324
  # @param client [EInvoiceAPI::Client]
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Resources
5
+ class Drafts
6
+ # Retrieve a paginated list of draft documents with filtering options including
7
+ # state and text search.
8
+ #
9
+ # @overload list(date_from: nil, date_to: nil, page: nil, page_size: nil, search: nil, sort_by: nil, sort_order: nil, state: nil, type: nil, request_options: {})
10
+ #
11
+ # @param date_from [Time, nil] Filter by issue date (from)
12
+ #
13
+ # @param date_to [Time, nil] Filter by issue date (to)
14
+ #
15
+ # @param page [Integer] Page number
16
+ #
17
+ # @param page_size [Integer] Number of items per page
18
+ #
19
+ # @param search [String, nil] Search in invoice number, seller/buyer names
20
+ #
21
+ # @param sort_by [Symbol, EInvoiceAPI::Models::DraftListParams::SortBy] Field to sort by
22
+ #
23
+ # @param sort_order [Symbol, EInvoiceAPI::Models::DraftListParams::SortOrder] Sort direction (asc/desc)
24
+ #
25
+ # @param state [Symbol, EInvoiceAPI::Models::DocumentState, nil] Filter by document state. By default return all states (DRAFT, TRANSIT, FAILED).
26
+ #
27
+ # @param type [Symbol, EInvoiceAPI::Models::DocumentType, nil] Filter by document type
28
+ #
29
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
30
+ #
31
+ # @return [EInvoiceAPI::Internal::DocumentsNumberPage<EInvoiceAPI::Models::DocumentResponse>]
32
+ #
33
+ # @see EInvoiceAPI::Models::DraftListParams
34
+ def list(params = {})
35
+ parsed, options = EInvoiceAPI::DraftListParams.dump_request(params)
36
+ query = EInvoiceAPI::Internal::Util.encode_query_params(parsed)
37
+ @client.request(
38
+ method: :get,
39
+ path: "api/drafts/",
40
+ query: query,
41
+ page: EInvoiceAPI::Internal::DocumentsNumberPage,
42
+ model: EInvoiceAPI::DocumentResponse,
43
+ options: options
44
+ )
45
+ end
46
+
47
+ # @api private
48
+ #
49
+ # @param client [EInvoiceAPI::Client]
50
+ def initialize(client:)
51
+ @client = client
52
+ end
53
+ end
54
+ end
55
+ end