import { Project } from "next/dist/build/swc/types";
import { ReferenceResponseType, SkillsResponseData } from "./profileType";
import {
  ProjectBody,
  ProjectType,
} from "@/app/(dashboard)/digital-profile/types/project.types";

type Height = {
  cm: number;
  feet: string;
};

type PersonalDetails = {
  full_name: string;
  profession_designation: string;
  gender: string;
  date_of_birth: string;
  height: Height;
  blood_group: string;
  marital_status: string;
  religion: string;
  mobile_number: string;
  secondary_mobile_number: string;
  email: string;
  passport_id: string;
  national_id: string;
  birth_certificate_id: string;
};

type EmergencyContact = {
  phone: string;
  relation: string;
};

type ContactInformation = {
  father_name: string;
  mother_name: string;
  country: string;
  city: string;
  postal_code: string;
  present_address: string;
  permanent_address: string;
  emergency_contact: EmergencyContact;
};

type ProfileData = {
  personal_details: PersonalDetails;
  contact_information: ContactInformation;
  siblings: any[];
};

export type ProfileDataType = Partial<{
  id: number;
  uuid: string;
  profession_uuid: string;
  user: {
    name: string;
    email: string;
    phone: string;
    secondary_mobile?: string;
    public_token: string;
    username: string;
    status: string;
  };

  profession_id: number;
  profession: {
    id: number;
    uuid: string;
    category_id: number;
    name: string;
    description: string | null;
    is_active: boolean;
    created_at: string;
    updated_at: string;
  };
  project: ProjectType[];

  image: string | File | "N/A";
  thumbnail: string | null;
  full_name: string | "N/A";

  gender: string | null;
  years_of_experience: string | "N/A";

  phone: string | "N/A";
  secondary_phone: string | "N/A";

  country: string | "N/A";
  city: string | "N/A";
  email: string | "N/A";
  postal_code: string | "N/A";

  present_address: string | "N/A";
  permanent_address: string | "N/A";

  emergency_contact: string | "N/A";
  emergency_contact_name: string | "N/A";
  emergency_relation: string | "N/A";

  dob: string | "N/A";
  height: string | "N/A";
  blood_group: string | null;
  marital_status: string | null;
  religion: string | "N/A";

  passport_id: string | "N/A";
  national_id: string | "N/A";
  birth_certificate_id: string | "N/A";

  father_name: string | "N/A";
  mother_name: string | "N/A";

  declaration: string | "N/A";
  about_me: string | "N/A";
  expertise_uuids: number[] | string[];

  expertises: {
    id: number;
    uuid: string;
    name: string;
    description: string;
    is_active: boolean;
    created_at: string;
    updated_at: string;
    pivot: {
      profile_id: number;
      expertise_id: number;
    };
  }[];

  skills: SkillsResponseData;
  educations: any[];
  certificates: any[];
  awards: any[];
  experiences: any[];
  references: ReferenceResponseType[];
  links: ProfileLink[];
  personal_values: any[];
  hobbies: any[];
  projects?: any[];
  signature?: string | null;

  created_at: string;
  updated_at: string;
}>;

export type bloodGroupType = {
  id: number;
  label: string;
};
export type maritalStatusType = {
  id: number;
  label: string;
};
export type genderType = {
  id: number;
  label: string;
  value: string;
};

export interface SocialMediaPlatform {
  uuid: string;
  name: string;
  domain: string;
  icon: string | null;
  deleted_at: string | null;
  deleted_by: string | null;
}

export interface ProfileLink {
  uuid: string;
  social_media_platform: SocialMediaPlatform;
  platform: string;
  url: string;
  is_portfolio: boolean;
  created_at: string;
  last_update_time: string;
  deleted_at: string | null;
  deleted_by: string | null;
}

export interface UserDetailsTypeForInitialData {
  personal_details?: PersonalDetailsForDisplay;
  contact_information?: ContactInformationTypeForDisplay;
  siblings?: Sibling[];
  reference?: ReferenceResponseType[];
  user?: {
    name: string;
    email: string;
    mobile: string;
    secondary_mobile: string;
  };
}
export interface PersonalDetailsForDisplay {
  full_name: string;
  profession_designation: string;
  gender: string;
  date_of_birth: string; // ISO date (yyyy-mm-dd)

  height: string;

  blood_group: string;
  marital_status: string;
  religion: string;

  mobile_number: string;
  secondary_mobile_number: string;

  email: string;

  passport_id: string;
  national_id: string;
  birth_certificate_id: string;

  experience: string;

  address: string;

  isVerify: boolean;
}
export interface ContactInformationTypeForDisplay {
  father_name: string;
  mother_name: string;

  country: string;
  city: string;
  postal_code: string;

  present_address: string;
  permanent_address: string;

  emergency_contact: {
    phone: string;
    relation: string;
  };
}
export interface Sibling {
  // define later if needed
  [key: string]: any;
}
