# Project plan — myPass-registration

Evidence date: 2026-10-09.

Source repository: `git@bitbucket.org:overdrive/mypass-registration.git`.

Inspected revision: `master` at `e1a887a` (2023-01-18, "Changed page load"). That commit is `origin/HEAD`. The remote also has branch `favicon`, which was merged in pull request #1 (`3930fee`, 2022-07-20).

This plan describes what the repository contains. It does not decide what the product should become.

## Product

**MyPass registration** is a public, mobile-oriented web form. A visitor on an event subdomain fills in personal details, identity and organisation, optionally linked events, accepts terms, and submits an accreditation application. The page title is "MyPass".

Provenance: **Implemented** (`index.html`, `scripts/core.js`). There is no README and no product brief in the repository.

The form does not decide the event by itself. On load it sends the first label of the hostname to `POST https://footprintapp.net/api/mypass/getstyling`. The response is expected to supply the event id, which fields to show, and colours. If that call fails or returns no `eventID`, the page uses the hardcoded `domains.demo` entry (event id `87`). Provenance: **Implemented** (`scripts/core.js` `DOMContentLoaded` handler, `domains.js`).

A confirmation panel then shows a reference number returned by `POST https://footprintapp.net/api/mypass/postaccreditation` and tells the visitor a confirmation email was sent. This repository does not send that email. Provenance: **Documented** in the success copy in `index.html`; email dispatch is **Unknown** and lives outside this repository.

## What this repository is

A static front end. `index.html` is the only page the live script treats as the product (`page = "registration"`). Styling is a vendored Enabled mobile theme (file header in `scripts/bootstrap.min.js`: Bootstrap 5.0.0-beta2, theme URL `http://enableds.com`) plus event colours applied at runtime. Photo cropping uses Cropme (`plugins/cropme/`).

There is no application server, database, login, or test suite in this tree. `php/contact.php` is theme boilerplate that posts mail to `mail@domain.com`. Nothing in `index.html` calls it.

Deployment, for pushes to `master` only, is Bitbucket Pipelines: upload the clone directory to an S3 bucket, then invalidate a CloudFront distribution. Bucket, region, distribution id, and the public hostname are pipeline variables, not files in the repo. Provenance: **Implemented** as pipeline steps (`bitbucket-pipelines.yml`). The live URL is **Unknown / Requires Confirmation**.

## History

55 commits, 2022-02-11 to 2023-01-18. Authors on the log: Jaco Brits, Joshua Gatley-Dewing, `heinrichoverdrive`.

| Period | What changed |
|---|---|
| 2022-02-11 | `2130498` initial commit. `85fcc31` "Slitout repos" — split out of a larger tree. `scripts/core_old.js` and `scripts/core_epic.js` remain from that larger client and are not loaded by `index.html`. |
| 2022-02-21 to 2022-02-28 | Theme styling, domain map, ethnicity, event id lookup. `0517674` "remove defualt domain". `c1ca43e` "Update remove sub domain". |
| 2022-03-04 to 2022-03-24 | Cache-busting query strings (`7ac2221`). Photo upload fixes. `3d778f4` "remove qa domain" — `qa` in `scripts/core.js` is now `""`, so API calls go to `https://footprintapp.net` rather than `https://qa.footprintapp.net`. |
| 2022-06-08 to 2022-07-20 | Favicon work, including API-driven favicon (`535052b`) and merge of branch `favicon` (pull request #1). |
| 2022-06-24 to 2022-06-28 | Null `data-highlight` guard, demo fallback when the domain is not found (`4546bef`), default ethnicity change for an iPhone dropdown bug (`85bc3af`), error handling (`edade3a`). |
| 2022-08-05 to 2022-08-16 | Email copy, city/address visibility from the event API, custom field display, next-step behaviour. |
| 2022-09-13 to 2022-10-27 | Confirmation email address, favicon and icons, cache clearing, background image. |
| 2022-11-21 | `d8e47de` turns `debug` off. `1a73026` updates the close-date check. |
| 2023-01-18 | Covid declaration removed, restored, then removed again (`016eca9`, `2f981ef`, `1c39a5d`). Version noted as 1.308 (`28c48e5`). `e1a887a` changes page load. |

No commits after 2023-01-18 were on `master` at inspection time. Current status: **dormant front end**. Whether it is still deployed is **Unknown / Requires Confirmation**.

## Scope

### In this repository

- One registration page with four steps: Personal, Identity, Events, Submit.
- Hostname-based event selection via the Footprint MyPass styling API, with a demo fallback.
- Organisation lookup by reference number, including a limit-reached stop.
- Event close-date stop.
- Terms acceptance loaded from the event payload.
- Photo select and crop, posted with the application.
- Per-event colours, banner, background, and favicon when the styling payload provides them.
- A service worker that cache-first serves `index.html`.
- Production deploy pipeline to S3 and CloudFront.

### Present but not on the live page

- `scripts/core_old.js` and `scripts/core_epic.js`: an earlier MyPass client (login, password reset, profile, health certificate, Covid symptom/test cards, pass details). `index.html` does not reference them.
- `exports/`: static design HTML (sign-in, sign-up, onboarding, health pass, menus). Not linked from `index.html`.
- `menu-main.html`, `menu-colors.html`, `menu-footer.html`, `menu-share.html`, `screen_result_review_old.html`: theme or leftover screens. The registration page's own menus are the terms modal `#menu-call` and the warning sheet `#menu-warning`, both inline in `index.html`.
- `php/contact.php`: unused theme mailer.
- `domains.js` keys other than `demo`. Only `domains.demo` is read, and only as the fallback when styling has no `eventID`.

### Not in this repository

- The Footprint API implementation (`getstyling`, `getevent`, `getorganisation`, `postaccreditation`).
- Storage of applications, organisation limits, close dates, terms text, and confirmation email.
- Review, approval, or badge printing after submit.
- Accounts, passwords, or staff administration. Those calls exist only in the unloaded legacy scripts.

## System shape

```text
Browser  index.html + scripts/core.js + scripts/custom.js + domains.js
   |  POST /api/mypass/getstyling          { domain: first hostname label }
   |  GET  /api/mypass/getevent/EventID/{id}
   |  GET  /api/mypass/getorganisation/ORefNumber/{ref}
   |  POST /api/mypass/postaccreditation   (application JSON, photo as data URL)
   v
https://footprintapp.net/api/mypass/
```

Pipeline on `master`: Bitbucket clone → S3 (`atlassian/aws-s3-deploy:0.5.0`) → CloudFront invalidation (`atlassian/aws-cloudfront-invalidate:0.3.3`).

`track.mypass.zone` in Silicon Ark is a different repository. It also uses event id `367` (RWC Sevens in this repo's unused `domains.rwcsevens` entry) and MyPass / SA Rugby accreditation language. Whether the two products share the Footprint data store is **Unknown / Requires Confirmation**.

## Major components

| Component | Role | Evidence |
|---|---|---|
| `index.html` | Registration markup, success and limit panels, terms modal | Loaded page |
| `scripts/core.js` | Event load, validation gates, API calls, submit payload | Script tag `scripts/core.js?v1.307` |
| `domains.js` | Fallback demo event and unused per-domain event ids | Read only as `domains.demo` |
| `scripts/custom.js` | Theme behaviour, visual validators, service worker | `isPWA = true` |
| `_service-worker.js` | Cache-first `index.html`, cache name `Cache-Version-v1.309` | Registered from `custom.js` |
| `bitbucket-pipelines.yml` | Production S3 deploy and CloudFront invalidation | Branch `master` only |

## Milestones already in the history

These are observed deliveries, not a forward plan.

1. Split a static registration page out of a larger MyPass client (2022-02).
2. Drive colours and event id from the styling API, with a demo fallback (2022-02 to 2022-06).
3. Point API calls at production `footprintapp.net` (`3d778f4`, remove QA host).
4. Show or hide address and city from the event payload, and drive favicon from styling (2022-06 to 2022-08).
5. Remove the Covid declaration from the last step while still sending `covidCheck: 1` (2023-01-18).

No later milestone is written down in the repository.

## Implementation plan

There is no open plan, backlog, or TODO file in the repository. Forward work is **Unknown / Requires Confirmation**.

Items a future change would have to respect, because the code does them today:

- Do not treat `domains.js` (except the demo fallback) as the list of live events. Live event identity comes from `getstyling`.
- Do not treat `core_old.js` / `core_epic.js` as the current product.
- A Covid checkbox is not on the page. The submit body still sets `covidCheck` to `1`.
- Gender "Prefer not to say" is stored as `M` unless Female is checked. See business rules.
- The non-media path retargets the Identity NEXT button with a misspelled attribute `conclick`, so the original `onclick` remains `setTabActive('3')`.

## Known dependencies

| Dependency | How it is used | Where configured |
|---|---|---|
| Footprint MyPass API | Styling, event, organisation, submit | Hardcoded host in `scripts/core.js` |
| Amazon S3 and CloudFront | Production hosting | Bitbucket deployment variables `REGISTER_PROD_AWS_*` and `REGISTER_PROD_CLOUDFRONT_DISTRIBUTION_ID` |
| Google Fonts (Inter) | Page font | `index.html` stylesheet link |
| Cropme | Photo crop | `plugins/cropme/` |
| Bootstrap 5 bundle and the Enabled theme | Layout, collapse tabs, alerts | `scripts/bootstrap.min.js`, `styles/` |
| Font Awesome | Icons | `fonts/css/fontawesome-all.min.css` |

Browser APIs used: `fetch`, `localStorage`, `FileReader`, service worker. No npm manifest and no build step.

## Current project status

| Item | State |
|---|---|
| Registration page | Implemented on `master` |
| API client for styling, event, organisation, submit | Implemented |
| Covid checkbox | Removed from the page on 2023-01-18; flag still sent as `1` |
| QA API host | Removed (`qa` is empty) |
| Debug subdomain override | Off (`debug = false`). If turned on, hostname is ignored and the subdomain sent is `cpt7smedia` |
| Automated tests | None in the repository |
| Documentation in the source repo | None |
| Last source change | 2023-01-18 |
| Production URL, bucket, and whether the pipeline still runs | Unknown / Requires Confirmation |
