@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.
- package/JSDOC.md +661 -0
- package/README.md +106 -17
- package/api/business/ablageApi.js +106 -0
- package/api/business/anpassungApi.js +74 -0
- package/api/business/artikelApi.js +242 -0
- package/api/business/authApi.js +63 -0
- package/api/business/avApi.js +458 -0
- package/api/business/belegApi.js +365 -0
- package/api/business/belegPositionenApi.js +52 -0
- package/api/business/benutzerApi.js +96 -0
- package/api/business/fakturaApi.js +88 -0
- package/api/business/farbeApi.js +129 -0
- package/api/business/fileApi.js +72 -0
- package/api/business/historieApi.js +144 -0
- package/api/business/index.js +63 -0
- package/api/business/kontaktApi.js +70 -0
- package/api/business/lagerApi.js +162 -0
- package/api/business/lieferungApi.js +127 -0
- package/api/business/mailApi.js +41 -0
- package/api/business/mandantApi.js +137 -0
- package/api/business/materialApi.js +37 -0
- package/api/business/printApi.js +49 -0
- package/api/business/produktionApi.js +141 -0
- package/api/business/rechnungApi.js +155 -0
- package/api/business/serienApi.js +375 -0
- package/api/business/settingsApi.js +168 -0
- package/api/business/systemApi.js +209 -0
- package/api/business/uiApi.js +256 -0
- package/api/business/utilityApi.js +288 -0
- package/api/business/vorgangApi.js +128 -0
- package/api/dtos/allgemein.js +107 -0
- package/api/dtos/artikel.js +46 -0
- package/api/dtos/av.js +171 -0
- package/api/dtos/belege.js +614 -0
- package/api/dtos/benutzer.js +101 -0
- package/api/dtos/druck.js +50 -0
- package/api/dtos/faktura.js +128 -0
- package/api/dtos/farben.js +93 -0
- package/api/dtos/index.js +501 -0
- package/api/dtos/kunden.js +217 -0
- package/api/dtos/lager.js +66 -0
- package/api/dtos/mail.js +30 -0
- package/api/dtos/mandanten.js +60 -0
- package/api/dtos/nachrichten.js +18 -0
- package/api/dtos/produktGruppen.js +18 -0
- package/api/dtos/produktion.js +564 -0
- package/api/dtos/settings.js +172 -0
- package/api/dtos/technik.js +163 -0
- package/api/dtos/ui.js +496 -0
- package/api/dtos/webjob.js +12 -0
- package/api/fluentApi.js +10 -8
- package/api/fluentAuthManager.js +22 -14
- package/api/fluentRestClient.js +7 -7
- package/api/idasFluentApi.js +458 -0
- package/index.js +53 -6
- package/package.json +1 -1
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('../fluentApi.js').FluentApi} FluentApi
|
|
3
|
+
* @typedef {import('../dtos/belege.js').BelegStatusDTO} BelegStatusDTO
|
|
4
|
+
* @typedef {import('../dtos/belege.js').VorgangDTO} VorgangDTO
|
|
5
|
+
* @typedef {import('../dtos/belege.js').BelegartWechselDTO} BelegartWechselDTO
|
|
6
|
+
* @typedef {import('../dtos/belege.js').VorgangListItemDTO} VorgangListItemDTO
|
|
7
|
+
* @typedef {import('../dtos/belege.js').VorgangStatusDTO} VorgangStatusDTO
|
|
8
|
+
* @typedef {import('../dtos/belege.js').VorgangStatusTableDTO} VorgangStatusTableDTO
|
|
9
|
+
* @typedef {import('../dtos/belege.js').BaseListItemDTO} BaseListItemDTO
|
|
10
|
+
* @typedef {import('../dtos/belege.js').VorgangHistorienDTO} VorgangHistorienDTO
|
|
11
|
+
* @typedef {import('../dtos/belege.js').BelegHistorienDTO} BelegHistorienDTO
|
|
12
|
+
* @typedef {import('../dtos/belege.js').BelegPositionHistorienDTO} BelegPositionHistorienDTO
|
|
13
|
+
* @typedef {import('../dtos/produktion.js').SerieHistorieDTO} SerieHistorieDTO
|
|
14
|
+
* @typedef {import('../dtos/belege.js').VorgangHistorieDTO} VorgangHistorieDTO
|
|
15
|
+
* @typedef {import('../dtos/belege.js').BelegHistorieDTO} BelegHistorieDTO
|
|
16
|
+
* @typedef {import('../dtos/belege.js').BelegPositionHistorieDTO} BelegPositionHistorieDTO
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Beleg API - Document and process management
|
|
21
|
+
* @param {FluentApi} fluentApi
|
|
22
|
+
*/
|
|
23
|
+
export function createBelegApi(fluentApi) {
|
|
24
|
+
return {
|
|
25
|
+
// BelegStatusWebRoutinen
|
|
26
|
+
/**
|
|
27
|
+
* Get beleg status
|
|
28
|
+
* @param {string} belegGuid
|
|
29
|
+
* @returns {Promise<BelegStatusDTO>}
|
|
30
|
+
*/
|
|
31
|
+
getBelegStatus: (belegGuid) => fluentApi.get(`BelegStatus?id=${belegGuid}`),
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Set beleg status
|
|
35
|
+
* @param {string} belegGuid
|
|
36
|
+
* @param {string} statusCode
|
|
37
|
+
* @param {string} [statusText]
|
|
38
|
+
* @returns {Promise<BelegStatusDTO>}
|
|
39
|
+
*/
|
|
40
|
+
setBelegStatus: (belegGuid, statusCode, statusText = "") =>
|
|
41
|
+
fluentApi.put("BelegStatus", { belegGuid, neuerStatus: statusCode, neuerStatusText: statusText }),
|
|
42
|
+
|
|
43
|
+
// BelegArtWebRoutinen
|
|
44
|
+
/**
|
|
45
|
+
* Copy beleg with new beleg art
|
|
46
|
+
* @param {string} belegGuid
|
|
47
|
+
* @param {string} neueBelegArt
|
|
48
|
+
* @param {boolean} [saldenKopieren=false]
|
|
49
|
+
* @returns {Promise<VorgangDTO>}
|
|
50
|
+
*/
|
|
51
|
+
belegKopieren: (belegGuid, neueBelegArt, saldenKopieren = false) =>
|
|
52
|
+
fluentApi.post(`BelegArt?bguid=${belegGuid}&saldenKopieren=${saldenKopieren}&neueBelegArt=${neueBelegArt}`, {}),
|
|
53
|
+
|
|
54
|
+
// BelegArtPosWebRoutinen
|
|
55
|
+
/**
|
|
56
|
+
* Change beleg art for position
|
|
57
|
+
* @param {BelegartWechselDTO} dto
|
|
58
|
+
* @returns {Promise<VorgangDTO>}
|
|
59
|
+
*/
|
|
60
|
+
belegWechsel: (dto) => fluentApi.put("BelegArtPos", dto),
|
|
61
|
+
|
|
62
|
+
// BelegLoeschenWebRoutinen
|
|
63
|
+
/**
|
|
64
|
+
* Delete beleg
|
|
65
|
+
* @param {string} belegGuid
|
|
66
|
+
* @returns {Promise<VorgangDTO>}
|
|
67
|
+
*/
|
|
68
|
+
belegLoeschen: (belegGuid) => fluentApi.delete(`Vorgang/DeleteBeleg/${belegGuid}`),
|
|
69
|
+
|
|
70
|
+
// VorgangListeWebRoutinen
|
|
71
|
+
/**
|
|
72
|
+
* Load vorgang list by year
|
|
73
|
+
* @param {number} jahr
|
|
74
|
+
* @param {boolean} [includeASP=false]
|
|
75
|
+
* @param {boolean} [includeAdditionalProperties=false]
|
|
76
|
+
* @returns {Promise<VorgangListItemDTO[]>}
|
|
77
|
+
*/
|
|
78
|
+
ladeVorgangsListeByJahr: (jahr, includeASP = false, includeAdditionalProperties = false) =>
|
|
79
|
+
fluentApi.get(`VorgangListe/?jahr=${jahr}&includeASP=${includeASP}&includeAdditionalProperties=${includeAdditionalProperties}`),
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Load vorgang list by status and year
|
|
83
|
+
* @param {string} status
|
|
84
|
+
* @param {number} jahr
|
|
85
|
+
* @param {boolean} [includeASP=false]
|
|
86
|
+
* @param {boolean} [includeAdditionalProperties=false]
|
|
87
|
+
* @returns {Promise<VorgangListItemDTO[]>}
|
|
88
|
+
*/
|
|
89
|
+
ladeVorgangsListeByStatus: (status, jahr, includeASP = false, includeAdditionalProperties = false) =>
|
|
90
|
+
fluentApi.get(`VorgangListe/?status=${status}&jahr=${jahr}&includeASP=${includeASP}&includeAdditionalProperties=${includeAdditionalProperties}`),
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Load vorgang list by status, year, and change date
|
|
94
|
+
* @param {string} status
|
|
95
|
+
* @param {number} jahr
|
|
96
|
+
* @param {Date} changedSince
|
|
97
|
+
* @param {boolean} [includeASP=false]
|
|
98
|
+
* @param {boolean} [includeAdditionalProperties=false]
|
|
99
|
+
* @returns {Promise<VorgangListItemDTO[]>}
|
|
100
|
+
*/
|
|
101
|
+
ladeVorgangsListeByStatusAndDate: (status, jahr, changedSince, includeASP = false, includeAdditionalProperties = false) =>
|
|
102
|
+
fluentApi.get(`VorgangListe/?status=${status}&jahr=${jahr}&changedSince=${changedSince.toISOString()}&includeASP=${includeASP}&includeAdditionalProperties=${includeAdditionalProperties}`),
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Load vorgang list with full filters
|
|
106
|
+
* @param {number} jahr
|
|
107
|
+
* @param {string} status
|
|
108
|
+
* @param {Date} changedSince
|
|
109
|
+
* @param {string} [art]
|
|
110
|
+
* @param {boolean} [includeArchive=false]
|
|
111
|
+
* @param {boolean} [includeOthersData=false]
|
|
112
|
+
* @param {string} [search]
|
|
113
|
+
* @param {boolean} [includeASP=false]
|
|
114
|
+
* @param {boolean} [includeAdditionalProperties=false]
|
|
115
|
+
* @returns {Promise<VorgangListItemDTO[]>}
|
|
116
|
+
*/
|
|
117
|
+
ladeVorgangsListe: (jahr, status, changedSince, art = "", includeArchive = false, includeOthersData = false, search = "", includeASP = false, includeAdditionalProperties = false) =>
|
|
118
|
+
fluentApi.get(`VorgangListe/?status=${status}&jahr=${jahr}&changedSince=${changedSince.toISOString()}&art=${art}&includeArchive=${includeArchive}&includeOthersData=${includeOthersData}&search=${search}&includeASP=${includeASP}&includeAdditionalProperties=${includeAdditionalProperties}`),
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Load vorgang list by customer
|
|
122
|
+
* @param {string} kundeGuid
|
|
123
|
+
* @returns {Promise<VorgangListItemDTO[]>}
|
|
124
|
+
*/
|
|
125
|
+
ladeVorgangsListeByKunde: (kundeGuid) => fluentApi.get(`VorgangListe/?kundeGuid=${kundeGuid}`),
|
|
126
|
+
|
|
127
|
+
// VorgangStatusTableWebRoutinen
|
|
128
|
+
/**
|
|
129
|
+
* Update vorgang status table for function
|
|
130
|
+
* @param {VorgangStatusTableDTO} dto
|
|
131
|
+
* @returns {Promise<void>}
|
|
132
|
+
*/
|
|
133
|
+
updateVorgangStatusTableForFunction: (dto) => fluentApi.post("VorgangStatus/UpdateVorgangStatusTableForFunction", dto),
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Get not calculated vorgang status table for function
|
|
137
|
+
* @returns {Promise<VorgangStatusTableDTO[]>}
|
|
138
|
+
*/
|
|
139
|
+
getNotCalculatedVorgangStatusTableForFunction: () =>
|
|
140
|
+
fluentApi.get("VorgangStatus/GetNotCalculatedVorgangStatusTableForFunction"),
|
|
141
|
+
|
|
142
|
+
// VorgangReaktivierenWebRoutinen
|
|
143
|
+
/**
|
|
144
|
+
* Reactivate vorgang
|
|
145
|
+
* @param {BelegartWechselDTO} dto
|
|
146
|
+
* @returns {Promise<VorgangDTO>}
|
|
147
|
+
*/
|
|
148
|
+
vorgangReaktivieren: (dto) => fluentApi.put("VorgangReaktivieren", dto),
|
|
149
|
+
|
|
150
|
+
// LieferscheineWebRoutinen
|
|
151
|
+
/**
|
|
152
|
+
* Load delivery note list by year
|
|
153
|
+
* @param {number} jahr
|
|
154
|
+
* @returns {Promise<BaseListItemDTO[]>}
|
|
155
|
+
*/
|
|
156
|
+
ladeLieferscheinListeByJahr: (jahr) => fluentApi.get(`Lieferscheine/?jahr=${jahr}`),
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Load delivery note list by status and year
|
|
160
|
+
* @param {string} status
|
|
161
|
+
* @param {number} jahr
|
|
162
|
+
* @returns {Promise<BaseListItemDTO[]>}
|
|
163
|
+
*/
|
|
164
|
+
ladeLieferscheinListeByStatus: (status, jahr) => fluentApi.get(`Lieferscheine/?status=${status}&jahr=${jahr}`),
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Load delivery note list by status, year, and change date
|
|
168
|
+
* @param {string} status
|
|
169
|
+
* @param {number} jahr
|
|
170
|
+
* @param {Date} changedSince
|
|
171
|
+
* @returns {Promise<BaseListItemDTO[]>}
|
|
172
|
+
*/
|
|
173
|
+
ladeLieferscheinListeByStatusAndDate: (status, jahr, changedSince) =>
|
|
174
|
+
fluentApi.get(`Lieferscheine/?status=${status}&jahr=${jahr}&changedSince=${changedSince.toISOString()}`),
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Load delivery note list with full filters
|
|
178
|
+
* @param {number} jahr
|
|
179
|
+
* @param {string} status
|
|
180
|
+
* @param {Date} changedSince
|
|
181
|
+
* @param {string} [art]
|
|
182
|
+
* @param {boolean} [includeArchive=false]
|
|
183
|
+
* @param {boolean} [includeOthersData=false]
|
|
184
|
+
* @param {string} [search]
|
|
185
|
+
* @returns {Promise<BaseListItemDTO[]>}
|
|
186
|
+
*/
|
|
187
|
+
ladeLieferscheinListe: (jahr, status, changedSince, art = "", includeArchive = false, includeOthersData = false, search = "") =>
|
|
188
|
+
fluentApi.get(`Lieferscheine/?status=${status}&jahr=${jahr}&changedSince=${changedSince.toISOString()}&art=${art}&includeArchive=${includeArchive}&includeOthersData=${includeOthersData}&search=${search}`),
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Get vorgang by delivery note GUID
|
|
192
|
+
* @param {string} lieferscheinGuid
|
|
193
|
+
* @returns {Promise<VorgangDTO>}
|
|
194
|
+
*/
|
|
195
|
+
getVorgangByLieferscheinGuid: (lieferscheinGuid) => fluentApi.get(`Lieferscheine/${lieferscheinGuid}`),
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Get vorgang status
|
|
199
|
+
* @param {string} vorgangGuid
|
|
200
|
+
* @returns {Promise<VorgangStatusDTO>}
|
|
201
|
+
*/
|
|
202
|
+
getLieferscheinStatus: (vorgangGuid) => fluentApi.get(`VorgangStatus/${vorgangGuid}`),
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Set vorgang status
|
|
206
|
+
* @param {string} vorgangGuid
|
|
207
|
+
* @param {string} statusCode
|
|
208
|
+
* @returns {Promise<VorgangStatusDTO>}
|
|
209
|
+
*/
|
|
210
|
+
setLieferscheinStatus: (vorgangGuid, statusCode) =>
|
|
211
|
+
fluentApi.put("VorgangStatus", { vorgangGuid, neuerStatus: statusCode }),
|
|
212
|
+
|
|
213
|
+
// HistorieWebRoutinen
|
|
214
|
+
/**
|
|
215
|
+
* Get vorgang history
|
|
216
|
+
* @param {string} vorgangGuid
|
|
217
|
+
* @param {boolean} [includeBelege=false]
|
|
218
|
+
* @param {boolean} [includePositionen=false]
|
|
219
|
+
* @returns {Promise<VorgangHistorienDTO>}
|
|
220
|
+
*/
|
|
221
|
+
getVorgangHistorie: (vorgangGuid, includeBelege = false, includePositionen = false) =>
|
|
222
|
+
fluentApi.get(`HistorieVorgang?vorgangGuid=${vorgangGuid}&includeBelege=${includeBelege}&includePositionen=${includePositionen}`),
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Get beleg history
|
|
226
|
+
* @param {string} belegGuid
|
|
227
|
+
* @param {boolean} [includePositionen=false]
|
|
228
|
+
* @returns {Promise<BelegHistorienDTO>}
|
|
229
|
+
*/
|
|
230
|
+
getBelegHistorie: (belegGuid, includePositionen = false) =>
|
|
231
|
+
fluentApi.get(`HistorieBeleg?belegGuid=${belegGuid}&includePositionen=${includePositionen}`),
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Get beleg position history
|
|
235
|
+
* @param {string} positionGuid
|
|
236
|
+
* @returns {Promise<BelegPositionHistorienDTO>}
|
|
237
|
+
*/
|
|
238
|
+
getBelegPositionHistorie: (positionGuid) =>
|
|
239
|
+
fluentApi.get(`HistorieBelegPosition?positionGuid=${positionGuid}`),
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Get serie history since date
|
|
243
|
+
* @param {Date} sinceWhen
|
|
244
|
+
* @returns {Promise<SerieHistorieDTO[]>}
|
|
245
|
+
*/
|
|
246
|
+
getSerieHistorieSince: (sinceWhen) =>
|
|
247
|
+
fluentApi.get(`HistorieSerie?createdSince=${sinceWhen.toISOString()}`),
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Get serie history by GUID
|
|
251
|
+
* @param {string} serieGuid
|
|
252
|
+
* @returns {Promise<SerieHistorieDTO[]>}
|
|
253
|
+
*/
|
|
254
|
+
getSerieHistorie: (serieGuid) => fluentApi.get(`HistorieSerie?serieGuid=${serieGuid}`),
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Add vorgang history
|
|
258
|
+
* @param {string} vorgangGuid
|
|
259
|
+
* @param {VorgangHistorieDTO} historyDto
|
|
260
|
+
* @returns {Promise<void>}
|
|
261
|
+
*/
|
|
262
|
+
addVorgangHistorie: (vorgangGuid, historyDto) =>
|
|
263
|
+
fluentApi.post(`HistorieVorgang?vorgangGuid=${vorgangGuid}`, historyDto),
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Add beleg history
|
|
267
|
+
* @param {string} belegGuid
|
|
268
|
+
* @param {BelegHistorieDTO} historyDto
|
|
269
|
+
* @returns {Promise<void>}
|
|
270
|
+
*/
|
|
271
|
+
addBelegHistorie: (belegGuid, historyDto) =>
|
|
272
|
+
fluentApi.post(`HistorieBeleg?belegGuid=${belegGuid}`, historyDto),
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Add beleg position history
|
|
276
|
+
* @param {string} positionGuid
|
|
277
|
+
* @param {BelegPositionHistorieDTO} historyDto
|
|
278
|
+
* @returns {Promise<void>}
|
|
279
|
+
*/
|
|
280
|
+
addBelegPositionHistorie: (positionGuid, historyDto) =>
|
|
281
|
+
fluentApi.post(`HistorieBelegPosition?positionGuid=${positionGuid}`, historyDto),
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Add serie history
|
|
285
|
+
* @param {SerieHistorieDTO} historyDto
|
|
286
|
+
* @returns {Promise<void>}
|
|
287
|
+
*/
|
|
288
|
+
addSerieHistorie: (historyDto) => fluentApi.post("HistorieSerie", historyDto),
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Add vorgang history from function
|
|
292
|
+
* @param {string} vorgangGuid
|
|
293
|
+
* @param {VorgangHistorieDTO} historyDto
|
|
294
|
+
* @param {number} mandantID
|
|
295
|
+
* @returns {Promise<void>}
|
|
296
|
+
*/
|
|
297
|
+
addVorgangHistorieFromFunction: (vorgangGuid, historyDto, mandantID) =>
|
|
298
|
+
fluentApi.post(`AddVorgangHistorieFromFunction?vorgangGuid=${vorgangGuid}&mandantID=${mandantID}`, historyDto),
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Add beleg position history from function
|
|
302
|
+
* @param {string} positionGuid
|
|
303
|
+
* @param {BelegPositionHistorieDTO} historyDto
|
|
304
|
+
* @param {number} mandantID
|
|
305
|
+
* @returns {Promise<void>}
|
|
306
|
+
*/
|
|
307
|
+
addBelegPositionHistorieFromFunction: (positionGuid, historyDto, mandantID) =>
|
|
308
|
+
fluentApi.post(`AddBelegPositionHistorieFromFunction?positionGuid=${positionGuid}&mandantID=${mandantID}`, historyDto),
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Add serie history from function
|
|
312
|
+
* @param {SerieHistorieDTO} historyDto
|
|
313
|
+
* @param {number} mandantID
|
|
314
|
+
* @returns {Promise<void>}
|
|
315
|
+
*/
|
|
316
|
+
addSerieHistorieFromFunction: (historyDto, mandantID) =>
|
|
317
|
+
fluentApi.post(`AddBelegPositionHistorieFromFunction?mandantID=${mandantID}`, historyDto),
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Get last editor for beleg
|
|
321
|
+
* @param {string} belegGuid
|
|
322
|
+
* @returns {Promise<string>}
|
|
323
|
+
*/
|
|
324
|
+
getLetzterBearbeiter: (belegGuid) =>
|
|
325
|
+
fluentApi.get(`HistorieBeleg/LetzterBearbeiter?belegGuid=${belegGuid}`),
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Get last editors for belege
|
|
329
|
+
* @param {string[]} belegGuids
|
|
330
|
+
* @returns {Promise<Record<string, string>>}
|
|
331
|
+
*/
|
|
332
|
+
getLetzteBearbeiter: (belegGuids) =>
|
|
333
|
+
fluentApi.post("HistorieBeleg/LetzteBearbeiter", belegGuids),
|
|
334
|
+
|
|
335
|
+
// PositionStornoWebRoutinen
|
|
336
|
+
/**
|
|
337
|
+
* Storniere position
|
|
338
|
+
* @param {string} positionGuid
|
|
339
|
+
* @returns {Promise<void>}
|
|
340
|
+
*/
|
|
341
|
+
positionStornieren: (positionGuid) =>
|
|
342
|
+
fluentApi.post(`PositionStorno?posGuid=${positionGuid}`, null),
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Storniere beleg
|
|
346
|
+
* @param {string} belegGuid
|
|
347
|
+
* @returns {Promise<void>}
|
|
348
|
+
*/
|
|
349
|
+
belegStornieren: (belegGuid) =>
|
|
350
|
+
fluentApi.post(`BelegStorno?belegGuid=${belegGuid}`, null),
|
|
351
|
+
|
|
352
|
+
// FremdfertigungWebRoutinen
|
|
353
|
+
/**
|
|
354
|
+
* Order external production
|
|
355
|
+
* @param {string} belegGuid
|
|
356
|
+
* @returns {Promise<void>}
|
|
357
|
+
*/
|
|
358
|
+
fremdfertigungBestellen: (belegGuid) =>
|
|
359
|
+
fluentApi.put(`Fremdfertigung/?bguid=${belegGuid}`, null),
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* @typedef {ReturnType<typeof createBelegApi>} BelegApi
|
|
365
|
+
*/
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview BelegPositionen API - Business API for BelegPositionen operations
|
|
3
|
+
* Converted from C# BelegPositionenWebRoutinen.cs
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** @typedef {import('../dtos/belege.js').BelegPositionDTO} BelegPositionDTO */
|
|
7
|
+
/** @typedef {import('../dtos/belege.js').VorgangDTO} VorgangDTO */
|
|
8
|
+
/** @typedef {import('../fluentApi.js').FluentApi} FluentApi */
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {Object} BelegPositionenApi
|
|
12
|
+
* @property {(gesperrtStatus: boolean, positionen: string[]) => Promise<string[]>} setBelegPositionGesperrtStatus - Set locked status for beleg positions
|
|
13
|
+
* @property {(belegPositionGuid: string, mandantId: number) => Promise<VorgangDTO>} getVorgangForFunction - Get vorgang for function by beleg position GUID and mandant ID
|
|
14
|
+
* @property {(belegPositionGuidList: string[]) => Promise<BelegPositionDTO[]>} getBelegPositionenFromGuidList - Get beleg positions from a list of GUIDs
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @param {FluentApi} fluentApi
|
|
19
|
+
* @returns {BelegPositionenApi}
|
|
20
|
+
*/
|
|
21
|
+
export function createBelegPositionenApi(fluentApi) {
|
|
22
|
+
return {
|
|
23
|
+
/**
|
|
24
|
+
* Set the locked status for a list of beleg positions
|
|
25
|
+
* @param {boolean} gesperrtStatus - The locked status to set
|
|
26
|
+
* @param {string[]} positionen - Array of beleg position GUIDs
|
|
27
|
+
* @returns {Promise<string[]>} - Array of updated position GUIDs
|
|
28
|
+
*/
|
|
29
|
+
async setBelegPositionGesperrtStatus(gesperrtStatus, positionen) {
|
|
30
|
+
return await fluentApi.put(`BelegPositionGesperrtStatus/SetStatus/${gesperrtStatus}`, positionen);
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get vorgang for function by beleg position GUID and mandant ID
|
|
35
|
+
* @param {string} belegPositionGuid - The GUID of the beleg position
|
|
36
|
+
* @param {number} mandantId - The mandant ID
|
|
37
|
+
* @returns {Promise<VorgangDTO>} - The vorgang DTO
|
|
38
|
+
*/
|
|
39
|
+
async getVorgangForFunction(belegPositionGuid, mandantId) {
|
|
40
|
+
return await fluentApi.get(`BelegPositionen/GetVorgangForFunction?belegPositionGuid=${belegPositionGuid}&mandantId=${mandantId}`);
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get beleg positions from a list of GUIDs
|
|
45
|
+
* @param {string[]} belegPositionGuidList - Array of beleg position GUIDs
|
|
46
|
+
* @returns {Promise<BelegPositionDTO[]>} - Array of beleg position DTOs
|
|
47
|
+
*/
|
|
48
|
+
async getBelegPositionenFromGuidList(belegPositionGuidList) {
|
|
49
|
+
return await fluentApi.post("BelegPositionen/GetByGuidList", belegPositionGuidList);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('../fluentApi.js').FluentApi} FluentApi
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {import('../dtos/index.js').BenutzerDTO} BenutzerDTO
|
|
7
|
+
* @typedef {import('../dtos/index.js').PasswortAendernDTO} PasswortAendernDTO
|
|
8
|
+
* @typedef {import('../dtos/index.js').RolleDTO} RolleDTO
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates a Benutzer API client
|
|
13
|
+
* @param {FluentApi} fluentApi - The fluent API instance
|
|
14
|
+
*/
|
|
15
|
+
export function createBenutzerApi(fluentApi) {
|
|
16
|
+
return {
|
|
17
|
+
/**
|
|
18
|
+
* Get list of users for a mandant
|
|
19
|
+
* @param {string} mandant - Mandant GUID
|
|
20
|
+
* @param {boolean} [mitRollenUndRechten=true] - Include roles and rights
|
|
21
|
+
* @returns {Promise<BenutzerDTO[]>} List of users
|
|
22
|
+
*/
|
|
23
|
+
getBenutzerListe: async (mandant, mitRollenUndRechten = true) => {
|
|
24
|
+
return await fluentApi.get(`BenutzerListe?id=${mandant}&mitRollenUndRechten=${mitRollenUndRechten}`);
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get a single user by GUID
|
|
29
|
+
* @param {string} benutzer - User GUID
|
|
30
|
+
* @param {boolean} [mitRollenUndRechten=true] - Include roles and rights
|
|
31
|
+
* @returns {Promise<BenutzerDTO>} User data
|
|
32
|
+
*/
|
|
33
|
+
getBenutzer: async (benutzer, mitRollenUndRechten = true) => {
|
|
34
|
+
return await fluentApi.get(`Benutzer?id=${benutzer}&mitRollenUndRechten=${mitRollenUndRechten}`);
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Save multiple users
|
|
39
|
+
* @param {BenutzerDTO[]} list - List of users to save
|
|
40
|
+
* @returns {Promise<void>}
|
|
41
|
+
*/
|
|
42
|
+
saveBenutzerList: async (list) => {
|
|
43
|
+
await Promise.all(list.map(benutzer =>
|
|
44
|
+
fluentApi.put("Benutzer", benutzer)
|
|
45
|
+
));
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Save a single user
|
|
50
|
+
* @param {BenutzerDTO} benutzer - User data to save
|
|
51
|
+
* @returns {Promise<any>} Response
|
|
52
|
+
*/
|
|
53
|
+
saveBenutzer: async (benutzer) => {
|
|
54
|
+
return await fluentApi.put("Benutzer", benutzer);
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Request password reset for a user
|
|
59
|
+
* @param {string} benutzerName - User email/name
|
|
60
|
+
* @returns {Promise<any>} Response
|
|
61
|
+
*/
|
|
62
|
+
passwortReset: async (benutzerName) => {
|
|
63
|
+
const encodedName = encodeURIComponent(benutzerName);
|
|
64
|
+
return await fluentApi.get(`PasswortReset?email=${encodedName}`);
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Change password
|
|
69
|
+
* @param {PasswortAendernDTO} passwortAendernData - Password change data
|
|
70
|
+
* @returns {Promise<any>} Response
|
|
71
|
+
*/
|
|
72
|
+
passwortAendern: async (passwortAendernData) => {
|
|
73
|
+
return await fluentApi.post("PasswortAendern", passwortAendernData);
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Trigger SIC sync web job
|
|
78
|
+
* @returns {Promise<any>} Response
|
|
79
|
+
*/
|
|
80
|
+
sicSyncWebJob: async () => {
|
|
81
|
+
return await fluentApi.post("Benutzer/SICSyncWebJob", null);
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Get all roles
|
|
86
|
+
* @returns {Promise<RolleDTO[]>} List of all roles
|
|
87
|
+
*/
|
|
88
|
+
getRollenAll: async () => {
|
|
89
|
+
return await fluentApi.get("Rollen");
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @typedef {ReturnType<typeof createBenutzerApi>} BenutzerApi
|
|
96
|
+
*/
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('../fluentApi.js').FluentApi} FluentApi
|
|
3
|
+
* @typedef {import('../dtos/faktura.js').SetFakturaDTO} SetFakturaDTO
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Faktura API - Faktura kennzeichen (status flags) management
|
|
8
|
+
* Corresponds to FakturaWebRoutinen in C#
|
|
9
|
+
* @param {FluentApi} fluentApi
|
|
10
|
+
*/
|
|
11
|
+
export function createFakturaApi(fluentApi) {
|
|
12
|
+
return {
|
|
13
|
+
/**
|
|
14
|
+
* Get vorgang identifier
|
|
15
|
+
* @param {string} vorgangGuid
|
|
16
|
+
* @returns {Promise<string>}
|
|
17
|
+
*/
|
|
18
|
+
getVorgangKennzeichen: (vorgangGuid) =>
|
|
19
|
+
fluentApi.get(`Faktura/GetVorgangKennzeichen?vorgangGuid=${vorgangGuid}`),
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get beleg identifier
|
|
23
|
+
* @param {string} belegGuid
|
|
24
|
+
* @returns {Promise<string>}
|
|
25
|
+
*/
|
|
26
|
+
getBelegKennzeichen: (belegGuid) =>
|
|
27
|
+
fluentApi.get(`Faktura/GetBelegKennzeichen?belegGuid=${belegGuid}`),
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get beleg position identifier
|
|
31
|
+
* @param {string} belegPositionGuid
|
|
32
|
+
* @returns {Promise<string>}
|
|
33
|
+
*/
|
|
34
|
+
getBelegPositionKennzeichen: (belegPositionGuid) =>
|
|
35
|
+
fluentApi.get(`Faktura/GetBelegPositionKennzeichen?belegPositionGuid=${belegPositionGuid}`),
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get beleg position AV identifier
|
|
39
|
+
* @param {string} belegPositionAvGuid
|
|
40
|
+
* @returns {Promise<string>}
|
|
41
|
+
*/
|
|
42
|
+
getBelegPositionAvKennzeichen: (belegPositionAvGuid) =>
|
|
43
|
+
fluentApi.get(`Faktura/GetBelegPositionAVKennzeichen?belegPositionAvGuid=${belegPositionAvGuid}`),
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Set vorgang identifier
|
|
47
|
+
* @param {SetFakturaDTO} dto
|
|
48
|
+
* @returns {Promise<string>}
|
|
49
|
+
*/
|
|
50
|
+
setVorgangKennzeichen: (dto) =>
|
|
51
|
+
fluentApi.post("Faktura/SetVorgangKennzeichen", dto),
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Set beleg identifier
|
|
55
|
+
* @param {SetFakturaDTO} dto
|
|
56
|
+
* @returns {Promise<string>}
|
|
57
|
+
*/
|
|
58
|
+
setBelegKennzeichen: (dto) =>
|
|
59
|
+
fluentApi.post("Faktura/SetBelegKennzeichen", dto),
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Set beleg position identifier
|
|
63
|
+
* @param {SetFakturaDTO} dto
|
|
64
|
+
* @returns {Promise<string>}
|
|
65
|
+
*/
|
|
66
|
+
setBelegPositionKennzeichen: (dto) =>
|
|
67
|
+
fluentApi.post("Faktura/SetBelegPositionKennzeichen", dto),
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Set beleg position AV identifier
|
|
71
|
+
* @param {SetFakturaDTO} dto
|
|
72
|
+
* @returns {Promise<string>}
|
|
73
|
+
*/
|
|
74
|
+
setBelegPositionAvKennzeichen: (dto) =>
|
|
75
|
+
fluentApi.post("Faktura/SetBelegPositionAVKennzeichen", dto),
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Set automatic invoicing in delivery notes
|
|
79
|
+
* @returns {Promise<void>}
|
|
80
|
+
*/
|
|
81
|
+
setFakturaInAbAuto: () =>
|
|
82
|
+
fluentApi.post("Faktura/SetFakturaInABAuto", null),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @typedef {ReturnType<typeof createFakturaApi>} FakturaApi
|
|
88
|
+
*/
|