import { Injectable } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { Timestamp } from "../../interfaces/timestamp";
import { ApiService } from "../../services/api.service";
import { HelpersService } from "../../services/helpers.service";
import { Schedule, Segmens, StatusReport } from "../../interfaces/master";
import { User } from "../manage/user.service";
import { AuthService } from "../../services/auth.service";
import { Router } from "@angular/router";

export interface Surveyor extends Timestamp {
  id: string;
  user_id: string;
  status_id: string;
  note: string;
  no_ticket: string;
  survey_status: boolean;
  survey_end_date: string;
  survey_start_date: string;
  status_report: StatusReport;
  user: User;
  schedule: Schedule;
  segmens: Segmens[];
}

@Injectable({
  providedIn: "root",
})
export class SurveyorService extends ApiService<Surveyor> {
  constructor(
    public override http: HttpClient,
    public override helpers: HelpersService,
    private router: Router,
    private auth: AuthService
  ) {
    super(http, helpers);
    this.endpoint = `report-list/surveyor/${auth.getLoggedUser().id}`;
  }
}
