import { Injectable } from '@angular/core';
import { Observable } from "rxjs";
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
import { ApiRequestService } from "src/app/services/api/api-request.service";
import { environment } from 'src/environments/environment';
@Injectable({
  providedIn: 'root'
})
export class Ad6service{
  private baseURL = "Ad6/Ad6" ;  constructor(
    private http: HttpClient,
    private apiRequest: ApiRequestService,
  ) { }
  getAll(page?: number, size?: number): Observable<any> {
    return this.apiRequest.get(this.baseURL);
  }
  getById(id: number): Observable<any> {
    const _http = this.baseURL + "/" + id;
    return this.apiRequest.get(_http);
  }
  create(data: any): Observable<any> {
    return this.apiRequest.post(this.baseURL, data);
  }
  update(id: number, data: any): Observable<any> {
    const _http = this.baseURL + "/" + id;
    return this.apiRequest.put(_http, data);
  }
  delete(id: number): Observable<any> {
    const _http = this.baseURL + "/" + id;
    return this.apiRequest.delete(_http);
  }




// payment code start
  paytmPay(data: any): Observable<any> {
   const url = `payment/start`;    return this.apiRequest.post(url, data);
 }  
razorPay(orderData: any): Observable<any> {
   const url = `payment/razorpay/create-order`;
   return this.apiRequest.post(url, orderData);  }  // payment code end

getAllcountry(): Observable<any> {   
return this.apiRequest.get("Country_ListFilter1/Country_ListFilter1");  }



  getstateDependent(field: string): Observable<any> {
    return this.apiRequest.get("State_ListFilter1/State_ListFilter11/" + field);
  }





  getdistrictDependent(field: string): Observable<any> {
    return this.apiRequest.get("District_ListFilter1/District_ListFilter11/" + field);
  }



// updateaction
}