<?php
// api/endpoints/siswa_delete.php
// Hapus siswa — pembayaran & tagihan terhapus otomatis via ON DELETE CASCADE

if (empty($body['id'])) respond(['status'=>'error','message'=>'id wajib diisi'], 400);

$del = $pdo->prepare("DELETE FROM siswa WHERE id=?");
$del->execute([(int)$body['id']]);

if ($del->rowCount() === 0) respond(['status'=>'error','message'=>'Siswa tidak ditemukan'], 404);

respond(['status' => 'success', 'deleted' => true]);