// import { serverFetchJson } from "@/app/utils/fetchUtil";
// import { BASE_API_URL } from "@/config/api";
import { serverFetchJson } from "../../utils/fetchUtil";
import { BASE_API_URL } from "../../../config/api";
import { cache } from "react";

export interface DoResult {
  id: number;
  code: string;
  orderDate: string;
  estimatedArrivalDate: string;
  status: string;
  shopName: string;
}

export interface DoDetailLine {
  id: number;
  itemNo: string;
  qty: number;
  price: number;
  status: string;
  itemName?: string;
  uomCode?: string;
}




export const preloadDo = () => {
  fetchDoList();
};

export const fetchDoList = cache(async () => {
  return serverFetchJson<DoResult[]>(`${BASE_API_URL}/do/list`, {
    next: { tags: ["doList"] },
  });
});


