import { apiFetch } from "@/lib/auth/api-client"; import { BottlingBatch, BottlingBatchFilter, CreateBottlingBatchInput } from "./types"; export function fetchBottlingBatches( filter: BottlingBatchFilter = {}, ): Promise { const params = new URLSearchParams(); if (filter.honeyBatchId) params.set("honeyBatchId", filter.honeyBatchId); const query = params.toString(); return apiFetch(`/bottling-batches${query ? `?${query}` : ""}`); } export function fetchBottlingBatch(id: string): Promise { return apiFetch(`/bottling-batches/${id}`); } export function createBottlingBatch( input: CreateBottlingBatchInput, ): Promise { return apiFetch("/bottling-batches", { method: "POST", body: JSON.stringify(input), }); }