import{T as a,U as i,H as f}from"./index-C5GbdPxY.js";function h(t,s=!1,r=!1){return a.get(`/v1/purchases/${t}`,{params:{return_all_translations:s,with_receipt:r}})}function d(t,s){return a.put(`/v1/purchases/${t}`,s)}function m(t){return a.post("/v1/purchases",t)}function l(t){return a.get("/v1/purchases/form/meta",{params:{branch_id:t}})}function v(t,s){return a.post(`/v1/purchases/${t}/mark-as-received`,s)}function g(){const t=i(),{t:s}=f();return{getShowData:async(o,c=!1,p=!1)=>{var n,u;try{return{status:200,data:(await h(o,c,p)).data.body}}catch(e){return((n=e==null?void 0:e.response)==null?void 0:n.status)!==404&&t.error(s("core::errors.an_unexpected_error_occurred")),{status:(u=e==null?void 0:e.response)==null?void 0:u.status}}},update:d,store:m,getFormMeta:l,markAsReceived:v}}export{g as u};
