import{a as d}from"./chunk-KFDEPCY3.js";import{f as u}from"./chunk-GYAYEJFB.js";import{L as a,ea as o,ka as n,r as i}from"./chunk-LEOKSAW2.js";import{a as f}from"./chunk-K4ALXBGI.js";var s=(()=>{class r{constructor(t){this._http=t}createNewDraftDocument(t){return this._http.post("/api/draft-document",f({},t))}getDraftDocumentById(t){return this._http.get(`/api/draft-document/${t}`).pipe(i(e=>(e.body=JSON.parse(e.jsonBody),e)))}editDraftDocument(t,e){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:d})}static{this.\u0275fac=function(e){return new(e||r)(n(u))}}static{this.\u0275prov=o({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(i(c=>(c.data.forEach(p=>p.body=JSON.parse(p.jsonBody)),c)),a(1))}createDraft(t){return this._draftServiceApi.createNewDraftDocument(t)}getDraftById(t){return this._draftServiceApi.getDraftDocumentById(t).pipe(i(e=>(e.body=JSON.parse(e.jsonBody),e)),a(1))}editDraft(t,e){return this._draftServiceApi.editDraftDocument(t,e).pipe(a(1))}deleteDraft(t){return this._draftServiceApi.deleteDraftDocument(t).pipe(a(1))}static{this.\u0275fac=function(e){return new(e||r)(n(s))}}static{this.\u0275prov=o({token:r,factory:r.\u0275fac})}}return r})();export{s as a,j as b};
