import { type Base, genBase } from "./_base"
import { type Employee, genEmployee } from "./employee"
import type { Specialist } from "./specialist"
import type { Subspecialist } from "./subspecialist"

export interface Doctor extends Base {
  employee_id: number
  employee: Employee
  ihs_number: string
  sip_number: string
  unit_id?: number
  specialist_id?: number
  specialist?: Specialist
  subspecialist_id?: number
  subspecialist?: Subspecialist
  bpjs_code?: string
}

// use one dto for both create and update
export interface CreateDto {
  employee_id: number
  ihs_number: string
  sip_number: string
  unit_id?: number
  specialist_id?: number
  subspecialist_id?: number
  bpjs_code: string
}

export interface GetListDto {
  name?: string
  identity_number?: string
  sip_no?: string
  ihs_number?: string
}

export interface GetDetailDto {
  id?: string
}

export interface UpdateDto extends CreateDto {
  id?: number
}

export interface DeleteDto {
  id?: string
}

export function genDoctor(): Doctor {
  return {
    ...genBase(),
    employee_id: 0,
    employee: genEmployee(),
    ihs_number: '',
    sip_number: '',
  }
}
