// frontend/src/api/achats.ts import client from './client' export interface AchatIntrant { id?: number categorie: string // terreau | engrais | traitement | autre nom: string marque?: string boutique_nom?: string boutique_url?: string prix?: number poids?: string date_achat?: string dluo?: string notes?: string jardin_id?: number plantation_id?: number tache_id?: number } export const achatsApi = { list: (params?: { categorie?: string; jardin_id?: number }) => client.get('/api/achats', { params }).then(r => r.data), get: (id: number) => client.get(`/api/achats/${id}`).then(r => r.data), create: (a: Partial) => client.post('/api/achats', a).then(r => r.data), update: (id: number, a: Partial) => client.put(`/api/achats/${id}`, a).then(r => r.data), delete: (id: number) => client.delete(`/api/achats/${id}`), }