import{t as e}from"./http-BdoVLsWz.js";import{n as t}from"./auth-D-MtTwP6.js";var{defineStore:n}=window.pinia,r=n(`customerInvoiceStore`,{state:()=>({totalInvoices:0,invoices:[],selectedViewInvoice:[]}),actions:{fetchInvoices(n,r){return new Promise((i,a)=>{e.get(`/api/v1/${r}/customer/invoices`,{params:n}).then(e=>{this.invoices=e.data.data,this.totalInvoices=e.data.meta.invoiceTotalCount,i(e)}).catch(e=>{t(e),a(e)})})},fetchViewInvoice(n,r){return new Promise((i,a)=>{e.get(`/api/v1/${r}/customer/invoices/${n.id}`,{params:n}).then(e=>{this.selectedViewInvoice=e.data.data,i(e)}).catch(e=>{t(e),a(e)})})},searchInvoice(n,r){return new Promise((i,a)=>{e.get(`/api/v1/${r}/customer/invoices`,{params:n}).then(e=>{this.invoices=e.data,i(e)}).catch(e=>{t(e),a(e)})})}}});export{r as t};