import type { UploadedFile } from "craftable-pro/types";
import { CraftableProUser } from "craftable-pro/types/models";
import { Company } from "../Company/types";

export type Project = {
  ident: number;
  customer_id: string;
  slug: string;
  jtsk_x: number;
  jtsk_y: number;
  wgs84_x: number;
  wgs84_y: number;
  area_border: string;
  building_border: string;
  adress_data: string;
  area: string;
  volume: string;
  point_clouds: string;
  point_clouds_trans: string;
  ortho_layer_name: string;
  calculation_settings: string;
  roof_params: string;
  step: number;
  building_ids: string;
  outlines_source: number;
  error: boolean;
  message: string;
  status: string;
  status_extended: string;
  batch_id: string;
  created_at: string;
  updated_at: string;
  deleted_at: string;
  media?: UploadedFile[];
  all_point_clouds: PointCloud[];
  input_points: InputPoint[];
  input_lines: InputLine[];
  roof_parts: RoofPart[];
  base_objects: BaseObject[];
  elevation_levels: ElevationLevel[];
  walls: Wall[];
  terrains: Terrain[];
  created_by?: number;
  locked_by?: number;
  created_by_user?: CraftableProUser;
  locked_by_user?: CraftableProUser;
  auto_drawing: number;
  company_id: string;
  company: Company;
  roof_overhangs: string;
};

export type ProjectForm = {
  customer_id: string;
  company_id: string;
};

export type ProjectStep1Form = {
  status_extended: string;
  jtsk_x: number;
  jtsk_y: number;
  wgs84_x: number;
  wgs84_y: number;
  area_border: string;
  building_border: string;
  adress_data: string;
  building_ids: string;
  outlines_source: number;
};

export type ProjectStep2Form = {
  status_extended: string;
  point_clouds: string;
  point_cloud_projects: number[];
};

export type ProjectStep3Form = {
  status_extended: string;
  input_points: any[];
  input_lines: any[];
  base_objects: any[];
  ortho_layer_name: string;
  auto_drawing: number;
};

export type ProjectStep4Form = {
  status_extended: string;
  roof_parts: any[];
  walls: any[];
  base_objects: any[];
  elevation_levels: any[];
  calculation_settings: string;
  point_clouds_trans: string;
  auto_drawing: boolean;
};

export type ProjectStep5Form = {
  status_extended: string;
  roof_parts: any[];
  walls: any[];
  base_objects: any[];
  terrains: any[];
  point_clouds_trans: string;
  area: string;
  volume: string;
  roof_params: string;
};

export type ProjectStep6Form = {
  status_extended: string;
  images: any[];
};

export type ProjectStep7Form = {
  roof_parts: any[];
  walls: any[];
  base_objects: any[];
  terrains: any[];
  area: string;
  volume: string;
  roof_params: string;
};

export type PointCloud = {
  x: number,
  y: number,
  z: number,
  date: Date,
}

export type InputPoint = {
  ident: number;
  id: number,
  uuid: string;
  x: number;
  y: number;
  type: string;
  linked_points: string;
  object_id: number;
  project_id: number;
}

export type InputLine = {
  ident: number;
  id: number,
  uuid: string;
  point_id_1: number;
  point_id_2: number;
  type: string;
  linked_points: string;
  project_id: number;
}

export type RoofPart = {
  ident: number;
  id: number,
  uuid: string;
  border: string;
  eaves_index: string;
  ridges_index: string;
  edit_pitch: number;
  parent_id: number;
  object_ids: string;
  covered_areas: string;
  threshold_level: number;
  projection_line: string;
  length_projection_line: number;
  edited: number;
  eaves_hight: number;
  recalculate_eaves_hight: number;
  edited_eaves_hight: number;
  pitch: number;
  recalculate_pitch: number;
  edited_pitch: number;
  rmse: number;
  roof_type: string;
  project_id: number;
}

export type BaseObject = {
  ident: number;
  id: number,
  uuid: string;
  type: string;
  roof_ids: string;
  wall_ids: string;
  border: string;
  project_id: number;
}

export type ElevationLevel = {
  ident: number;
  uuid: string;
  object_id: number;
  points: string;
  type: string;
  project_id: number;
}

export type Wall = {
  ident: number;
  id: number,
  uuid: string;
  base_points: string;
  upper_points: string;
  roof_ids: string;
  edited: number;
  edited_base_points: string;
  edited_upper_points: string;
  project_id: number;
}

export type Terrain = {
  ident: number;
  uuid: string;
  polygon: string;
  edited: number;
  edited_polygon: string;
  project_id: number;
}
