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

export interface DetailPerbaikan extends Timestamp {
  id: string;
  report_id: string;
  date_start: Date;
  date_end: Date;
  status: string;
  note: string;
  report: {
    id: string;
    user_id: string;
    status_id: string;
    note: string;
    no_ticket: string;
    status_report: StatusReport;
    user: User;
    segmens: Segmens[];
  };
}

@Injectable({
  providedIn: "root",
})
export class DetailPerbaikanService extends ApiService<DetailPerbaikan> {
  constructor(
    public override http: HttpClient,
    public override helpers: HelpersService
  ) {
    super(http, helpers);
    this.endpoint = "report-schedules/detail";
  }
}
