# Project plan — Kyalami9Hour2019

Evidence date: 2026-10-10. Source: `git@bitbucket.org:overdrive/kyalami9hour2019.git`.

Inspected tip: `master` at `5b60e52` (2020-10-28, "Merge branch 'prod'"). There is no project plan, README, or PRD in the repository or in Silicon Ark. Statements below are recovered from code, config, and Git history.

`qa` (`e0f870a`, 2020-12-04) and `prod` (`0950599`, 2020-12-04) are ahead of `master`. Product differences are listed under Branch reality. This document describes `master` unless a sentence names another branch.

## Product

A public accreditation portal titled **Kyalami 9 Hour 2020 - Accreditation Portal**. A visitor opens the site, completes a stepped application for one hard-coded event code, and receives a reference number. They can return, sign in with email and that reference, and see whether the application is new, pending, in review, confirmed, declined, or approved. While it is still editable they can change details and replace the headshot.

The home page and the sign-in page always load accreditation code `5F9298188128B`. A direct request to `/application/apply/code/{code}` loads whichever code is in the URL, if that code exists.

Deploy scripts place the site at `/mnt/data/www/html/magus.events/kyalami9hour2019.magus.events/`. **Unknown / Requires Confirmation:** whether the public hostname is `kyalami9hour2019.magus.events`.

## Lineage

The repository was first committed on 2019-12-13 (`c73fbf2`, "initial commit of full repository") together with a Bitbucket Pipelines and AWS CodeDeploy setup the same day. Visible copy originally said "Kyalami 9 Hour". On 2020-10-27 commit `afcd3f3` ("Update to event ID 245") renamed the visible title to "Kyalami 9 Hour 2020" and replaced hard-coded code `5D9466852AE6B` with `5F9298188128B`.

The numeric value 245 does not appear in that diff. **Unknown / Requires Confirmation:** whether 245 is `Accreditation_List.AC` for code `5F9298188128B`.

The `supplier` module is a company, user, and permit area whose mail copy refers to SA Rugby (`accreditation@sarugby.co.za`) and whose commented navigation points at `http://supplier.sarugby.online`. It is not linked from the Kyalami header. **Inferred:** it was copied in with the shared Footprint/Magus codebase and is not the public Kyalami journey.

## Branch reality

| Branch | Tip | Date | Relative to `master` |
|---|---|---|---|
| `master` | `5b60e52` | 2020-10-28 | Inspected tree. No pipeline step for this branch |
| `qa` | `e0f870a` | 2020-12-04 | Ahead. Includes `FN-55` |
| `prod` | `0950599` | 2020-12-04 | Ahead. Merge of `qa` |
| `FN-55` | `d80a39c` | 2020-12-04 | "Update to set confirm email if email already exists" |

On `qa` and `prod`, compared with `master`:

- `application/configs/application.ini.bak` is named `application/configs/application.ini` and is tracked. `qa` uses database host `qadb.footprintapp.net`. `prod` uses `db.footprintapp.net`. Database name on both is `teamwizz_SARU`.
- `ApplicationController::sendMail` sends as `accreditation@magus.events` through `smtp.gmail.com` (TLS, port 587). `master` sends as `accreditation@kyalami9hour.com` through the same host. Passwords are hard-coded and are not reproduced here.
- `FN-55` sets the hidden confirm-email field when the address is already used. On `master` that field is cleared in the same case. See business rules.

`master` has 67 commits. Last activity on `prod` is 2020-12-04. Nothing in Git after that date was found.

## Objectives (inferred from the portal, not from a written plan)

- Let a person apply for Kyalami 9 Hour 2020 accreditation and receive a reference.
- Let them return with email and reference and update the application until a status lock.
- Let them confirm or cancel attendance from a key link.
- Deploy the PHP application to the Magus events host through CodeDeploy when `qa` or `prod` is pushed.

## Scope

In this repository:

- Public application wizard, sign-in, profile, attendance response, and closed-event page (`default` module).
- Read and write of accreditation rows in the shared MySQL database `teamwizz_SARU`.
- HTML email when the accreditation row has an email template.
- Headshot upload pushed to `https://www.footprintapp.net/accreditations/application/updateimage`.
- CodeDeploy packaging on the `qa` and `prod` branches.

Not in this repository:

- Screens to approve, decline, or assign zones. Status labels are displayed. The only status write found here is applicant self-decline on the attendance link (`Status` = 2).
- Schema migrations.
- Automated tests.
- A SonarQube project file. The onboarding scan listed `sonar-project.properties` and `sonarqube_scan.bat`. Neither file is in Git.

## Architecture (summary)

Zend Framework 1.11.10 (`library/Zend/Version.php`), PHP, MySQL via `pdo_mysql`, jQuery Steps in the browser. Two modules: `default` (public portal) and `supplier` (inherited company/permit code). Layout plugin `PG_Controller_Plugin_LayoutPicker` selects a layout named after the module. Only `application/layouts/default.phtml` exists.

Detail is in `technical-documentation.md`.

## Milestones visible in Git

| When | Commit | What changed |
|---|---|---|
| 2019-12-13 | `c73fbf2` | Full repository committed |
| 2019-12-13 | `98cef06`, `6bb8aff`, `61003c5` | Pipelines, `appspec.yml`, `codedeploy_deploy.py` |
| 2020-10-27 | `afcd3f3` | Title "Kyalami 9 Hour 2020"; code `5F9298188128B`; ApplicationStop hook switched to `scripts/remove_archives.sh` |
| 2020-10-28 | `5b60e52` | `master` merges `prod` |
| 2020-12-04 | `d80a39c` | `FN-55` confirm-email change, merged to `qa` and `prod` only |

## Dependencies

- PHP with the Zend Framework 1.11.10 tree vendored under `library/`. `random_id` calls `mcrypt_create_iv`. **Unknown / Requires Confirmation:** the PHP version on the host. `mcrypt` is not part of PHP 7.2 or later.
- MySQL database `teamwizz_SARU` on `db.footprintapp.net` (production section and `prod` branch) or `qadb.footprintapp.net` (`qa` branch).
- Footprint photo store at `www.footprintapp.net`.
- SMTP `smtp.gmail.com`, port 587, TLS.
- AWS CodeDeploy and S3. Application name, deployment group, bucket, region, and keys come from Bitbucket pipeline variables. They are not stored in the repo.
- Apache (`httpd`) on the deploy host. `scripts/install_dependencies` runs `yum install -y httpd`.

## Current project status

**Implemented** as a 2019–2020 event site. Git stops on 2020-12-04 on `prod`. No open work, roadmap, or issue tracker exists in the repository.

`master` cannot boot from a fresh clone alone: `public/index.php` loads `application/configs/application.ini`, that path is listed in `.gitignore`, and the tracked copy on `master` is `application.ini.bak`. The `prod` branch tracks `application.ini`.

## Known gaps (do not treat as a roadmap)

- Approver workflow is not in this repo.
- `OpenDate` is selected in some queries and is not checked before showing the form. Only `CloseDate` at 24:00 is enforced.
- `updateAction` writes posted fields for an `AAID` with no session check and no status check.
- Production config and `public/index.php` turn `display_errors` on.
- SMTP and database passwords are stored in source. They are not copied into Silicon Ark.
- The `supplier` module's layout file `supplier.phtml` is named in config and is not in the repository.
