@gandalan/weblibs 1.5.17 → 1.5.19

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 (56) hide show
  1. package/JSDOC.md +661 -0
  2. package/README.md +106 -17
  3. package/api/business/ablageApi.js +106 -0
  4. package/api/business/anpassungApi.js +74 -0
  5. package/api/business/artikelApi.js +242 -0
  6. package/api/business/authApi.js +63 -0
  7. package/api/business/avApi.js +458 -0
  8. package/api/business/belegApi.js +365 -0
  9. package/api/business/belegPositionenApi.js +52 -0
  10. package/api/business/benutzerApi.js +96 -0
  11. package/api/business/fakturaApi.js +88 -0
  12. package/api/business/farbeApi.js +129 -0
  13. package/api/business/fileApi.js +72 -0
  14. package/api/business/historieApi.js +144 -0
  15. package/api/business/index.js +63 -0
  16. package/api/business/kontaktApi.js +70 -0
  17. package/api/business/lagerApi.js +162 -0
  18. package/api/business/lieferungApi.js +127 -0
  19. package/api/business/mailApi.js +41 -0
  20. package/api/business/mandantApi.js +137 -0
  21. package/api/business/materialApi.js +37 -0
  22. package/api/business/printApi.js +49 -0
  23. package/api/business/produktionApi.js +141 -0
  24. package/api/business/rechnungApi.js +155 -0
  25. package/api/business/serienApi.js +375 -0
  26. package/api/business/settingsApi.js +168 -0
  27. package/api/business/systemApi.js +209 -0
  28. package/api/business/uiApi.js +256 -0
  29. package/api/business/utilityApi.js +288 -0
  30. package/api/business/vorgangApi.js +128 -0
  31. package/api/dtos/allgemein.js +107 -0
  32. package/api/dtos/artikel.js +46 -0
  33. package/api/dtos/av.js +171 -0
  34. package/api/dtos/belege.js +614 -0
  35. package/api/dtos/benutzer.js +101 -0
  36. package/api/dtos/druck.js +50 -0
  37. package/api/dtos/faktura.js +128 -0
  38. package/api/dtos/farben.js +93 -0
  39. package/api/dtos/index.js +501 -0
  40. package/api/dtos/kunden.js +217 -0
  41. package/api/dtos/lager.js +66 -0
  42. package/api/dtos/mail.js +30 -0
  43. package/api/dtos/mandanten.js +60 -0
  44. package/api/dtos/nachrichten.js +18 -0
  45. package/api/dtos/produktGruppen.js +18 -0
  46. package/api/dtos/produktion.js +564 -0
  47. package/api/dtos/settings.js +172 -0
  48. package/api/dtos/technik.js +163 -0
  49. package/api/dtos/ui.js +496 -0
  50. package/api/dtos/webjob.js +12 -0
  51. package/api/fluentApi.js +10 -8
  52. package/api/fluentAuthManager.js +22 -14
  53. package/api/fluentRestClient.js +7 -7
  54. package/api/idasFluentApi.js +458 -0
  55. package/index.js +53 -6
  56. package/package.json +1 -1
@@ -0,0 +1,375 @@
1
+ /**
2
+ * Serien API - Combined API for Serien (Series) and AV (Arbeitsvorbereitung) operations
3
+ * Combines functionality from SerienWebRoutinen and AVWebRoutinen
4
+ *
5
+ * @module api/business/serienApi
6
+ */
7
+
8
+ /**
9
+ * @typedef {import('../dtos/produktion.js').SerieDTO} SerieDTO
10
+ * @typedef {import('../dtos/index.js').SerieAuslastungDTO} SerieAuslastungDTO
11
+ * @typedef {import('../dtos/index.js').VirtualSerieWithAuslastungDTO} VirtualSerieWithAuslastungDTO
12
+ * @typedef {import('../dtos/index.js').BelegPositionAVDTO} BelegPositionAVDTO
13
+ * @typedef {import('../dtos/index.js').PositionSerieItemDTO} PositionSerieItemDTO
14
+ * @typedef {import('../fluentApi.js').FluentApi} FluentApi
15
+ */
16
+
17
+ /**
18
+ * Creates a Serien API instance with methods for managing series and AV positions
19
+ *
20
+ * @param {FluentApi} fluentApi - The fluent API client instance
21
+ * @returns {SerienApi} The configured Serien API instance
22
+ */
23
+ export function createSerienApi(fluentApi) {
24
+ return {
25
+ fluentApi,
26
+
27
+ // ============================================================================
28
+ // Serie Operations (from SerienWebRoutinen)
29
+ // ============================================================================
30
+
31
+ /**
32
+ * Releases elements from a series
33
+ * @param {string} fromSerie - GUID of the series to release elements from
34
+ * @returns {Promise<void>}
35
+ */
36
+ async releaseElemente(fromSerie) {
37
+ await this.fluentApi.get(`Serie/ReleaseElemente?fromSerie=${fromSerie}`);
38
+ },
39
+
40
+ /**
41
+ * Moves elements from one series to another
42
+ * @param {string} fromSerie - GUID of the source series
43
+ * @param {string} toSerie - GUID of the target series
44
+ * @returns {Promise<string>}
45
+ */
46
+ async moveElemente(fromSerie, toSerie) {
47
+ return await this.fluentApi.get(`Serie/MoveElemente?fromSerie=${fromSerie}&toSerie=${toSerie}`);
48
+ },
49
+
50
+ /**
51
+ * Redistributes elements within a series
52
+ * @param {string} fromSerie - GUID of the series to redistribute elements in
53
+ * @returns {Promise<string>}
54
+ */
55
+ async redistributeElemente(fromSerie) {
56
+ return await this.fluentApi.get(`Serie/RedistributeElemente?fromSerie=${fromSerie}`);
57
+ },
58
+
59
+ /**
60
+ * Gets all series
61
+ * @returns {Promise<SerieDTO[]>}
62
+ */
63
+ async getAllSerien() {
64
+ return await this.fluentApi.get("Serie");
65
+ },
66
+
67
+ /**
68
+ * Gets all series changed since a specific date
69
+ * @param {Date} changedSince - Date to filter changes since
70
+ * @returns {Promise<SerieDTO[]>}
71
+ */
72
+ async getAllSerienChangedSince(changedSince) {
73
+ return await this.fluentApi.get(`Serie/?changedSince=${changedSince.toISOString()}`);
74
+ },
75
+
76
+ /**
77
+ * Gets a specific series by GUID
78
+ * @param {string} guid - GUID of the series
79
+ * @returns {Promise<SerieDTO>}
80
+ */
81
+ async getSerie(guid) {
82
+ return await this.fluentApi.get(`Serie/${guid}`);
83
+ },
84
+
85
+ /**
86
+ * Saves a series
87
+ * @param {SerieDTO} serie - The series to save
88
+ * @returns {Promise<void>}
89
+ */
90
+ async saveSerie(serie) {
91
+ await this.fluentApi.put("Serie", serie);
92
+ },
93
+
94
+ /**
95
+ * Deletes a series by GUID
96
+ * @param {string} guid - GUID of the series to delete
97
+ * @returns {Promise<void>}
98
+ */
99
+ async deleteSerie(guid) {
100
+ await this.fluentApi.delete(`Serie/${guid}`);
101
+ },
102
+
103
+ /**
104
+ * Gets capacity utilization for a series
105
+ * @param {string} serie - GUID of the series
106
+ * @returns {Promise<SerieAuslastungDTO[]>}
107
+ */
108
+ async getAuslastung(serie) {
109
+ return await this.fluentApi.get(`Auslastung/${serie}`);
110
+ },
111
+
112
+ /**
113
+ * Gets total capacity utilization across all series
114
+ * @param {boolean} [includeAbgelaufene=false] - Whether to include expired series
115
+ * @returns {Promise<Record<string, SerieAuslastungDTO[]>>}
116
+ */
117
+ async getGesamtAuslastung(includeAbgelaufene = false) {
118
+ return await this.fluentApi.get(`Auslastung/?includeAbgelaufene=${includeAbgelaufene}`);
119
+ },
120
+
121
+ /**
122
+ * Gets series capacities for a date range
123
+ * @param {Date} [startDate] - Start date of the range
124
+ * @param {Date} [endDate] - End date of the range
125
+ * @param {boolean} [includeStaendige=false] - Whether to include permanent series
126
+ * @returns {Promise<Record<string, SerieAuslastungDTO[]>>}
127
+ */
128
+ async getSerienKapazitaeten(startDate = null, endDate = null, includeStaendige = false) {
129
+ const startParam = startDate ? startDate.toISOString() : "";
130
+ const endParam = endDate ? endDate.toISOString() : "";
131
+ return await this.fluentApi.get(`SerieKapazitaet/?startDate=${startParam}&endDate=${endParam}&includeStaendige=${includeStaendige}`);
132
+ },
133
+
134
+ /**
135
+ * Gets capacity utilization for virtual series within a date range
136
+ * @param {Date} [startDate] - Start date of the range
137
+ * @param {Date} [endDate] - End date of the range
138
+ * @returns {Promise<VirtualSerieWithAuslastungDTO[]>}
139
+ */
140
+ async getAuslastungVirtualSerien(startDate = null, endDate = null) {
141
+ const startParam = startDate ? startDate.toISOString() : "";
142
+ const endParam = endDate ? endDate.toISOString() : "";
143
+ return await this.fluentApi.get(`AuslastungVirtual/?startDate=${startParam}&endDate=${endParam}`);
144
+ },
145
+
146
+ /**
147
+ * Gets capacity utilization for a range of order numbers
148
+ * @param {number} startVorgangsnummer - Start order number
149
+ * @param {number} endVorgangsnummer - End order number
150
+ * @returns {Promise<SerieAuslastungDTO[]>}
151
+ */
152
+ async getAuslastungVorgang(startVorgangsnummer, endVorgangsnummer) {
153
+ return await this.fluentApi.get(`AuslastungVorgang/?startVorgangsnummer=${startVorgangsnummer}&endVorgangsnummer=${endVorgangsnummer}`);
154
+ },
155
+
156
+ // ============================================================================
157
+ // AV Position Operations (from AVWebRoutinen)
158
+ // ============================================================================
159
+
160
+ /**
161
+ * Gets all AV positions
162
+ * @returns {Promise<BelegPositionAVDTO[]>}
163
+ */
164
+ async getAllBelegPositionenAV() {
165
+ return await this.fluentApi.get("BelegPositionenAV");
166
+ },
167
+
168
+ /**
169
+ * Gets all AV positions changed since a specific date
170
+ * @param {Date} changedSince - Date to filter changes since
171
+ * @returns {Promise<BelegPositionAVDTO[]>}
172
+ */
173
+ async getAllBelegPositionenAVChangedSince(changedSince) {
174
+ return await this.fluentApi.get(`BelegPositionenAV/?changedSince=${changedSince.toISOString()}`);
175
+ },
176
+
177
+ /**
178
+ * Gets all AV positions with optional filtering
179
+ * @param {boolean} [includeOriginalBeleg=true] - Whether to include original order data
180
+ * @param {boolean} [includeProdDaten=true] - Whether to include production data
181
+ * @returns {Promise<BelegPositionAVDTO[]>}
182
+ */
183
+ async getAllBelegPositionenAVWithOptions(includeOriginalBeleg = true, includeProdDaten = true) {
184
+ return await this.fluentApi.get(`BelegPositionenAV?includeOriginalBeleg=${includeOriginalBeleg}&includeProdDaten=${includeProdDaten}`);
185
+ },
186
+
187
+ /**
188
+ * Gets all AV positions changed since a specific date with optional filtering
189
+ * @param {Date} changedSince - Date to filter changes since
190
+ * @param {boolean} [includeOriginalBeleg=true] - Whether to include original order data
191
+ * @param {boolean} [includeProdDaten=true] - Whether to include production data
192
+ * @returns {Promise<BelegPositionAVDTO[]>}
193
+ */
194
+ async getAllBelegPositionenAVChangedSinceWithOptions(changedSince, includeOriginalBeleg = true, includeProdDaten = true) {
195
+ return await this.fluentApi.get(`BelegPositionenAV/?changedSince=${changedSince.toISOString()}&includeOriginalBeleg=${includeOriginalBeleg}&includeProdDaten=${includeProdDaten}`);
196
+ },
197
+
198
+ /**
199
+ * Gets AV positions for a specific series
200
+ * @param {string} serieGuid - GUID of the series
201
+ * @param {boolean} [includeOriginalBeleg=true] - Whether to include original order data
202
+ * @param {boolean} [includeProdDaten=true] - Whether to include production data
203
+ * @returns {Promise<BelegPositionAVDTO[]>}
204
+ */
205
+ async getSerieBelegPositionenAV(serieGuid, includeOriginalBeleg = true, includeProdDaten = true) {
206
+ return await this.fluentApi.get(`BelegPositionenAV/?serieGuid=${serieGuid}&includeOriginalBeleg=${includeOriginalBeleg}&includeProdDaten=${includeProdDaten}`);
207
+ },
208
+
209
+ /**
210
+ * Gets AV positions for a specific order (Vorgang)
211
+ * @param {string} vorgangGuid - GUID of the order
212
+ * @param {boolean} [includeOriginalBeleg=true] - Whether to include original order data
213
+ * @param {boolean} [includeProdDaten=true] - Whether to include production data
214
+ * @returns {Promise<BelegPositionAVDTO[]>}
215
+ */
216
+ async getVorgangBelegPositionenAV(vorgangGuid, includeOriginalBeleg = true, includeProdDaten = true) {
217
+ return await this.fluentApi.get(`BelegPositionenAV/?vorgangGuid=${vorgangGuid}&includeOriginalBeleg=${includeOriginalBeleg}&includeProdDaten=${includeProdDaten}`);
218
+ },
219
+
220
+ /**
221
+ * Gets AV positions for multiple orders
222
+ * @param {string[]} vorgangGuids - Array of order GUIDs
223
+ * @param {boolean} [includeOriginalBeleg=true] - Whether to include original order data
224
+ * @param {boolean} [includeProdDaten=true] - Whether to include production data
225
+ * @returns {Promise<BelegPositionAVDTO[]>}
226
+ */
227
+ async getVorgaengeBelegPositionenAV(vorgangGuids, includeOriginalBeleg = true, includeProdDaten = true) {
228
+ const vorgangGuidsString = vorgangGuids.map(g => `vorgangGuids=${encodeURIComponent(g)}`).join("&");
229
+ return await this.fluentApi.get(`BelegPositionenAVByVorgangIds/?${vorgangGuidsString}&includeOriginalBeleg=${includeOriginalBeleg}&includeProdDaten=${includeProdDaten}`);
230
+ },
231
+
232
+ /**
233
+ * Gets AV positions for a specific order position
234
+ * @param {string} belegpositionGuid - GUID of the order position
235
+ * @returns {Promise<BelegPositionAVDTO[]>}
236
+ */
237
+ async getBelegPositionenAV(belegpositionGuid) {
238
+ return await this.fluentApi.get(`BelegPositionenAV/${belegpositionGuid}`);
239
+ },
240
+
241
+ /**
242
+ * Gets a single AV position by its GUID
243
+ * @param {string} avGuid - GUID of the AV position
244
+ * @returns {Promise<BelegPositionAVDTO>}
245
+ */
246
+ async getBelegPositionAVById(avGuid) {
247
+ return await this.fluentApi.get(`BelegPositionenAVById/${avGuid}`);
248
+ },
249
+
250
+ /**
251
+ * Gets AV positions by PCode
252
+ * @param {string} pcode - The PCode to search for
253
+ * @param {boolean} [includeOriginalBeleg=true] - Whether to include original order data
254
+ * @param {boolean} [includeProdDaten=true] - Whether to include production data
255
+ * @returns {Promise<BelegPositionAVDTO[]>}
256
+ */
257
+ async getBelegPositionAVByPCode(pcode, includeOriginalBeleg = true, includeProdDaten = true) {
258
+ return await this.fluentApi.get(`BelegPositionenAVByPCode/${encodeURIComponent(pcode)}?includeOriginalBeleg=${includeOriginalBeleg}&includeProdDaten=${includeProdDaten}`);
259
+ },
260
+
261
+ /**
262
+ * Searches AV positions by PCode with wildcard search
263
+ * @param {string} search - The search string
264
+ * @returns {Promise<BelegPositionAVDTO[]>}
265
+ */
266
+ async searchBelegPositionAVByPCode(search) {
267
+ return await this.fluentApi.get(`BelegPositionenAVSearchByPCode?search=${encodeURIComponent(search)}`);
268
+ },
269
+
270
+ /**
271
+ * Saves a single AV position
272
+ * @param {BelegPositionAVDTO} position - The AV position to save
273
+ * @returns {Promise<void>}
274
+ */
275
+ async saveBelegPositionenAV(position) {
276
+ await this.fluentApi.put("BelegPositionenAV", position);
277
+ },
278
+
279
+ /**
280
+ * Saves multiple AV positions
281
+ * @param {BelegPositionAVDTO[]} positionen - Array of AV positions to save
282
+ * @returns {Promise<BelegPositionAVDTO[]>}
283
+ */
284
+ async saveBelegPositionenAVBulk(positionen) {
285
+ return await this.fluentApi.put("BelegPositionenAVBulk", positionen);
286
+ },
287
+
288
+ /**
289
+ * Saves AV positions to a specific series
290
+ * @param {string} serieGuid - GUID of the target series
291
+ * @param {string[]} positionen - Array of AV position GUIDs to add
292
+ * @returns {Promise<BelegPositionAVDTO[]>}
293
+ */
294
+ async saveBelegPositionenAVToSerie(serieGuid, positionen) {
295
+ return await this.fluentApi.put(`BelegPositionenAVBulk/AddToSerie/${serieGuid}`, positionen);
296
+ },
297
+
298
+ /**
299
+ * Triggers AV calculation for the specified positions
300
+ * @param {string[]} guids - Array of AV position GUIDs to calculate
301
+ * @returns {Promise<void>}
302
+ */
303
+ async belegPositionenAVBerechnen(guids) {
304
+ await this.fluentApi.put("BelegPositionenAVBulk/AVBerechnung", guids);
305
+ },
306
+
307
+ /**
308
+ * Deletes a single AV position
309
+ * @param {string} guid - GUID of the AV position to delete
310
+ * @returns {Promise<void>}
311
+ */
312
+ async deleteBelegPositionenAV(guid) {
313
+ await this.fluentApi.delete(`BelegPositionenAV/${guid}`);
314
+ },
315
+
316
+ /**
317
+ * Deletes multiple AV positions
318
+ * @param {string[]} guids - Array of AV position GUIDs to delete
319
+ * @returns {Promise<void>}
320
+ */
321
+ async deleteBelegPositionenAVBulk(guids) {
322
+ await this.fluentApi.delete("BelegPositionenAVBulk", guids);
323
+ },
324
+
325
+ /**
326
+ * Assigns order positions to series
327
+ * @param {string} belegGuid - GUID of the order
328
+ * @param {PositionSerieItemDTO[]} positionSerieItems - Array of position-to-series assignments
329
+ * @returns {Promise<void>}
330
+ */
331
+ async belegPositionenSerienZuordnen(belegGuid, positionSerieItems) {
332
+ await this.fluentApi.put(`BelegPositionenAVBulk/SerienZuorden/${belegGuid}`, positionSerieItems);
333
+ },
334
+ };
335
+ }
336
+
337
+ /**
338
+ * @typedef {Object} SerienApi
339
+ * @property {FluentApi} fluentApi
340
+ *
341
+ * // Serie Operations
342
+ * @property {(fromSerie: string) => Promise<void>} releaseElemente
343
+ * @property {(fromSerie: string, toSerie: string) => Promise<string>} moveElemente
344
+ * @property {(fromSerie: string) => Promise<string>} redistributeElemente
345
+ * @property {() => Promise<SerieDTO[]>} getAllSerien
346
+ * @property {(changedSince: Date) => Promise<SerieDTO[]>} getAllSerienChangedSince
347
+ * @property {(guid: string) => Promise<SerieDTO>} getSerie
348
+ * @property {(serie: SerieDTO) => Promise<void>} saveSerie
349
+ * @property {(guid: string) => Promise<void>} deleteSerie
350
+ * @property {(serie: string) => Promise<SerieAuslastungDTO[]>} getAuslastung
351
+ * @property {(includeAbgelaufene?: boolean) => Promise<Record<string, SerieAuslastungDTO[]>>} getGesamtAuslastung
352
+ * @property {(startDate?: Date, endDate?: Date, includeStaendige?: boolean) => Promise<Record<string, SerieAuslastungDTO[]>>} getSerienKapazitaeten
353
+ * @property {(startDate?: Date, endDate?: Date) => Promise<VirtualSerieWithAuslastungDTO[]>} getAuslastungVirtualSerien
354
+ * @property {(startVorgangsnummer: number, endVorgangsnummer: number) => Promise<SerieAuslastungDTO[]>} getAuslastungVorgang
355
+ *
356
+ * // AV Position Operations
357
+ * @property {() => Promise<BelegPositionAVDTO[]>} getAllBelegPositionenAV
358
+ * @property {(changedSince: Date) => Promise<BelegPositionAVDTO[]>} getAllBelegPositionenAVChangedSince
359
+ * @property {(includeOriginalBeleg?: boolean, includeProdDaten?: boolean) => Promise<BelegPositionAVDTO[]>} getAllBelegPositionenAVWithOptions
360
+ * @property {(changedSince: Date, includeOriginalBeleg?: boolean, includeProdDaten?: boolean) => Promise<BelegPositionAVDTO[]>} getAllBelegPositionenAVChangedSinceWithOptions
361
+ * @property {(serieGuid: string, includeOriginalBeleg?: boolean, includeProdDaten?: boolean) => Promise<BelegPositionAVDTO[]>} getSerieBelegPositionenAV
362
+ * @property {(vorgangGuid: string, includeOriginalBeleg?: boolean, includeProdDaten?: boolean) => Promise<BelegPositionAVDTO[]>} getVorgangBelegPositionenAV
363
+ * @property {(vorgangGuids: string[], includeOriginalBeleg?: boolean, includeProdDaten?: boolean) => Promise<BelegPositionAVDTO[]>} getVorgaengeBelegPositionenAV
364
+ * @property {(belegpositionGuid: string) => Promise<BelegPositionAVDTO[]>} getBelegPositionenAV
365
+ * @property {(avGuid: string) => Promise<BelegPositionAVDTO>} getBelegPositionAVById
366
+ * @property {(pcode: string, includeOriginalBeleg?: boolean, includeProdDaten?: boolean) => Promise<BelegPositionAVDTO[]>} getBelegPositionAVByPCode
367
+ * @property {(search: string) => Promise<BelegPositionAVDTO[]>} searchBelegPositionAVByPCode
368
+ * @property {(position: BelegPositionAVDTO) => Promise<void>} saveBelegPositionenAV
369
+ * @property {(positionen: BelegPositionAVDTO[]) => Promise<BelegPositionAVDTO[]>} saveBelegPositionenAVBulk
370
+ * @property {(serieGuid: string, positionen: string[]) => Promise<BelegPositionAVDTO[]>} saveBelegPositionenAVToSerie
371
+ * @property {(guids: string[]) => Promise<void>} belegPositionenAVBerechnen
372
+ * @property {(guid: string) => Promise<void>} deleteBelegPositionenAV
373
+ * @property {(guids: string[]) => Promise<void>} deleteBelegPositionenAVBulk
374
+ * @property {(belegGuid: string, positionSerieItems: PositionSerieItemDTO[]) => Promise<void>} belegPositionenSerienZuordnen
375
+ */
@@ -0,0 +1,168 @@
1
+ /**
2
+ * @typedef {import('../fluentApi.js').FluentApi} FluentApi
3
+ * @typedef {import('../dtos/index.js').PreisermittlungsEinstellungenDTO} PreisermittlungsEinstellungenDTO
4
+ * @typedef {import('../dtos/index.js').KonfigSatzInfoDTO} KonfigSatzInfoDTO
5
+ * @typedef {import('../dtos/index.js').WerteListeDTO} WerteListeDTO
6
+ * @typedef {import('../dtos/index.js').ContractDTO} ContractDTO
7
+ * @typedef {import('../dtos/index.js').TemplateDTO} TemplateDTO
8
+ * @typedef {import('../dtos/index.js').ChangeInfoDTO} ChangeInfoDTO
9
+ * @typedef {import('../dtos/index.js').UpdateInfoDTO} UpdateInfoDTO
10
+ */
11
+
12
+ /**
13
+ * Settings API - Application settings and configuration
14
+ * @param {FluentApi} fluentApi
15
+ */
16
+ export function createSettingsApi(fluentApi) {
17
+ return {
18
+ // SettingsWebRoutinen
19
+ /**
20
+ * Get all settings
21
+ * @returns {Promise<Record<string, object>>}
22
+ */
23
+ getAllSettings: () => fluentApi.get("Settings"),
24
+
25
+ /**
26
+ * Save setting
27
+ * @param {string} key
28
+ * @param {object} value
29
+ * @returns {Promise<void>}
30
+ */
31
+ saveSetting: (key, value) => fluentApi.put(`Settings/${key}`, value),
32
+
33
+ // PreiskonditionenWebRoutinen
34
+ /**
35
+ * Get price conditions
36
+ * @returns {Promise<PreisermittlungsEinstellungenDTO>}
37
+ */
38
+ getPreiskonditionen: () => fluentApi.get("Preiskonditionen/"),
39
+
40
+ /**
41
+ * Save price conditions
42
+ * @param {string} konditionen
43
+ * @returns {Promise<string>}
44
+ */
45
+ savePreiskonditionen: (konditionen) => fluentApi.put("Preiskonditionen/", konditionen),
46
+
47
+ // KonfigSatzInfoWebRoutinen
48
+ /**
49
+ * Get all config set info
50
+ * @returns {Promise<KonfigSatzInfoDTO[]>}
51
+ */
52
+ getAllKonfigSatzInfo: () => fluentApi.get("KonfigSatzInfo"),
53
+
54
+ /**
55
+ * Save config set info
56
+ * @param {KonfigSatzInfoDTO} konfigSatzInfo
57
+ * @returns {Promise<KonfigSatzInfoDTO>}
58
+ */
59
+ saveKonfigSatzInfo: (konfigSatzInfo) => fluentApi.put("KonfigSatzInfo", konfigSatzInfo),
60
+
61
+ // WertelistenWebRoutinen
62
+ /**
63
+ * Get all value lists
64
+ * @param {boolean} includeAutoWerteListen
65
+ * @returns {Promise<WerteListeDTO[]>}
66
+ */
67
+ getAllWertelisten: (includeAutoWerteListen) =>
68
+ fluentApi.get(`WerteListe?includeAutoWerteListen=${includeAutoWerteListen}`),
69
+
70
+ /**
71
+ * Get value list by GUID
72
+ * @param {string} wertelisteGuid
73
+ * @param {boolean} [includeAutoWerteListen=true]
74
+ * @returns {Promise<WerteListeDTO>}
75
+ */
76
+ getWerteliste: (wertelisteGuid, includeAutoWerteListen = true) =>
77
+ fluentApi.get(`WerteListe/${wertelisteGuid}?includeAutoWerteListen=${includeAutoWerteListen}`),
78
+
79
+ /**
80
+ * Save value list
81
+ * @param {WerteListeDTO} dto
82
+ * @returns {Promise<void>}
83
+ */
84
+ saveWerteliste: (dto) => fluentApi.put(`WerteListe/${dto.werteListeGuid}`, dto),
85
+
86
+ // ContractWebRoutinen
87
+ /**
88
+ * Get all contracts
89
+ * @returns {Promise<ContractDTO[]>}
90
+ */
91
+ getAllContracts: () => fluentApi.get("Contracts"),
92
+
93
+ /**
94
+ * Save contract
95
+ * @param {ContractDTO} dto
96
+ * @returns {Promise<ContractDTO>}
97
+ */
98
+ saveContract: (dto) => fluentApi.put("Contracts", dto),
99
+
100
+ /**
101
+ * Delete contract
102
+ * @param {ContractDTO} dto
103
+ * @returns {Promise<void>}
104
+ */
105
+ deleteContract: (dto) => fluentApi.delete(`Contracts/${dto.contractGuid}`),
106
+
107
+ // TemplateWebRoutinen
108
+ /**
109
+ * Get all templates
110
+ * @returns {Promise<TemplateDTO[]>}
111
+ */
112
+ getAllTemplates: () => fluentApi.get("Template"),
113
+
114
+ /**
115
+ * Get template by ID
116
+ * @param {string} id
117
+ * @returns {Promise<TemplateDTO>}
118
+ */
119
+ getTemplate: (id) => fluentApi.get(`Template?id=${id}`),
120
+
121
+ /**
122
+ * Save template
123
+ * @param {TemplateDTO} dto
124
+ * @returns {Promise<void>}
125
+ */
126
+ saveTemplate: (dto) => fluentApi.put(`Template/${dto.templateGuid}`, dto),
127
+
128
+ /**
129
+ * Delete template
130
+ * @param {string} templateGuid
131
+ * @returns {Promise<void>}
132
+ */
133
+ deleteTemplate: (templateGuid) => fluentApi.delete(`Template/${templateGuid}`),
134
+
135
+ // ChangeInfoWebRoutinen
136
+ /**
137
+ * Get change info
138
+ * @returns {Promise<ChangeInfoDTO>}
139
+ */
140
+ getChangeInfo: () => fluentApi.get("ChangeInfo"),
141
+
142
+ // UpdateInfoWebRoutinen
143
+ /**
144
+ * Get update info
145
+ * @returns {Promise<UpdateInfoDTO>}
146
+ */
147
+ getUpdateInfo: () => fluentApi.get("UpdateInfo"),
148
+
149
+ // DataMigrationHistoryWebRoutinen
150
+ /**
151
+ * Get data migration history version
152
+ * @returns {Promise<number>}
153
+ */
154
+ getDataMigrationHistoryVersion: () => fluentApi.get("DataMigrationHistory"),
155
+
156
+ /**
157
+ * Set data migration history version
158
+ * @param {number} newVersion
159
+ * @returns {Promise<void>}
160
+ */
161
+ setDataMigrationHistoryVersion: (newVersion) =>
162
+ fluentApi.put("DataMigrationHistory", newVersion.toString()),
163
+ };
164
+ }
165
+
166
+ /**
167
+ * @typedef {ReturnType<typeof createSettingsApi>} SettingsApi
168
+ */