import { useApi } from '~/composables/useApi' import type { WeightEntryData } from '~/services/dto/reception-data' export type WeightPayload = { reception?: string shipment?: string type: 'gross' | 'tare' dsd: number | null weight: number | null weighedAt: string | null } export async function createWeight(payload: WeightPayload | Record) { const api = useApi() return api.post('weights', payload) } export async function updateWeight(id: number, payload: Partial) { const api = useApi() return api.patch(`weights/${id}`, payload, { toastErrorKey: 'errors.weight.update', toastSuccessKey: 'success.weight.update' }) }