# Versioned upgrade packages

Every change that affects a live install (code and/or database) is released as a numbered package:

```
dist/vX.YYY.ZZZ/
  update_vX.YYY.ZZZ.sql              ← import in phpMyAdmin
  venue-events-manager-vX.YYY.ZZZ.zip ← upload/extract into public_html
  UPGRADE.txt                        ← short instructions
```

## Version scheme

`v1.000.002` style:

| Part | Meaning |
|------|---------|
| `1` | Major product version |
| `000` | Feature / schema batch |
| `002` | Patch / hotfix |

Bump the last segment for fixes. Bump the middle segment for new features / schema changes.

## Build a release (developers)

1. Put SQL changes (if any) in:
   `database/updates/update_vX.YYY.ZZZ.sql`  
   Always update `settings.app_version` and `settings.schema_version`.
2. Ensure code fixes are in the project root (`conference`).
3. Run:

```bash
php scripts/build_version_update.php X.YYY.ZZZ
```

Example:

```bash
php scripts/build_version_update.php 1.000.002
```

## Apply on hosting / XAMPP

1. Import `update_vX.YYY.ZZZ.sql` into the site database.
2. Upload the ZIP into `public_html` and extract/overwrite.
3. **Do not overwrite** `.env` or uploaded files under `storage/app/attachments`.
4. Clear caches if needed (`php artisan route:clear` when CLI is available).

## Release history

| Version | Type | Notes |
|---------|------|--------|
| v1.000.001 | Feature | Package types, wired views, calendar, invoice-based reservations |
| v1.000.002 | Patch | Fixed missing `QuotationController` import (Quotations 500 error) |
| v1.000.003 | UX | Quote/Invoice: colored available/unavailable dates on Event Start/End; Available packages vs Custom; live Price Total |
| v1.000.004 | Feature | Daily quote/invoice numbers; conversion prefixes; Download PDF with current data |
| v1.000.005 | UX | Invoice show: Edit, status dropdown, attachments refresh, record/edit payments on page; `database/demo_data.sql` |
| v1.000.006 | UX | Invoice attachments under Line Items; payment-driven status (partial/paid → Refunded only; no payments → Issued/Overdue/Void) |
| v1.000.007 | Feature | Create Invoice replaces Create Booking; multi-space + color calendars on quote/invoice; confirm booking on first payment |
