import { Injectable } from '@angular/core';
import {BaseService} from '../../base/base-service';
import {HttpClient} from '@angular/common/http';
import {environment} from "../../../../environments/environment";
import {Observable} from "rxjs";

@Injectable({
    providedIn: 'root'
})
export class TestingRecieptService extends BaseService {

    constructor(
        public http: HttpClient
    ) {
        super('/v1/register/testing_receipts', http);

    }

    Paid(id){
        console.log(id);
        const body = { testing_register_uid: id };
        console.log(body);
        // @ts-ignore
        return this.http.put(`${environment.storeApi}/api/v1/enrollment/paid/${id}`);
    }

    getByPaymentCode<T>(paymentcode): Observable<T>{
        return this.http.get<T>(`${environment.adminApi}/api/v1/register/testing_receipts_paymant${paymentcode}`);

    }

}
