import { Project } from "next/dist/build/swc/types";

export interface PublicProfileResponse {
  success: boolean;
  data: PublicProfileData;
  message: string;
}

export interface PublicProfileData {
  name: string;
  username: string;
  current_role_duration: string;
  hourly_charged: string;
  monthly_expected: string;

  profession: PublicProfession | null;

  image: string | null;
  thumbnail: string | null;
  about_me: string | null;
  years_of_experience: string | null;

  higher_education: PublicHigherEducation | null;
  experiences: PublicExperience[];
  educations: PublicEducation[];

  skills: PublicSkills;

  expertises: PublicExpertise[];
  hobbies: PublicHobby[];

  awards: PublicAward[];
  certificates: PublicCertificate[];

  links: PublicProfileLink[];

  personal_values: PublicPersonalValue[];
  professional_values: PublicPersonalValue[];

  languages: PublicLanguage[];

  projects: Projects[];

  // Optional personal/contact details returned from API
  gender?: string | null;
  location?: string | null;
  religion?: string | null;
  marital_status?: string | null;
  dob?: string | null;
  height?: string | null;
  blood_group?: string | null;
  national_id?: string | null;
  passport_id?: string | null;
  birth_certificate_id?: string | null;
  father_name?: string | null;
  mother_name?: string | null;
  country?: string | null;
  city?: string | null;
  postal_code?: string | null;
  emergency_contact?: string | null;
  emergency_contact_name?: string | null;
  emergency_relation?: string | null;
  phone?: string | null;
  secondary_phone?: string | null;
  email?: string | null;
  declaration: string | null;
}

/* ---------------- Higher Education ---------------- */

export interface PublicHigherEducation {
  degree_name: string | null;
  institute_name: string | null;
  major: string | null;
  passing_year: string | null;
}

/* ---------------- Profession ---------------- */

export interface PublicProfession {
  uuid: string;
  name: string;
  description: string | null;
  is_active: boolean;
  created_at: string;
  last_update_time: string;
}

/* ---------------- Experience ---------------- */

export interface PublicExperience {
  id: number;
  uuid: string;

  user_id: number;
  profile_id: number;

  job_title: string;
  company_name: string;
  employment_type: string;

  start_date: string;
  end_date: string | null;

  is_current: boolean;

  responsibilities: string | null;
  company_website: string | null;

  created_at: string;
  updated_at: string;
}

/* ---------------- Education ---------------- */

export interface PublicEducation {
  id: number;
  uuid: string;

  profile_id: number;

  degree_name: string;
  institute_name: string;

  major: string | null;
  result: string | null;

  passing_year: string | null;

  city: string | null;
  country: string | null;

  is_ongoing: boolean;

  start_date: string | null;
  end_date: string | null;

  created_at: string;
  updated_at: string;
}

/* ---------------- Skills ---------------- */

export interface PublicSkills {
  soft: Skill[];
  tool: Skill[];
}

export interface Skill {
  id: number;
  uuid: string;
  name: string;
  type: string;
  is_active: boolean;
}

/* ---------------- Expertise ---------------- */

export interface PublicExpertise {
  id: number;
  uuid: string;
  name: string;
  description: string | null;
  is_active: boolean;
}

/* ---------------- Hobby ---------------- */

export interface PublicHobby {
  id: number;
  uuid: string;
  name: string;
  is_active: boolean;
}

/* ---------------- Awards ---------------- */

export interface PublicAward {
  uuid: string;
  award_name: string;
  organization: string;
  year: string;
  award_file: string | null;
  award_url: string | null;
}

/* ---------------- Certificates ---------------- */

export interface PublicCertificate {
  id: number;
  uuid: string;

  certificate_name: string;
  organization: string;

  issue_year: string | null;
  start_year: string | null;

  credential_url: string | null;
  certificate_file: string | null;
  

  created_at: string;
  updated_at: string;
}

/* ---------------- Links ---------------- */

export interface PublicProfileLink {
  id: number;
  uuid: string;

  platform: string;
  url: string;

  is_portfolio: boolean;
}

/* ---------------- Values ---------------- */

export interface PublicPersonalValue {
  uuid: string;
  name: string;
  is_active: boolean;

  created_at: string;
  last_update_time: string;
}

/* ---------------- Languages ---------------- */

export interface PublicLanguage {
  uuid: string;
  language_name: string;
  language_uuid: string;

  // API gives string like "1", "4"
  proficiency: string;
}


export interface Projects {
  uuid: string;
  project_name: string;
  responsibilities: string | null;
  task_name: string | null;

  task_url: string | null;
}
