# Project plan — SaruEfiling.com

Evidence date: 2026-10-04.

Source repository: `git@bitbucket.org:overdrive/saruefiling.com.git`.

Inspected revision: `master` at `379437f8` (2023-03-07, "repo fix", author Heinrich du Plessis). That commit is `origin/HEAD`.

The local scan path named in the onboarding task (`~/projects/sonar_scan/repos/SaruEfiling.com`) was not present on this machine. The tree was read from a clone of `master`.

This plan describes what the repository contains. It does not decide what the product should become. There is no project plan, roadmap, or README in the source repository or in Silicon Ark before this set.

## Product

**SARU E-Filing** is a web application for South African Rugby union organisations to complete annual electronic forms, submit them, and record president and CEO approval. The browser title is `SARU:: Efiling`. Outgoing mail identifies the sender as `SA Rugby Efiling` from `support@saruefiling.com`.

Provenance: **Implemented** (`application/layouts/default.phtml`, `library/PG/Controller/Plugin/EmailLayout.php`).

The same tree is a Zend Framework 1 application descended from Footprint / Teamwizz. It also contains personnel, organisations, GIR (participant gender reporting), plan and budget, grants, squads, fixtures, tournaments, scouting, assessments, and a calendar. Which of those a signed-in person sees depends on a JSON role blob and on `UnionType`. Provenance: **Implemented** (`application/views/scripts/menu/default.phtml`, `IndexController`).

The database name in configuration is `teamwizz_SARU` on host `db.footprintapp.net`. Provenance: **Implemented** (`application/configs/application.ini`). Whether that database is still shared with other Footprint products is **Unknown / Requires Confirmation**.

## What this repository is

A Zend Framework 1.11.10 PHP application. `public/index.php` is the front controller. The repository `.htaccess` rewrites requests that are not already under `/public/` into `public/`.

AWS CodeDeploy copies the whole tree to `/mnt/data/www/html/saruefiling.com/saruefiling.com/` and sets owner `apache`. Provenance: **Implemented** (`appspec.yml`). The Apache document root on that host is **Unknown / Requires Confirmation**. The rewrite rule implies the vhost root may be the deployed directory rather than `public/` alone.

`Footprint_files/` is a second, older copy of application, library, and public files inside the same repository. The running front controller is the top-level `public/index.php`, which sets `APPLICATION_PATH` to the top-level `application/` directory. Provenance: **Implemented**. Whether anything on the server still executes files under `Footprint_files/` is **Unknown / Requires Confirmation**.

## History

213 commits. First commit `dadacd99` is 2019-12-18 ("initial commit of full repository", author `root`). Commit `ce41d3a5` (message "first commit from duped site") records that the tree was duplicated from another site.

Authors visible on early history include `heinrichoverdrive` and, on the 2023 form-approval commits, Heinrich du Plessis (`heinrich@evolveav.co.za`).

Activity from 2022 through 2023-03-07 is concentrated on e-filing form HTML elements, Excel export, file upload, email sending, and the approve / draft buttons. The last change on `master` is the CEO-approval path accepting job title `22` as well as `23` (`379437f8`).

No commit has landed on `master` since 2023-03-07. Provenance: **Implemented** (git history). Whether the deployed site has moved on outside this repository is **Unknown / Requires Confirmation**.

## Branches

| Branch | Tip seen on 2026-10-04 | Pipeline |
|---|---|---|
| `master` | `379437f8` 2023-03-07 | Bitbucket Pipelines step "Deploy on PROD" |
| `development` | `93b05949` 2020-02-27 | Bitbucket Pipelines step "Deploy on QA" |
| `qa` | `532606c6` 2020-02-28 | No pipeline step in `bitbucket-pipelines.yml` |
| `prod` | `7a2df0bf` 2020-01-14 | No pipeline step |

`master` is years ahead of the branch named `prod`. Provenance: **Inferred** that production deploys follow `master` through CodeDeploy, and that the `prod` and `qa` branches are stale. **Requires Confirmation** which branch, if any, is still deployed.

## Scope that is in the repository

In scope of the code that is wired to the signed-in shell:

- Email and password login restricted to credentials flagged for e-filing, then a first-login profile when `Status` is 0.
- Year-filtered e-filing forms (`/epg`), form fill, save, submit, reopen to draft, president approval, and CEO approval.
- Form template builder (`/builder`) for a narrow set of users.
- Personnel and organisations, when the role JSON includes those keys.
- GIR overview and pivot. The menu does not check a role key.
- Plan and budget / grants administration, when the role JSON includes `grants`.
- Excel download of a form, PDF helpers, and document upload on a form.
- A cron-style PHP script that pulls programmes, institutions, and participants from a Global Performance GraphQL API.

Present in controllers but not given a top-level menu item in `menu/default.phtml`: squads, fixtures, tournaments, schools, scouting, assessments, learning courses, messaging, financials, performance questionnaires, and the calendar link in the header (`/events/`). Those screens still redirect to `/login/` when there is no identity, where their controllers follow the same pattern as the e-filing controller. Provenance: **Implemented**. Whether operators still use them is **Unknown / Requires Confirmation**.

## Architecture

```text
Browser
  -> Apache rewrite into public/
  -> Zend_Application (production, application.ini)
  -> Zend_Controller (one controller per area)
  -> Zend_Db_Table models
  -> MySQL teamwizz_SARU

Bitbucket Pipelines (python:3.5.7)
  -> zip the tree
  -> codedeploy_deploy.py
  -> S3 + AWS CodeDeploy
  -> /mnt/data/www/html/saruefiling.com/saruefiling.com/
```

Mail is sent through `PG_Controller_Plugin_EmailLayout` (Zend_Mail, from `support@saruefiling.com`). A separate tree under `public/cron/` and `public/emailCron/` uses PHPMailer and Guzzle. Provenance: **Implemented**. Which path production actually schedules is **Unknown / Requires Confirmation**.

## Major components

| Area | Location | Role |
|---|---|---|
| Front controller | `public/index.php` | Bootstraps Zend, timezone `Africa/Johannesburg`, memory limit 800M |
| E-filing | `EpgController`, models `EPG*` | Forms, answers, approval, Excel |
| Form builder | `BuilderController` | Headers, sections, rows, targets |
| People | `MembersController`, `FirstController`, `UsersController` | Personnel, first login, credentials |
| Organisations | `OrganisationsController` | Unions / organisations |
| GIR | `MembersController::giroverviewAction`, `girpivotAction`, `Model_GirReport` | Gender counts by province |
| Plan and grants | `PlanController`, `GrantsController` | Projects and grant workflow |
| Access | `AccesscontrolController`, JSON `Role` on the profile | Menu and action flags |
| Mail | `library/PG/Controller/Plugin/EmailLayout.php` | Templates and send |
| Deploy | `appspec.yml`, `bitbucket-pipelines.yml`, `codedeploy_deploy.py`, `scripts/` | QA and production CodeDeploy |

## Milestones visible in git

There is no milestone document. The history itself shows these stages:

1. 2019-12-18 — full repository imported.
2. 2020-01 — duplicated site committed; pipelines file added.
3. 2020-02 — `development` and `qa` last move; tournament query work.
4. 2022-01 to 2022-11 — form elements, scoring, uploads, filters, email, and tournament charts.
5. 2023-01 to 2023-03-07 — new HTML elements, draft actions, and form 79 approval including job title 22.

Nothing in the repository describes work after 2023-03-07. Planned future work: **Unknown / Requires Confirmation**.

## Known dependencies

- PHP with the Zend Framework 1.11.10 library vendored under `library/Zend`. The PHP version the server runs is **Unknown / Requires Confirmation**.
- MySQL via `pdo_mysql`.
- Apache with `mod_rewrite`.
- AWS CodeDeploy, S3, and Bitbucket pipeline variables `QA_*` and `PROD_*` for keys, region, application name, deployment group, and bucket. The variable values are not in the repository.
- PHPMailer, Guzzle, Dompdf, PHPExcel, Highcharts exporting server, and jQuery-era UI assets under `public/`.
- External GraphQL endpoint `https://admin-api.globalperformance.co.za/authed/graphql`, called by `public/cron/getData.php` and `public/cron/getManagers.php`.

## Current project status

The repository is a maintained-until-2023 production codebase, not a greenfield project. `master` deploys to the production CodeDeploy application when a pipeline runs. There is no automated test suite. `Bootstrap.php` is empty. Several controllers and views exist as `*_old` or `*test` copies beside the live file.

## Human confirmation

- Is `master` still what production runs, and is the site still in use?
- Is `teamwizz_SARU` shared with other Footprint applications?
- What do `UnionType` values 1, 2, 3, and 11 mean in the organisation table?
- Is job title `22` the Administrator title in the live `positions` or job-title data?
- Is status `2` (label COMPLETED) still written by any process? No writer was found in `EpgController`.
- Are `public/cron/getData.php` and `getManagers.php` scheduled anywhere?
- Should `Footprint_files/` remain in the deploy artefact?
