import { type Base, genBase } from "./_base"
import { type Person, genPerson } from "./person"

export interface Employee extends Base {
  user_id: number
  person_id: number
  person: Person
  position_code: string
  division_code?: string
  number?: string
  status_code: string
}

export interface CreateDto extends Employee {
  user_id: number
  person_id: number
  position_code: string
  division_code: string
  number: string
  status_code: string
}

export interface GetListDto {
  position_code?: string
  division_code?: string
  number?: string
}

export interface UpdateDto extends Employee {
  id: number
}

export interface DeleteDto {
  id: number
}

export function genEmployee(): Employee {
  return {
    ...genBase(),
    user_id: 0,
    person_id: 0,
    person: genPerson(),
    position_code: '',
    status_code: '',
  }
}
