# Features — pmf-backend-ah

Evidence date: 2026-10-06.

Source: `git@bitbucket.org:overdrive/pmf-backend-ah.git`, `master` at `064c4fa` (2022-05-06).

There is no features catalogue in the source repository. Status below is taken from `serverless.yml` and the handlers. "Current" means present on that revision. Nothing in git shows a feature added or removed after 2022-05-06.

Routes are the path in `serverless.yml`. Serverless prefixes the stage, so the base path in the file's own comments is `/production`.

## Current features

### Identity and profile

| Feature | Entry | Source |
|---|---|---|
| Register a user from Cognito uuid, name, email, id type, mobile | `POST /register` | `Handler.RegisterUser` |
| Attach a Cognito uuid to an existing email | `POST /updateregistration` | `Handler.UpdateRegistration` |
| Read a short profile by user id or Cognito uuid | `GET /details` | `Handler.GetLoggedInUserDetails` |
| Read a full profile, role, and additional identity numbers | `GET /user/details` | `Handler.GetUserDetails` |
| Update profile and replace additional identity numbers | `POST /update` | `Handler.PostUserDetails` |
| Report whether the user already has five or more additional ids | Field `maxNumberIds` on `GET /user/details` | `GetUserDetails` |
| Cognito sign-up, resend-code, and forgot-password email bodies | Cognito trigger `CustomMessage` on pool `tmt-pmf-prod-user-pool` | `Handler.GenerateCustomEmail` |

### Fine lookup

| Feature | Entry | Source |
|---|---|---|
| Search one notice on iForce if it contains `/`, otherwise on eNaTIS if it is digits | `GET /getfinesearch` | `Handler.GetQuickFines` |
| List outstanding iForce fines for a notice, with phase names and a local paid flag | `GET /getoutstandingfines` | `Handler.GetOutstandingFines` |
| List iForce and eNaTIS fines for an identity number or for every id stored on a user | `GET /getallfines` | `Handler.GetAllFines` |
| Proxy an eNaTIS infringer query | `GET /queryinfringer` | `Handler.QueryExternalInfringer` |
| Proxy an eNaTIS infringement query and attach the local paid flag | `GET /queryinfringements` | `Handler.QueryExternalInfringement` |
| Proxy iForce charges for a notice | `GET /getcharges` | `Handler.GetCharges` |
| Proxy iForce evidence | `GET /evidence` | `Handler.GetEvidence` |
| Proxy an iForce evidence stream | `GET /streamevidence` | `Handler.GetStreamEvidence` |
| Guest caller id | Query `Id=GUEST` accepted by the `Id` validator | `Model/APIModel.cs` |

### Payments

| Feature | Entry | Source |
|---|---|---|
| Store an iVeri transaction, its infringements, and charges copied from the source | `POST /postiveritransaction` | `Handler.PostIveriLiteTransaction` |
| Accept the iVeri return, mark the transaction and infringements paid or unpaid, redirect the browser | `POST /iveripayment` | `Handler.IVeriPayment` |
| Email a payment receipt (PDF from the HTML-to-PDF service, file read from S3) | Called from `IVeriPayment` | `Services/PaymentReceiptService.cs` |
| Block a second customer payment when `infringement.intPaid` is `YES` | Flag `customerPaymentAllowed` | `Services/PaymentChecker.cs` |
| Scheduled settlement to iForce and eNaTIS | `rate(2 hours)` and `GET /runcronjob` | `Handler.RunCronJob`, `Services/PaymentService.cs` |
| Email when a failed settlement has been tried more than three times | Inside the cron | `Services/MailService.cs` |
| HTTP forward of an iForce register-payment body | `POST /registerpayment` | `Handler.PostPayment`. Comment: not used except from the cron. The route is still deployed |
| HTTP forward of an eNaTIS pay-infringement body | `POST /payinfringement` | `Handler.PayExternalInfringement` |

### Staff data

| Feature | Entry | Source |
|---|---|---|
| Transaction history for a user id or an identity number | `GET /transactions` | `Handler.GetTransactions` |
| Finance extract of rows with `transaction.intPaid = 'SETTLED'` | `GET /reports` | `Handler.GetFinanceReportData` |
| Dashboard graphs from active `graph` rows | `GET /getgraphs` | `Handler.GetGraphs`, `Services/GraphService.cs` |
| List every graph definition | `GET /getgraphsettings` | `Handler.GetGraphSettings` |
| Insert, update, or delete graph definitions, and trial-run the SQL | `POST /postgraphsettings` | `Handler.PostGraphSettings` |
| Nedbank transaction table as a graph titled with `NedBank` | Branch inside `GetGraphs` | `GraphService.GetNedBankTable` |
| Read active settings | `GET /getsettings` | `Handler.GetSettings` |
| Update convenience fee and three Cognito email templates | `POST /postsettings` | `Handler.PostUpdateSettings` |
| Read API log rows for a supplied id | `GET /logs` | `Handler.GetAPILogs`. Comment: "For testing only". Route is deployed |
| reCAPTCHA verification | `POST /recaptcha` | `Handler.IsRecaptchaValid` |

Graph types the switch handles: `PieGraph`, `Table`, `CounterTab`, `StackGraph`, `VerticalBarGraph`, `LineMarkGraph`, `AreaGraph`, `RadarGraph`.

## Completed features

Git does not distinguish an earlier completed phase from the current tree. The handover commit `064c4fa` added the whole application in one change. Treat the table above as the completed snapshot on `master`.

## Planned features

No issue tracker, TODO file, or roadmap is in the repository.

Comments that describe unfinished or abandoned behaviour, not a written plan:

| Item | Evidence | Status |
|---|---|---|
| `terminalId` on iForce settlement | `PaymentService` sets `0` and comments `what goes here??` | **Unknown** |
| Admin recipients loaded from `user.strRole` | Query commented out in `RunCronJob` | Not active |
| `transaction.intPaid = 'SETTLED'` after source approval | Updates commented out in `PaymentService`, one with the note that it was commented out on a recommendation after a call | Not active |
| API Gateway IAM authorizer on the cron HTTP route | `authorizer: aws_iam` commented in `serverless.yml` | Not active |
| Provisioned concurrency `5` | Commented on every function | Not active |
| `deletepayment` | Function block commented in `serverless.yml`. No `DeletePayment` method in `Handler.cs` | Not deployed |
| Phone-number regex | Commented in `ValidData` | Not active |
| Eight-hour cron | Comment in `serverless.yml`. The active rate is `rate(2 hours)` | Not active |

## In development

No branch other than `master`. No commit after 2022-05-06. Nothing is marked in progress.

## Recently changed

The only application change is `064c4fa` (2022-05-06), which added the tree. There is no earlier version in this repository to diff against.

## Deprecated or removed

| Item | Evidence |
|---|---|
| `POST /deletepayment` | Commented out in `serverless.yml`. Handler class in the comment is `AwsDotnetCsharp.Handler`, which is not the class this service uses (`PMF.Handler`) |
| Starter routes `hello` and `getquerystring` | Described in `README.md`. Not present in `serverless.yml` |
| README deploy target `us-east-1` and API `4row8qyxh1` | Starter text and the "Silicon sequence". `serverless.yml` uses `eu-west-1` and documents API `puru95wxc8` |

## Not a feature of this repository

- A user interface. Receipt HTML links a logo on `master.d39rr3ejryd4rk.amplifyapp.com`.
- Cognito user-pool creation, sign-in, or JWT validation.
- The iVeri hosted payment page.
- iForce or eNaTIS themselves.
- A database migration tool. Tables are assumed to exist.
