import { UsersType } from "@/constants";

export interface Language {
  id: number;
  title: string;
  slug: string; // fa, en, ...
}

export interface Expertise {
  translations: {
    id: number;
    displayName: string | null;
    lang_id: number | null;
    lang: {
      id: number;
      slug: string;
      title: string;
    };
    expertiseId: number;
  }[];
  slug: string;
  id: number;
}

export interface getSingleUserDataType {
  id: number;
  slug: string;
  type: UsersType;
  phone: string;
  email: string;
  medicalNumber: string;
  expertiseId: number | null;
  imageId: number | null;
  expertise: {
    id: number;
    slug: string;
    translations: {
      lang_id: number;
      displayName: string | null;
      lang: {
        id: number;
        slug: string;
        title: string;
      } | null;
    }[];
  } | null;
  image: {
    filename: string | null;
    fileUrl: string | null;
    fileKey: string | null;
  } | null;
  translations: {
    id: number;
    lang_id: number;
    lang: {
      id: number;
      slug: string;
      title: string;
    } | null;
    firstName: string;
    lastName: string;
    position: string;
    bio: string;
    excerpt: string;
  }[];
}

export interface getSinglePatientDataType {
  id: string;
  pid: string;
  firstName: string;
  lastName: string;
  birthDate: Date | null;
  sex: Sex | null;
  nationalityId: number | null;
  nationalityCode: string | null;
  passportCode: string | null;
  phone: string | null;
  email: string | null;
  preferredLanguage: string | null;
  address: string | null;
  postalCode: string | null;
  createdAt: Date;
  updatedAt: Date;
  deletedAt: Date | null;
}
export interface jwt_token_payload {
  id: string;
  role: string;
  exp: number;
  iat?: number;
}
export interface ServerResponseObject {
  status: number;
  data: unknown;
  message?: string;
}

export interface ServerErrorsObject {
  status: number;
  data?: unknown;
  error: {
    message: string;
    description?: string;
  };
}

export type Sex = "male" | "female" | "other";

export type ServerResponse = ServerResponseObject & ServerErrorsObject;
export type DocumentType =
  | "MEDICAL_IMAGE"
  | "LAB_RESULT"
  | "PRESCRIPTION"
  | "PASSPORT"
  | "NATIONAL_ID"
  | "OTHER"
  | "OTHER_FILE";

export interface CreateUserTranslation {
  lang_id: number;
  firstName: string;
  lastName: string;
  bio?: string;
  excerpt?: string;
  expertise?: string | null;
  position?: string | null;
}
