# AeroFind v1.0.1 — Release Notes
**Release Date:** April 23, 2026  
**Type:** Maintenance + Feature Update  
**Status:** ✅ Production Stable — Recommended for all deployments

---

## 🚀 What's New in v1.0.1

This release focuses on strengthening data integrity for the Proof of Delivery (PoD) lifecycle and enhancing automated stakeholder communication.

### 🛠️ Critical Bug Fixes

**1. Proof of Delivery (PoD) Photo Persistence**  
Resolved a critical issue where PoD photos were lost during report regeneration (e.g., when clicking "Dispatch"). The `dbRebuildReportHTML` engine was hardened with a robust, container-based scraper that reliably preserves document evidence across multiple status transitions.

**2. Image Compatibility Standardization**  
Migrated all system-generated image storage from WebP to **JPEG**. This ensures 100% rendering compatibility with the **Dompdf** engine (fixing missing images in official PDFs) and legacy mobile browsers used by couriers.

**3. Robust Directory Management**  
Added automated recursive directory creation for `uploads/reports` and `uploads/pod` with secured `.htaccess` protection. This prevents "File not found" errors on new installations where these directories might not have been manually created.

---

## ✨ New Features

### 📧 Automated Delivery Notifications
The platform now features a multi-tier notification system for successful deliveries:
- **Passenger Notification**: Automated email sent upon delivery with recipient name, timestamp, and a direct link to the handover photo.
- **Staff Notification**: Automated alert to the baggage office confirming that the BDO assignment has been fulfilled.

### ⚙️ Enhanced Admin Controls
Administrators can now independently toggle delivery notifications via the **Admin Panel > Email Notifications Control**:
- `Delivery Confirmation (Passenger)`
- `Delivery Confirmation (Staff)`

### 📄 Rich PIR Reports
The generated HTML and PDF reports now include a dedicated **"Delivery Confirmation"** section at the bottom once a shipment is delivered. This section displays:
- Final delivery timestamp
- Recipient identity
- Driver's name and notes
- **Embedded Handover Photo** (Evidence of Delivery)

---

## 📦 Technical Changes

| Module | Change |
|--------|--------|
| `api.php` | Integrated PoD email triggers and JPEG conversion logic. |
| `db.php` | Updated `_buildPirHtml` signature to support PoD data embedding. |
| `admin.php` | Added new email notification persistence and UI toggles. |
| `dompdf` | Improved reliability by feeding standard JPEG assets. |

---

## 📋 Upgrade Instructions

### Upgrade from v1.0.0
1. Overwrite `api.php`, `admin.php`, `db.php`, and `staffportal.php`.
2. Existing PoD photos in WebP format will continue to work in the browser, but new photos will be stored as JPEG for PDF compatibility.
3. No manual database migrations are required; settings will initialize on the first admin visit.

---

*AeroFind v1.0.1 — Built for the ground. Designed for the passenger.*
