import { Injectable, Inject } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';

import { Observable } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators';
import { RouletteCoupon } from '../model/roulette-coupon.model';
import { API_BASE_URL } from 'src/modules/common/type/injection-token.type';
import { FormArray } from '@angular/forms';

@Injectable({
  providedIn: 'root'
})
export class RouletteCouponService {
  constructor(
    @Inject(API_BASE_URL) private apiBaseUrl: string,
    private httpClient: HttpClient
  ) {}

  public getAll(): Observable<RouletteCoupon[]> {
    return this.httpClient.get<RouletteCoupon[]>(
      `${this.apiBaseUrl}/roulette_coupon`,
      {}
    );
  }
}
