import{t as e}from"./http-BdoVLsWz.js";import{n as t}from"./auth-D-MtTwP6.js";var{defineStore:n}=window.pinia,r=n(`customerPaymentStore`,{state:()=>({payments:[],selectedViewPayment:[],totalPayments:0}),actions:{fetchPayments(n,r){return new Promise((i,a)=>{e.get(`/api/v1/${r}/customer/payments`,{params:n}).then(e=>{this.payments=e.data.data,this.totalPayments=e.data.meta.paymentTotalCount,i(e)}).catch(e=>{t(e),a(e)})})},fetchViewPayment(n,r){return new Promise((i,a)=>{e.get(`/api/v1/${r}/customer/payments/${n.id}`).then(e=>{this.selectedViewPayment=e.data.data,i(e)}).catch(e=>{t(e),a(e)})})},searchPayment(n,r){return new Promise((i,a)=>{e.get(`/api/v1/${r}/customer/payments`,{params:n}).then(e=>{this.payments=e.data,i(e)}).catch(e=>{t(e),a(e)})})},fetchPaymentModes(n,r){return new Promise((i,a)=>{e.get(`/api/v1/${r}/customer/payment-method`,{params:n}).then(e=>{i(e)}).catch(e=>{t(e),a(e)})})}}});export{r as t};