import{t as e}from"./http-BrugN6o-.js";import{n as t}from"./auth-CmHHJsI-.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};