requireRole($this->security, 'ROLE_GESTIONNAIRE'); $piece = $this->pieces->find($pieceId); if (!$piece) { $this->mcpError('not_found', "Piece not found: {$pieceId}"); } $this->em->remove($piece); $this->em->flush(); return $this->jsonResponse(['deleted' => true, 'id' => $pieceId]); } }