# Demo data

PowerAMS keeps demonstration records separate from the normal reference-data seeders. Running `php cli seed` does not create operational demo records.

## Browser administration

For installations without terminal access, sign in as an Airline Administrator and open **System administration → Demo data**. The page displays the exact record counts before submission. To continue, the administrator must:

1. complete and verify a database backup;
2. type the current airline code exactly;
3. select the backup and demonstration-data acknowledgement; and
4. submit the CSRF-protected form.

The action is checked again by server-side permission enforcement and can run only once for each airline.

## Contents

The demo seeder adds the following records to one selected airline:

- two airline bases;
- four airports;
- two aircraft types and three aircraft;
- five routes;
- eight flights around the current UTC date, including completed, delayed, confirmed, scheduled, and draft examples;
- payload, assignment, status, location, actual-time, and delay history where applicable;
- one vendor, four approved expenses, and four posted revenue entries.

The records are labelled as demonstrations and do not include passenger reservations, live aircraft tracking, real documents, or additional login accounts.

## Before running in production

1. Back up the database and verify the backup.
2. Find the target airline ID or airline code in Administration → Airline profile.
3. Open a terminal in the project directory.
4. Preview the available command with `php cli help`.

For a non-production environment containing exactly one airline, run:

```bash
php cli demo:seed
```

For a specific non-production airline, run:

```bash
php cli demo:seed --airline=CODE
```

Production requires an additional explicit acknowledgement:

```bash
php cli demo:seed --airline=CODE --confirm-production
```

Replace `CODE` with the installed airline code or use its numeric ID. The command is transactional: an error rolls back the entire demo insert. It also records `demo.seeded` in the audit log and refuses to seed the same airline twice.

Demo data should not be loaded into an airline database that will hold real operational or financial records. Use a dedicated demonstration airline or a separate demonstration installation whenever possible.
