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

export interface Item extends Base {
  name: string
  code: string
  itemGroup_code: string
  uom_code: string
  infra_id: number
  stock: number
}

export interface CreateDto {
  name: string
  code: string
  itemGroup_code: string
  uom_code: string
  infra_id: number
  stock: number
}

export interface GetListDto {
  page: number
  size: number
  name?: string
  code?: string
}

export interface GetDetailDto {
  id: number
}

export interface UpdateDto extends CreateDto {
  id: number
}

export interface DeleteDto {
  id: string
}

export function genItem(): Item {
  return {
    ...genBase(),
    name: '',
    code: '',
    itemGroup_code: '',
    uom_code: '',
    infra_id: 1,
    stock: 1,
  }
}
