export type Paged<T> = {
  items: T[]
  total: number
  page: number
  pageSize: number
  totalPages: number
  hasNext: boolean
  hasPrev: boolean
}

export const SupplierType = {
  NhaCungCap: 1,
  NhaThauPhu: 2,
  ToDoi: 3,
  DonViDichVu: 4,
  ChuDauTu: 5,
} as const

export type SupplierType = typeof SupplierType[keyof typeof SupplierType]

export const SupplierTypeLabel: Record<SupplierType, string> = {
  1: 'Nhà cung cấp',
  2: 'Nhà thầu phụ',
  3: 'Tổ đội',
  4: 'Đơn vị dịch vụ',
  5: 'Chủ đầu tư',
}

export type Supplier = {
  id: string
  code: string
  name: string
  type: SupplierType
  taxCode: string | null
  phone: string | null
  email: string | null
  address: string | null
  contactPerson: string | null
  note: string | null
  createdAt: string
  updatedAt: string | null
}

export type SupplierInput = Omit<Supplier, 'id' | 'createdAt' | 'updatedAt'>

export type Project = {
  id: string
  code: string
  name: string
  startDate: string | null
  endDate: string | null
  managerUserId: string | null
  budgetTotal: number | null
  note: string | null
  createdAt: string
  updatedAt: string | null
}

export type ProjectInput = Omit<Project, 'id' | 'createdAt' | 'updatedAt'>

export type Department = {
  id: string
  code: string
  name: string
  managerUserId: string | null
  note: string | null
  createdAt: string
  updatedAt: string | null
}

export type DepartmentInput = Omit<Department, 'id' | 'createdAt' | 'updatedAt'>
