# Project plan — pestelite_html (Pest Elite)

Evidence date: 2026-10-06.

Source repository: `git@bitbucket.org:overdrive/pestelite_html.git` (`https://bitbucket.org/overdrive/pestelite_html.git`).

Inspected revision: `main` at `c5476a0` (2024-02-19, Jason Wandrag, "Functional Updates"). The only other commit is `158f88b` (2024-02-09, Jason Wandrag, "First commit"). No other branches exist on the remote.

The scan-host path `~/projects/sonar_scan/repos/pestelite_html` was not on this machine. The tree below was read from that git revision. Live Form.io form definitions were also fetched on the evidence date, because the screens render those forms rather than defining the fields in git.

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

## Product

The widget name, npm display name, logo alt text, and page titles identify the product as **Pest Elite** (widget and npm name: `PestElite`). The widget id is `com.elite.pest`. Version in both `config.xml` and `package.json` is `1.0.0`.

Provenance: **Implemented** in `config.xml`, `package.json`, and `www/*.html`.

What the screens do, once a person has logged in, is maintain four Form.io-backed registers:

- site / service forms (`www/sites.html`, Form.io path `digimonkv1`)
- clients (`www/clients.html`, Form.io path `clientregister`)
- pesticides (`www/pesticides.html`, Form.io path `pesticidesregister`)
- users (`www/users.html`, Form.io path `pesteliteusers`)

The site form, titled `Digimonkv1` on Form.io, is a pest-control service report: client, visit, infestation levels, pesticides used, signatures, bait stations, insect monitors, a non-conformance report, and a recommendation report. Provenance: **Implemented** in the form definition fetched from Form.io. The repository has no written product brief that states this purpose. The purpose above is **Inferred** from the form labels and the screen titles.

`config.xml` and `package.json` still describe the project as a sample Apache Cordova app, and the author block is still the Apache Cordova Team. Provenance: **Implemented**, and it conflicts with the Pest Elite screens. Which description is authoritative is **Unknown / Requires Confirmation**.

A Pest Elite logo image inside the live site form points at `https://pestelite.co.za/wp-content/uploads/2022/07/PE_Logo-removebg-preview-e1659271343336.png`. That is a WordPress upload path. The WordPress site is not in this repository. How `pestelite.co.za` relates to this app is **Unknown / Requires Confirmation**.

## Objectives

No project plan, README, or requirements document exists in the repository. The following objectives are **Inferred** from the screens and the live forms:

- Let a signed-in person record pest-control site visits.
- Keep a client register (identity, addresses, contract, service frequency, trap layout).
- Keep a pesticide register (name, type, registration number, dosage).
- Keep a user register with a role of none, admin, client, or technician.
- Run the screens inside an Apache Cordova shell named PestElite, with Android and iOS declared as platforms.

## Scope

### In scope of the repository

- Cordova widget metadata (`config.xml`) and npm package metadata (`package.json`, `package-lock.json`).
- Static HTML screens under `www/`: login, sites, clients, pesticides, users, plus an unlinked `www/sites/index.html`.
- A Cordova device-ready stub (`www/js/index.js`), an empty `www/js/formio.js`, an unused Form.io base URL (`www/js/lib/constants.js`), the default Cordova stylesheet (`www/css/index.css`, not linked), and `www/img/logo.png`.

### Out of scope / not in this repository

- The Form.io project that stores the forms and submissions. The app calls `https://rzkiqpzlxxtfqjl.form.io`. The form definitions are not copied into git.
- Generated Cordova `platforms/` and `plugins/` trees. Both paths are gitignored, and neither directory is present in the clone.
- A Cordova CLI dependency. `package.json` scripts call `cordova`, but the CLI is not a declared dependency.
- Tests, CI, Docker, a README, and a deployment manifest. None are in the repository. `npm test` is the Cordova sample script that prints an error and exits 1.
- The public site at `pestelite.co.za`, if that site is the business website.
- `sonar-project.properties` and `sonarqube_scan.bat`. The onboarding task listed both at the repository root on the scan host. Neither file is in `main`. Provenance: **Unknown** — they may have been untracked files on the scan host.

## System architecture

One architecture is in git, and the data model lives outside git.

```text
Browser or Cordova WebView
  www/*.html
    Bootstrap 4 + Form.io client from public CDNs
    fetch() with header x-jwt-token
        |
        v
https://rzkiqpzlxxtfqjl.form.io
  pestelitelogin        login submission
  digimonkv1            site / service report
  clientregister        clients
  pesticidesregister    pesticides
  pesteliteusers        users (Form.io resource)
```

`config.xml` sets the start page to `index.html` and allows http and https intents to any host. The HTML pages do not include a `cordova.js` script tag. `www/css/index.css` and the device-ready UI from the Cordova sample are not used by the current screens.

There is no local database, no application server, and no background worker in this repository.

## Major components

| Component | Where | Role |
|---|---|---|
| Cordova widget | `config.xml`, `package.json` | Names the app PestElite, id `com.elite.pest`, version 1.0.0, platforms ios and android |
| Login | `www/index.html` | Email and password posted to the Form.io login form; stores a JWT and user id; opens the sites screen |
| Site forms | `www/sites.html` | Lists service reports and opens Form.io create/view modals. Also the only screen that reads the signed-in user's role |
| Clients | `www/clients.html` | Lists and creates client records |
| Pesticides | `www/pesticides.html` | Lists and creates pesticide records |
| Users | `www/users.html` | Lists and creates user records |
| Unlinked form page | `www/sites/index.html` | Renders the pesticide register form and logs submit. Not linked from navigation |
| Form.io | external | Forms, submissions, and the JWT returned on login |

## Milestones visible in git

| When | Commit | What changed |
|---|---|---|
| 2024-02-09 | `158f88b` | Cordova sample plus a Form.io base URL constant and an empty `formio.js`. Login page was not in this commit as it exists now; `www/index.html` was the shorter first version |
| 2024-02-19 | `c5476a0` | Login, sites, clients, pesticides, users, `www/sites/index.html`, app icon in `config.xml`, replacement logo |

No commits after 2024-02-19. The login form's `modified` time is 2024-02-12, which is before that commit. The other live forms were modified after it: site form 2024-02-23, users 2024-04-08, pesticides 2024-04-15, clients 2024-07-12. Provenance: `modified` on each form fetched 2026-10-06. The git tree and those live forms are not from the same day.

## Implementation plan

There is no written implementation plan in the repository. The history shows a Cordova sample that, ten days later, gained the four register screens and a hand-written login. Nothing in git describes a next milestone.

## Known dependencies

- Apache Cordova Android `12.0.1` and Cordova iOS `7.0.1`, locked in `package-lock.json`, declared as devDependencies.
- Bootstrap `4.6.1` CSS and `4.6.2` JS, jQuery `3.5.1` slim, Popper `1.16.1`, loaded from `cdn.jsdelivr.net`.
- Form.io client CSS and `formio.full.min.js` from `cdn.form.io`, with no version pin.
- Form.io project host `rzkiqpzlxxtfqjl.form.io`.
- Nominatim, used as the address provider on the client form (not called from the HTML; configured on the Form.io address component).
- A global `cordova` binary, assumed by the npm scripts and not declared in `package.json`.

## Current project status

**Implemented** as a small front end on `main`, last changed 2024-02-19. The data entry forms are hosted on Form.io and have continued to change after the last git commit.

Not present: committed mobile platform projects, automated tests, CI, deployment config, logout, and a delete action in the UI.

`platforms/` and `plugins/` are absent, so this clone does not contain a buildable Android or iOS project until those are generated. Whether anyone has generated them outside git is **Unknown / Requires Confirmation**.
