@emilgroup/accounting-sdk-node 1.32.1-beta.1 → 1.32.1-beta.100

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 (179) hide show
  1. package/.openapi-generator/FILES +37 -0
  2. package/README.md +2 -2
  3. package/api/accounting-configs-api.ts +158 -28
  4. package/api/booking-entries-api.ts +252 -13
  5. package/api/commission-account-mappings-api.ts +1235 -0
  6. package/api/financial-accounts-api.ts +169 -24
  7. package/api/financial-transactions-api.ts +16 -6
  8. package/api/health-api.ts +1 -1
  9. package/api/number-ranges-api.ts +32 -12
  10. package/api/personal-accounts-api.ts +32 -12
  11. package/api/product-account-mappings-api.ts +1755 -0
  12. package/api.ts +4 -0
  13. package/base.ts +4 -0
  14. package/common.ts +3 -2
  15. package/dist/api/accounting-configs-api.d.ts +54 -7
  16. package/dist/api/accounting-configs-api.js +206 -63
  17. package/dist/api/booking-entries-api.d.ts +121 -7
  18. package/dist/api/booking-entries-api.js +241 -26
  19. package/dist/api/commission-account-mappings-api.d.ts +685 -0
  20. package/dist/api/commission-account-mappings-api.js +1055 -0
  21. package/dist/api/financial-accounts-api.d.ts +82 -16
  22. package/dist/api/financial-accounts-api.js +168 -40
  23. package/dist/api/financial-transactions-api.d.ts +2 -2
  24. package/dist/api/financial-transactions-api.js +22 -14
  25. package/dist/api/health-api.d.ts +1 -1
  26. package/dist/api/health-api.js +1 -1
  27. package/dist/api/number-ranges-api.d.ts +4 -4
  28. package/dist/api/number-ranges-api.js +52 -30
  29. package/dist/api/personal-accounts-api.d.ts +4 -4
  30. package/dist/api/personal-accounts-api.js +52 -30
  31. package/dist/api/product-account-mappings-api.d.ts +972 -0
  32. package/dist/api/product-account-mappings-api.js +1497 -0
  33. package/dist/api.d.ts +2 -0
  34. package/dist/api.js +2 -0
  35. package/dist/base.d.ts +1 -0
  36. package/dist/base.js +3 -0
  37. package/dist/common.d.ts +1 -1
  38. package/dist/common.js +1 -0
  39. package/dist/models/account-mapping-class.d.ts +2 -0
  40. package/dist/models/account-mapping-class.js +3 -1
  41. package/dist/models/accounting-config-class.d.ts +11 -0
  42. package/dist/models/accounting-config-class.js +5 -0
  43. package/dist/models/accounting-config-data-class.d.ts +7 -0
  44. package/dist/models/accounting-config-data-dto-default-account-mappings.d.ts +8 -0
  45. package/dist/models/accounting-config-data-dto-default-account-mappings.js +3 -1
  46. package/dist/models/accounting-config-data-dto.d.ts +7 -0
  47. package/dist/models/booking-entry-class.d.ts +35 -0
  48. package/dist/models/booking-entry-class.js +11 -1
  49. package/dist/models/commission-account-mapping-class.d.ts +49 -0
  50. package/dist/models/commission-account-mapping-class.js +15 -0
  51. package/dist/models/commission-agreement-account-mapping-detail-class.d.ts +44 -0
  52. package/dist/models/commission-agreement-account-mapping-detail-class.js +15 -0
  53. package/dist/models/commission-agreement-partner-class.d.ts +30 -0
  54. package/dist/models/commission-agreement-partner-class.js +15 -0
  55. package/dist/models/commission-agreement-with-account-mapping-class.d.ts +43 -0
  56. package/dist/models/commission-agreement-with-account-mapping-class.js +15 -0
  57. package/dist/models/commission-type-account-mapping-class.d.ts +31 -0
  58. package/dist/models/commission-type-account-mapping-class.js +15 -0
  59. package/dist/models/create-booking-entry-request-dto.d.ts +22 -0
  60. package/dist/models/create-booking-entry-request-dto.js +10 -0
  61. package/dist/models/create-financial-account-request-dto.d.ts +14 -0
  62. package/dist/models/create-financial-account-request-dto.js +3 -1
  63. package/dist/models/create-or-correct-opening-balance-dto.d.ts +25 -0
  64. package/dist/models/create-or-correct-opening-balance-dto.js +15 -0
  65. package/dist/models/create-or-correct-opening-balance-response-class.d.ts +25 -0
  66. package/dist/models/create-or-correct-opening-balance-response-class.js +15 -0
  67. package/dist/models/financial-account-class.d.ts +30 -1
  68. package/dist/models/financial-account-class.js +5 -1
  69. package/dist/models/financial-transaction-class.d.ts +6 -0
  70. package/dist/models/financial-transaction-data-dto.d.ts +7 -0
  71. package/dist/models/financial-transaction-data-dto.js +1 -0
  72. package/dist/models/get-activation-snapshot-response-class.d.ts +25 -0
  73. package/dist/models/get-activation-snapshot-response-class.js +15 -0
  74. package/dist/models/index.d.ts +35 -0
  75. package/dist/models/index.js +35 -0
  76. package/dist/models/list-commission-account-mappings-response-class.d.ts +43 -0
  77. package/dist/models/list-commission-account-mappings-response-class.js +15 -0
  78. package/dist/models/list-commission-agreements-with-account-mappings-response-class.d.ts +43 -0
  79. package/dist/models/list-commission-agreements-with-account-mappings-response-class.js +15 -0
  80. package/dist/models/list-commission-type-account-mappings-response-class.d.ts +43 -0
  81. package/dist/models/list-commission-type-account-mappings-response-class.js +15 -0
  82. package/dist/models/list-product-account-mappings-response-class.d.ts +43 -0
  83. package/dist/models/list-product-account-mappings-response-class.js +15 -0
  84. package/dist/models/list-products-with-account-mappings-response-class.d.ts +43 -0
  85. package/dist/models/list-products-with-account-mappings-response-class.js +15 -0
  86. package/dist/models/opening-balance-item-dto.d.ts +41 -0
  87. package/dist/models/opening-balance-item-dto.js +20 -0
  88. package/dist/models/personal-account-class.d.ts +6 -0
  89. package/dist/models/personal-account-range-class.d.ts +42 -0
  90. package/dist/models/personal-account-range-class.js +21 -0
  91. package/dist/models/personal-account-range-dto.d.ts +42 -0
  92. package/dist/models/personal-account-range-dto.js +21 -0
  93. package/dist/models/post-financial-event-request-dto.d.ts +46 -0
  94. package/dist/models/post-financial-event-request-dto.js +25 -0
  95. package/dist/models/post-financial-event-response-class.d.ts +25 -0
  96. package/dist/models/post-financial-event-response-class.js +15 -0
  97. package/dist/models/premium-item-account-mapping-class.d.ts +37 -0
  98. package/dist/models/premium-item-account-mapping-class.js +15 -0
  99. package/dist/models/product-account-mapping-class.d.ts +61 -0
  100. package/dist/models/product-account-mapping-class.js +15 -0
  101. package/dist/models/product-account-mapping-detail-class.d.ts +56 -0
  102. package/dist/models/product-account-mapping-detail-class.js +15 -0
  103. package/dist/models/product-risk-carrier-class.d.ts +42 -0
  104. package/dist/models/product-risk-carrier-class.js +15 -0
  105. package/dist/models/product-version-account-mapping-detail-class.d.ts +50 -0
  106. package/dist/models/product-version-account-mapping-detail-class.js +15 -0
  107. package/dist/models/product-version-with-account-mappings-class.d.ts +42 -0
  108. package/dist/models/product-version-with-account-mappings-class.js +15 -0
  109. package/dist/models/product-with-account-mappings-class.d.ts +49 -0
  110. package/dist/models/product-with-account-mappings-class.js +15 -0
  111. package/dist/models/put-premium-item-account-body-dto.d.ts +24 -0
  112. package/dist/models/put-premium-item-account-body-dto.js +15 -0
  113. package/dist/models/put-product-category-account-body-dto.d.ts +24 -0
  114. package/dist/models/put-product-category-account-body-dto.js +15 -0
  115. package/dist/models/put-product-risk-carrier-body-dto.d.ts +24 -0
  116. package/dist/models/put-product-risk-carrier-body-dto.js +15 -0
  117. package/dist/models/put-product-version-category-account-body-dto.d.ts +24 -0
  118. package/dist/models/put-product-version-category-account-body-dto.js +15 -0
  119. package/dist/models/resolved-account-mapping-class.d.ts +31 -0
  120. package/dist/models/resolved-account-mapping-class.js +15 -0
  121. package/dist/models/resolved-commission-account-mapping-class.d.ts +37 -0
  122. package/dist/models/resolved-commission-account-mapping-class.js +21 -0
  123. package/dist/models/update-commission-agreement-account-body-dto.d.ts +24 -0
  124. package/dist/models/update-commission-agreement-account-body-dto.js +15 -0
  125. package/dist/models/update-commission-type-account-body-dto.d.ts +24 -0
  126. package/dist/models/update-commission-type-account-body-dto.js +15 -0
  127. package/dist/models/update-financial-account-body-dto.d.ts +48 -0
  128. package/dist/models/update-financial-account-body-dto.js +15 -0
  129. package/dist/models/update-financial-account-response-class.d.ts +25 -0
  130. package/dist/models/update-financial-account-response-class.js +15 -0
  131. package/models/account-mapping-class.ts +3 -1
  132. package/models/accounting-config-class.ts +14 -0
  133. package/models/accounting-config-data-class.ts +7 -0
  134. package/models/accounting-config-data-dto-default-account-mappings.ts +9 -1
  135. package/models/accounting-config-data-dto.ts +7 -0
  136. package/models/booking-entry-class.ts +36 -0
  137. package/models/commission-account-mapping-class.ts +55 -0
  138. package/models/commission-agreement-account-mapping-detail-class.ts +50 -0
  139. package/models/commission-agreement-partner-class.ts +36 -0
  140. package/models/commission-agreement-with-account-mapping-class.ts +49 -0
  141. package/models/commission-type-account-mapping-class.ts +37 -0
  142. package/models/create-booking-entry-request-dto.ts +25 -0
  143. package/models/create-financial-account-request-dto.ts +15 -1
  144. package/models/create-or-correct-opening-balance-dto.ts +31 -0
  145. package/models/create-or-correct-opening-balance-response-class.ts +31 -0
  146. package/models/financial-account-class.ts +31 -1
  147. package/models/financial-transaction-class.ts +6 -0
  148. package/models/financial-transaction-data-dto.ts +7 -0
  149. package/models/get-activation-snapshot-response-class.ts +31 -0
  150. package/models/index.ts +35 -0
  151. package/models/list-commission-account-mappings-response-class.ts +49 -0
  152. package/models/list-commission-agreements-with-account-mappings-response-class.ts +49 -0
  153. package/models/list-commission-type-account-mappings-response-class.ts +49 -0
  154. package/models/list-product-account-mappings-response-class.ts +49 -0
  155. package/models/list-products-with-account-mappings-response-class.ts +49 -0
  156. package/models/opening-balance-item-dto.ts +50 -0
  157. package/models/personal-account-class.ts +6 -0
  158. package/models/personal-account-range-class.ts +51 -0
  159. package/models/personal-account-range-dto.ts +51 -0
  160. package/models/post-financial-event-request-dto.ts +55 -0
  161. package/models/post-financial-event-response-class.ts +31 -0
  162. package/models/premium-item-account-mapping-class.ts +43 -0
  163. package/models/product-account-mapping-class.ts +67 -0
  164. package/models/product-account-mapping-detail-class.ts +62 -0
  165. package/models/product-risk-carrier-class.ts +48 -0
  166. package/models/product-version-account-mapping-detail-class.ts +56 -0
  167. package/models/product-version-with-account-mappings-class.ts +48 -0
  168. package/models/product-with-account-mappings-class.ts +55 -0
  169. package/models/put-premium-item-account-body-dto.ts +30 -0
  170. package/models/put-product-category-account-body-dto.ts +30 -0
  171. package/models/put-product-risk-carrier-body-dto.ts +30 -0
  172. package/models/put-product-version-category-account-body-dto.ts +30 -0
  173. package/models/resolved-account-mapping-class.ts +37 -0
  174. package/models/resolved-commission-account-mapping-class.ts +46 -0
  175. package/models/update-commission-agreement-account-body-dto.ts +30 -0
  176. package/models/update-commission-type-account-body-dto.ts +30 -0
  177. package/models/update-financial-account-body-dto.ts +54 -0
  178. package/models/update-financial-account-response-class.ts +31 -0
  179. package/package.json +2 -2
@@ -107,9 +107,10 @@ var BookingEntriesApiAxiosParamCreator = function (configuration) {
107
107
  createBookingEntry: function (createBookingEntryRequestDto, authorization, options) {
108
108
  if (options === void 0) { options = {}; }
109
109
  return __awaiter(_this, void 0, void 0, function () {
110
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
111
- return __generator(this, function (_a) {
112
- switch (_a.label) {
110
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
111
+ var _a;
112
+ return __generator(this, function (_b) {
113
+ switch (_b.label) {
113
114
  case 0:
114
115
  // verify required parameter 'createBookingEntryRequestDto' is not null or undefined
115
116
  (0, common_1.assertParamExists)('createBookingEntry', 'createBookingEntryRequestDto', createBookingEntryRequestDto);
@@ -124,13 +125,19 @@ var BookingEntriesApiAxiosParamCreator = function (configuration) {
124
125
  localVarQueryParameter = {};
125
126
  // authentication bearer required
126
127
  // http bearer authentication required
127
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
128
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
129
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
130
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
131
+ ];
128
132
  case 1:
129
133
  // authentication bearer required
130
134
  // http bearer authentication required
131
- _a.sent();
132
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
133
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
135
+ _b.sent();
136
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
137
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
138
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
139
+ if (authorizationValue || authorizationKeepEmpty) {
140
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
134
141
  }
135
142
  localVarHeaderParameter['Content-Type'] = 'application/json';
136
143
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -145,6 +152,62 @@ var BookingEntriesApiAxiosParamCreator = function (configuration) {
145
152
  });
146
153
  });
147
154
  },
155
+ /**
156
+ * Enters or restates the confirmed opening balance for one or more accounts: a first-time entry for an account with no opening-balance history yet, a restatement for one that already has some. Each item carries the confirmed balance, not the delta; the service derives the delta itself and books it, per account, against the main-ledger bridge account. **Required Permissions** \"accounting-management.financial-accounts.create\"
157
+ * @summary Update the create or correct opening balance
158
+ * @param {CreateOrCorrectOpeningBalanceDto} createOrCorrectOpeningBalanceDto
159
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
160
+ * @param {*} [options] Override http request option.
161
+ * @throws {RequiredError}
162
+ */
163
+ createOrCorrectOpeningBalance: function (createOrCorrectOpeningBalanceDto, authorization, options) {
164
+ if (options === void 0) { options = {}; }
165
+ return __awaiter(_this, void 0, void 0, function () {
166
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
167
+ var _a;
168
+ return __generator(this, function (_b) {
169
+ switch (_b.label) {
170
+ case 0:
171
+ // verify required parameter 'createOrCorrectOpeningBalanceDto' is not null or undefined
172
+ (0, common_1.assertParamExists)('createOrCorrectOpeningBalance', 'createOrCorrectOpeningBalanceDto', createOrCorrectOpeningBalanceDto);
173
+ localVarPath = "/accountingservice/v1/booking-entries/opening-balances";
174
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
175
+ if (configuration) {
176
+ baseOptions = configuration.baseOptions;
177
+ baseAccessToken = configuration.accessToken;
178
+ }
179
+ localVarRequestOptions = __assign(__assign({ method: 'PUT' }, baseOptions), options);
180
+ localVarHeaderParameter = {};
181
+ localVarQueryParameter = {};
182
+ // authentication bearer required
183
+ // http bearer authentication required
184
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
185
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
186
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
187
+ ];
188
+ case 1:
189
+ // authentication bearer required
190
+ // http bearer authentication required
191
+ _b.sent();
192
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
193
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
194
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
195
+ if (authorizationValue || authorizationKeepEmpty) {
196
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
197
+ }
198
+ localVarHeaderParameter['Content-Type'] = 'application/json';
199
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
200
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
201
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
202
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createOrCorrectOpeningBalanceDto, localVarRequestOptions, configuration);
203
+ return [2 /*return*/, {
204
+ url: (0, common_1.toPathString)(localVarUrlObj),
205
+ options: localVarRequestOptions,
206
+ }];
207
+ }
208
+ });
209
+ });
210
+ },
148
211
  /**
149
212
  * This endpoint gets a booking entry. **Required Permissions** \"accounting-management.entries.view\"
150
213
  * @summary Retrieve the booking entry
@@ -157,9 +220,10 @@ var BookingEntriesApiAxiosParamCreator = function (configuration) {
157
220
  getBookingEntry: function (code, expand, authorization, options) {
158
221
  if (options === void 0) { options = {}; }
159
222
  return __awaiter(_this, void 0, void 0, function () {
160
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
161
- return __generator(this, function (_a) {
162
- switch (_a.label) {
223
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
224
+ var _a;
225
+ return __generator(this, function (_b) {
226
+ switch (_b.label) {
163
227
  case 0:
164
228
  // verify required parameter 'code' is not null or undefined
165
229
  (0, common_1.assertParamExists)('getBookingEntry', 'code', code);
@@ -181,12 +245,15 @@ var BookingEntriesApiAxiosParamCreator = function (configuration) {
181
245
  case 1:
182
246
  // authentication bearer required
183
247
  // http bearer authentication required
184
- _a.sent();
248
+ _b.sent();
185
249
  if (expand !== undefined) {
186
250
  localVarQueryParameter['expand'] = expand;
187
251
  }
188
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
189
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
252
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
253
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
254
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
255
+ if (authorizationValue || authorizationKeepEmpty) {
256
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
190
257
  }
191
258
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
192
259
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -200,7 +267,7 @@ var BookingEntriesApiAxiosParamCreator = function (configuration) {
200
267
  });
201
268
  },
202
269
  /**
203
- * This endpoint gets booking entries. **Required Permissions** \"accounting-management.entries.view\"
270
+ * This endpoint gets booking entries. Without an explicit `order` they come back newest booking date first (`bookingDate:DESC`), with the entry id ascending as the tie-break for same-day bookings. **Required Permissions** \"accounting-management.entries.view\"
204
271
  * @summary List booking entries
205
272
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
206
273
  * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
@@ -216,9 +283,10 @@ var BookingEntriesApiAxiosParamCreator = function (configuration) {
216
283
  listBookingEntries: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
217
284
  if (options === void 0) { options = {}; }
218
285
  return __awaiter(_this, void 0, void 0, function () {
219
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
220
- return __generator(this, function (_a) {
221
- switch (_a.label) {
286
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
287
+ var _a;
288
+ return __generator(this, function (_b) {
289
+ switch (_b.label) {
222
290
  case 0:
223
291
  localVarPath = "/accountingservice/v1/booking-entries";
224
292
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -235,7 +303,7 @@ var BookingEntriesApiAxiosParamCreator = function (configuration) {
235
303
  case 1:
236
304
  // authentication bearer required
237
305
  // http bearer authentication required
238
- _a.sent();
306
+ _b.sent();
239
307
  if (pageSize !== undefined) {
240
308
  localVarQueryParameter['pageSize'] = pageSize;
241
309
  }
@@ -257,12 +325,71 @@ var BookingEntriesApiAxiosParamCreator = function (configuration) {
257
325
  if (filters !== undefined) {
258
326
  localVarQueryParameter['filters'] = filters;
259
327
  }
260
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
261
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
328
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
329
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
330
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
331
+ if (authorizationValue || authorizationKeepEmpty) {
332
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
333
+ }
334
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
335
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
336
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
337
+ return [2 /*return*/, {
338
+ url: (0, common_1.toPathString)(localVarUrlObj),
339
+ options: localVarRequestOptions,
340
+ }];
341
+ }
342
+ });
343
+ });
344
+ },
345
+ /**
346
+ * This endpoint posts the booking entry for an existing invoice, payment, exceeding credit, credit allocation, commission, claim regulation or payment receipt on demand. A credit allocation books nothing, so it always fails with a precondition error. The entity is fetched from the service that owns it and run through the same posting flow its domain event triggers, so the call is idempotent: an entity that is already posted returns its existing booking entry. When the flow deliberately posts nothing (subledger not active for the booking date, non-positive amount) the call fails with a precondition error carrying the reason. **Required Permissions** \"accounting-management.entries.create\"
347
+ * @summary Create the booking entry from a source entity
348
+ * @param {PostFinancialEventRequestDto} postFinancialEventRequestDto
349
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
350
+ * @param {*} [options] Override http request option.
351
+ * @throws {RequiredError}
352
+ */
353
+ postFinancialEvent: function (postFinancialEventRequestDto, authorization, options) {
354
+ if (options === void 0) { options = {}; }
355
+ return __awaiter(_this, void 0, void 0, function () {
356
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
357
+ var _a;
358
+ return __generator(this, function (_b) {
359
+ switch (_b.label) {
360
+ case 0:
361
+ // verify required parameter 'postFinancialEventRequestDto' is not null or undefined
362
+ (0, common_1.assertParamExists)('postFinancialEvent', 'postFinancialEventRequestDto', postFinancialEventRequestDto);
363
+ localVarPath = "/accountingservice/v1/booking-entries/post-financial-event";
364
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
365
+ if (configuration) {
366
+ baseOptions = configuration.baseOptions;
367
+ baseAccessToken = configuration.accessToken;
368
+ }
369
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
370
+ localVarHeaderParameter = {};
371
+ localVarQueryParameter = {};
372
+ // authentication bearer required
373
+ // http bearer authentication required
374
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
375
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
376
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
377
+ ];
378
+ case 1:
379
+ // authentication bearer required
380
+ // http bearer authentication required
381
+ _b.sent();
382
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
383
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
384
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
385
+ if (authorizationValue || authorizationKeepEmpty) {
386
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
262
387
  }
388
+ localVarHeaderParameter['Content-Type'] = 'application/json';
263
389
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
264
390
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
265
391
  localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
392
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(postFinancialEventRequestDto, localVarRequestOptions, configuration);
266
393
  return [2 /*return*/, {
267
394
  url: (0, common_1.toPathString)(localVarUrlObj),
268
395
  options: localVarRequestOptions,
@@ -302,6 +429,27 @@ var BookingEntriesApiFp = function (configuration) {
302
429
  });
303
430
  });
304
431
  },
432
+ /**
433
+ * Enters or restates the confirmed opening balance for one or more accounts: a first-time entry for an account with no opening-balance history yet, a restatement for one that already has some. Each item carries the confirmed balance, not the delta; the service derives the delta itself and books it, per account, against the main-ledger bridge account. **Required Permissions** \"accounting-management.financial-accounts.create\"
434
+ * @summary Update the create or correct opening balance
435
+ * @param {CreateOrCorrectOpeningBalanceDto} createOrCorrectOpeningBalanceDto
436
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
437
+ * @param {*} [options] Override http request option.
438
+ * @throws {RequiredError}
439
+ */
440
+ createOrCorrectOpeningBalance: function (createOrCorrectOpeningBalanceDto, authorization, options) {
441
+ return __awaiter(this, void 0, void 0, function () {
442
+ var localVarAxiosArgs;
443
+ return __generator(this, function (_a) {
444
+ switch (_a.label) {
445
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createOrCorrectOpeningBalance(createOrCorrectOpeningBalanceDto, authorization, options)];
446
+ case 1:
447
+ localVarAxiosArgs = _a.sent();
448
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
449
+ }
450
+ });
451
+ });
452
+ },
305
453
  /**
306
454
  * This endpoint gets a booking entry. **Required Permissions** \"accounting-management.entries.view\"
307
455
  * @summary Retrieve the booking entry
@@ -325,7 +473,7 @@ var BookingEntriesApiFp = function (configuration) {
325
473
  });
326
474
  },
327
475
  /**
328
- * This endpoint gets booking entries. **Required Permissions** \"accounting-management.entries.view\"
476
+ * This endpoint gets booking entries. Without an explicit `order` they come back newest booking date first (`bookingDate:DESC`), with the entry id ascending as the tie-break for same-day bookings. **Required Permissions** \"accounting-management.entries.view\"
329
477
  * @summary List booking entries
330
478
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
331
479
  * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
@@ -351,6 +499,27 @@ var BookingEntriesApiFp = function (configuration) {
351
499
  });
352
500
  });
353
501
  },
502
+ /**
503
+ * This endpoint posts the booking entry for an existing invoice, payment, exceeding credit, credit allocation, commission, claim regulation or payment receipt on demand. A credit allocation books nothing, so it always fails with a precondition error. The entity is fetched from the service that owns it and run through the same posting flow its domain event triggers, so the call is idempotent: an entity that is already posted returns its existing booking entry. When the flow deliberately posts nothing (subledger not active for the booking date, non-positive amount) the call fails with a precondition error carrying the reason. **Required Permissions** \"accounting-management.entries.create\"
504
+ * @summary Create the booking entry from a source entity
505
+ * @param {PostFinancialEventRequestDto} postFinancialEventRequestDto
506
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
507
+ * @param {*} [options] Override http request option.
508
+ * @throws {RequiredError}
509
+ */
510
+ postFinancialEvent: function (postFinancialEventRequestDto, authorization, options) {
511
+ return __awaiter(this, void 0, void 0, function () {
512
+ var localVarAxiosArgs;
513
+ return __generator(this, function (_a) {
514
+ switch (_a.label) {
515
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.postFinancialEvent(postFinancialEventRequestDto, authorization, options)];
516
+ case 1:
517
+ localVarAxiosArgs = _a.sent();
518
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
519
+ }
520
+ });
521
+ });
522
+ },
354
523
  };
355
524
  };
356
525
  exports.BookingEntriesApiFp = BookingEntriesApiFp;
@@ -372,6 +541,17 @@ var BookingEntriesApiFactory = function (configuration, basePath, axios) {
372
541
  createBookingEntry: function (createBookingEntryRequestDto, authorization, options) {
373
542
  return localVarFp.createBookingEntry(createBookingEntryRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
374
543
  },
544
+ /**
545
+ * Enters or restates the confirmed opening balance for one or more accounts: a first-time entry for an account with no opening-balance history yet, a restatement for one that already has some. Each item carries the confirmed balance, not the delta; the service derives the delta itself and books it, per account, against the main-ledger bridge account. **Required Permissions** \"accounting-management.financial-accounts.create\"
546
+ * @summary Update the create or correct opening balance
547
+ * @param {CreateOrCorrectOpeningBalanceDto} createOrCorrectOpeningBalanceDto
548
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
549
+ * @param {*} [options] Override http request option.
550
+ * @throws {RequiredError}
551
+ */
552
+ createOrCorrectOpeningBalance: function (createOrCorrectOpeningBalanceDto, authorization, options) {
553
+ return localVarFp.createOrCorrectOpeningBalance(createOrCorrectOpeningBalanceDto, authorization, options).then(function (request) { return request(axios, basePath); });
554
+ },
375
555
  /**
376
556
  * This endpoint gets a booking entry. **Required Permissions** \"accounting-management.entries.view\"
377
557
  * @summary Retrieve the booking entry
@@ -385,7 +565,7 @@ var BookingEntriesApiFactory = function (configuration, basePath, axios) {
385
565
  return localVarFp.getBookingEntry(code, expand, authorization, options).then(function (request) { return request(axios, basePath); });
386
566
  },
387
567
  /**
388
- * This endpoint gets booking entries. **Required Permissions** \"accounting-management.entries.view\"
568
+ * This endpoint gets booking entries. Without an explicit `order` they come back newest booking date first (`bookingDate:DESC`), with the entry id ascending as the tie-break for same-day bookings. **Required Permissions** \"accounting-management.entries.view\"
389
569
  * @summary List booking entries
390
570
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
391
571
  * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
@@ -401,6 +581,17 @@ var BookingEntriesApiFactory = function (configuration, basePath, axios) {
401
581
  listBookingEntries: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
402
582
  return localVarFp.listBookingEntries(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
403
583
  },
584
+ /**
585
+ * This endpoint posts the booking entry for an existing invoice, payment, exceeding credit, credit allocation, commission, claim regulation or payment receipt on demand. A credit allocation books nothing, so it always fails with a precondition error. The entity is fetched from the service that owns it and run through the same posting flow its domain event triggers, so the call is idempotent: an entity that is already posted returns its existing booking entry. When the flow deliberately posts nothing (subledger not active for the booking date, non-positive amount) the call fails with a precondition error carrying the reason. **Required Permissions** \"accounting-management.entries.create\"
586
+ * @summary Create the booking entry from a source entity
587
+ * @param {PostFinancialEventRequestDto} postFinancialEventRequestDto
588
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
589
+ * @param {*} [options] Override http request option.
590
+ * @throws {RequiredError}
591
+ */
592
+ postFinancialEvent: function (postFinancialEventRequestDto, authorization, options) {
593
+ return localVarFp.postFinancialEvent(postFinancialEventRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
594
+ },
404
595
  };
405
596
  };
406
597
  exports.BookingEntriesApiFactory = BookingEntriesApiFactory;
@@ -425,7 +616,19 @@ var BookingEntriesApi = /** @class */ (function (_super) {
425
616
  */
426
617
  BookingEntriesApi.prototype.createBookingEntry = function (requestParameters, options) {
427
618
  var _this = this;
428
- return (0, exports.BookingEntriesApiFp)(this.configuration).createBookingEntry(requestParameters.createBookingEntryRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
619
+ return (0, exports.BookingEntriesApiFp)(this.configuration).createBookingEntry(requestParameters.createBookingEntryRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
620
+ };
621
+ /**
622
+ * Enters or restates the confirmed opening balance for one or more accounts: a first-time entry for an account with no opening-balance history yet, a restatement for one that already has some. Each item carries the confirmed balance, not the delta; the service derives the delta itself and books it, per account, against the main-ledger bridge account. **Required Permissions** \"accounting-management.financial-accounts.create\"
623
+ * @summary Update the create or correct opening balance
624
+ * @param {BookingEntriesApiCreateOrCorrectOpeningBalanceRequest} requestParameters Request parameters.
625
+ * @param {*} [options] Override http request option.
626
+ * @throws {RequiredError}
627
+ * @memberof BookingEntriesApi
628
+ */
629
+ BookingEntriesApi.prototype.createOrCorrectOpeningBalance = function (requestParameters, options) {
630
+ var _this = this;
631
+ return (0, exports.BookingEntriesApiFp)(this.configuration).createOrCorrectOpeningBalance(requestParameters.createOrCorrectOpeningBalanceDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
429
632
  };
430
633
  /**
431
634
  * This endpoint gets a booking entry. **Required Permissions** \"accounting-management.entries.view\"
@@ -437,10 +640,10 @@ var BookingEntriesApi = /** @class */ (function (_super) {
437
640
  */
438
641
  BookingEntriesApi.prototype.getBookingEntry = function (requestParameters, options) {
439
642
  var _this = this;
440
- return (0, exports.BookingEntriesApiFp)(this.configuration).getBookingEntry(requestParameters.code, requestParameters.expand, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
643
+ return (0, exports.BookingEntriesApiFp)(this.configuration).getBookingEntry(requestParameters.code, requestParameters.expand, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
441
644
  };
442
645
  /**
443
- * This endpoint gets booking entries. **Required Permissions** \"accounting-management.entries.view\"
646
+ * This endpoint gets booking entries. Without an explicit `order` they come back newest booking date first (`bookingDate:DESC`), with the entry id ascending as the tie-break for same-day bookings. **Required Permissions** \"accounting-management.entries.view\"
444
647
  * @summary List booking entries
445
648
  * @param {BookingEntriesApiListBookingEntriesRequest} requestParameters Request parameters.
446
649
  * @param {*} [options] Override http request option.
@@ -450,7 +653,19 @@ var BookingEntriesApi = /** @class */ (function (_super) {
450
653
  BookingEntriesApi.prototype.listBookingEntries = function (requestParameters, options) {
451
654
  var _this = this;
452
655
  if (requestParameters === void 0) { requestParameters = {}; }
453
- return (0, exports.BookingEntriesApiFp)(this.configuration).listBookingEntries(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
656
+ return (0, exports.BookingEntriesApiFp)(this.configuration).listBookingEntries(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
657
+ };
658
+ /**
659
+ * This endpoint posts the booking entry for an existing invoice, payment, exceeding credit, credit allocation, commission, claim regulation or payment receipt on demand. A credit allocation books nothing, so it always fails with a precondition error. The entity is fetched from the service that owns it and run through the same posting flow its domain event triggers, so the call is idempotent: an entity that is already posted returns its existing booking entry. When the flow deliberately posts nothing (subledger not active for the booking date, non-positive amount) the call fails with a precondition error carrying the reason. **Required Permissions** \"accounting-management.entries.create\"
660
+ * @summary Create the booking entry from a source entity
661
+ * @param {BookingEntriesApiPostFinancialEventRequest} requestParameters Request parameters.
662
+ * @param {*} [options] Override http request option.
663
+ * @throws {RequiredError}
664
+ * @memberof BookingEntriesApi
665
+ */
666
+ BookingEntriesApi.prototype.postFinancialEvent = function (requestParameters, options) {
667
+ var _this = this;
668
+ return (0, exports.BookingEntriesApiFp)(this.configuration).postFinancialEvent(requestParameters.postFinancialEventRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
454
669
  };
455
670
  return BookingEntriesApi;
456
671
  }(base_1.BaseAPI));