import{a as f}from"./chunk-YO44C22F.js";import{a as u}from"./chunk-KOXD6BDO.js";import{f as d}from"./chunk-6VC7H3CZ.js";import{K as o,da as p,ja as c,r as a}from"./chunk-QMYHTLAJ.js";import{a as s}from"./chunk-K4ALXBGI.js";var m=(()=>{class r{constructor(t){this._http=t}createNewDraftDocument(t,e=!1){if(e){let i=f.append(u.SkipTimeout,"skipTimeout");return this._http.post("/api/draft-document",s({},t),{headers:i})}return this._http.post("/api/draft-document",s({},t))}getDraftDocumentById(t){return this._http.get(`/api/draft-document/${t}`).pipe(a(e=>(e.body=JSON.parse(e.jsonBody),e)))}editDraftDocument(t,e,i=!1){if(i){let n=f.append(u.SkipTimeout,"skipTimeout");return this._http.put(`/api/draft-document/${t}`,e,{headers:n})}return this._http.put(`/api/draft-document/${t}`,e)}deleteDraftDocument(t){return this._http.delete(`/api/draft-document/${t}`)}getAllDraftDocuments(t,e){return this._http.post(`/api/draft-document/all?documentType=${t.documentType}&warehouseId=${t.warehouseId}`,e,{headers:f})}static{this.\u0275fac=function(e){return new(e||r)(c(d))}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac})}}return r})();var j=(()=>{class r{constructor(t){this._draftServiceApi=t}getDrafts(t,e){return this._draftServiceApi.getAllDraftDocuments(t,e).pipe(a(i=>(i.data.forEach(n=>n.body=JSON.parse(n.jsonBody)),i)),o(1))}createDraft(t,e=!1){return this._draftServiceApi.createNewDraftDocument(t,e)}getDraftById(t){return this._draftServiceApi.getDraftDocumentById(t).pipe(a(e=>(e.body=JSON.parse(e.jsonBody),e)),o(1))}editDraft(t,e,i=!1){return this._draftServiceApi.editDraftDocument(t,e,i).pipe(o(1))}deleteDraft(t){return this._draftServiceApi.deleteDraftDocument(t).pipe(o(1))}static{this.\u0275fac=function(e){return new(e||r)(c(m))}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac})}}return r})();export{m as a,j as b};
