import { Injectable } from "@angular/core";
import { Timestamp } from "../../interfaces/timestamp";
import { ApiService } from "../../services/api.service";
import { HttpClient } from "@angular/common/http";
import { HelpersService } from "../../services/helpers.service";

export interface Maintenance extends Timestamp {
  id: string;
  report_schedule_id: string;
  segmen_id: string;
  date: Date;
  maintenance_by: string;
  note: string;
  photo_after: [
    {
      filename: string;
      abs_path: string;
      file_dump_id: string;
    }
  ];
}

@Injectable({
  providedIn: "root",
})
export class MaintenanceService extends ApiService<Maintenance> {
  constructor(
    public override http: HttpClient,
    public override helpers: HelpersService
  ) {
    super(http, helpers);
    this.endpoint = "maintenanced";
  }
}
