{"size": 1354, "ext": "js", "max_stars_repo_path": "app_colegio/src/services/PagoService.js", "max_stars_repo_name": "marlonSamuel/colegio_sj", "max_stars_repo_stars_event_min_datetime": "2021-09-06T14:21:39.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-06T14:21:39.000Z", "max_issues_repo_path": "app_colegio/src/services/PagoService.js", "max_issues_repo_name": "ggaitanr/colegio_fo", "max_issues_repo_issues_event_min_datetime": "2020-12-27T18:34:32.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-18T18:11:54.000Z", "max_forks_repo_path": "app_colegio/src/services/PagoService.js", "max_forks_repo_name": "marlonSamuel/colegio_sj", "max_forks_repo_forks_event_min_datetime": "2021-09-06T14:21:41.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-06T14:21:41.000Z"}
{"max_stars_count": 1, "max_issues_count": 10, "max_forks_count": 1, "avg_line_length": 23.3448275862, "max_line_length": 103, "alphanum_fraction": 0.5553914328}
class PagoService {
    axios
    baseUrl

    constructor(axios, baseUrl) {
        this.axios = axios
        this.baseUrl = `${baseUrl}pagos`
    }

    getAll() {
        let self = this;
        return self.axios.get(`${self.baseUrl}`);
    }

    get(id) {
        let self = this;
        return self.axios.get(`${self.baseUrl}/${id}`);
    }

    getPagosParciales(id) {
        let self = this;
        return self.axios.get(`${self.baseUrl}/${id}/pagos_parciales`);
    }

    getByFechas(inicio, fin) {
        let self = this
        return self.axios.get(`${self.baseUrl}_reporte/${inicio}/${fin}`)
    }

    create(data) {
        let self = this;
        return self.axios.post(`${self.baseUrl}`, data);
    }

    update(data) {
        let self = this;
        return self.axios.put(`${self.baseUrl}/${data.id}`, data);
    }

    destroy(data) {
        let self = this;
        return self.axios.delete(`${self.baseUrl}/${data.id}`);
    }

    //peticion a funcion create
    comprobante(id) {
        let self = this
        return self.axios.get(`${self.baseUrl}_comprobante/${id}`, { responseType: 'blob' });
    }

    //comprobante abono
    comprobanteAbono(id) {
        let self = this
        return self.axios.get(`${self.baseUrl}_parciales_comprobante/${id}`, { responseType: 'blob' });
    }
}

export default PagoService