# Features — paymyfines-backend-new

Evidence date: 2026-10-08.

Source: `main` at `c01bc83810ee8dd035870baba60e871e96066d86` (2025-02-27, "deploy new").

Feature status is what this revision contains. Git history before that commit is a `.gitignore`, a Bitbucket pipeline file, and `sonar-project.properties`. There is no older application tree in this repository to diff against.

## Current features

All of these are deployed as Lambda functions in `serverless.yml` unless noted.

| Feature | Route or trigger | Handler | Status |
|---|---|---|---|
| reCAPTCHA verify | `POST /recaptcha` | `PMF.Recaptcha::IsRecaptchaValid` | Current |
| Logged-in user | `GET /details` | `PMF.GetLoggedInUser::GetLoggedInUserDetails` | Current |
| Update profile and extra ID numbers | `POST /update` | `PMF.PostUserDetail::PostUserDetails` | Current |
| User by id, Cognito id, or email | `GET /user/details` | `PMF.UserDetails::GetUserDetails` | Current |
| API call log | `GET /logs` | `PMF.ApiLogs::GetAPILogs` | Current |
| Transaction history | `GET /transactions` | `PMF.TransactionList::GetTransactions` | Current |
| Create MySQL user | `POST /register` | `PMF.Registration::RegisterUser` | Current |
| iForce payment proxy | `POST /registerpayment` | `PMF.IForcePayment::PostPayment` | Current. Comment in the handler says settlement is done from the cron job |
| iForce evidence | `GET /evidence` | `PMF.IForceEvidence::GetEvidence` | Current. Timeout 30s |
| All fines for a user or ID | `GET /getallfines` | `PMF.AllFines::GetAllFines` | Current. Timeout 45s |
| Paginated fines | `GET /getpaginatedfines` | `PMF.AllFines::GetPaginatedFines` | Current. Timeout 45s. Not listed in the URL comment block at the top of `serverless.yml` |
| Notice search | `GET /getfinesearch` | `PMF.QuickFines::GetQuickFines` | Current. Timeout 30s |
| iForce evidence stream | `GET /streamevidence` | `PMF.StreamEvidence::GetStreamEvidence` | Current. Timeout 30s |
| iForce outstanding by notice | `GET /getoutstandingfines` | `PMF.IForceOutStandingFines::GetOutstandingFines` | Current. Timeout 30s |
| iForce charges | `GET /getcharges` | `PMF.GetCharge::GetCharges` | Current. Timeout 30s |
| eNatis notice query | `GET /queryinfringements` | `PMF.QueryInfringement::QueryExternalInfringement` | Current. Timeout 30s |
| eNatis person query | `GET /queryinfringer` | `PMF.QueryInfringer::QueryExternalInfringer` | Current. Timeout 30s |
| eNatis pay proxy | `POST /payinfringement` | `PMF.PayEnatis::PayExternalInfringement` | Current. Timeout 30s |
| Cognito mail | Custom Message on the stage user pool | `PMF.CognitoMail::GenerateCustomEmail` | Current |
| Link Cognito id to email | `POST /updateregistration` | `PMF.RegistrationUpdate::UpdateRegistration` | Current |
| Update settings and mail templates | `POST /postsettings` | `PMF.UpdateSettings::PostUpdateSettings` | Current |
| Finance extract | `GET /reports` | `PMF.FinanceReportData::GetFinanceReportData` | Current |
| Dashboard graphs | `GET /getgraphs` | `PMF.GetGraph::GetGraphs` | Current |
| Read graph definitions | `GET /getgraphsettings` | `PMF.GraphSettingsGet::GetGraphSettings` | Current |
| Write graph definitions | `POST /postgraphsettings` | `PMF.GraphSettingsPost::PostGraphSettings` | Current |
| Store iVeri basket | `POST /postiveritransaction` | `PMF.RecordPaymentTransaction::PostIveriLiteTransaction` | Current. Timeout 30s |
| iVeri return, mark paid, email receipt | `POST /iveripayment` | `PMF.RedirectIveriPayment::IVeriPayment` | Current. Timeout 45s |
| Rebuild a receipt | `POST /generatereceipt` | `PMF.RedirectIveriPayment::GenerateReceipt` | Current. Timeout 45s. Not listed in the URL comment block |
| Contact form email | `POST /contactUs` | `PMF.ContactUs::ContactUsInformation` | Current. Timeout 45s. Not listed in the URL comment block |
| Source settlement | `GET /runcronjob` and `rate(2 hours)` | `PMF.CronJob::RunCronJob` | Current. Timeout 900s |

Shared behaviour used by the fine and payment features:

- Local double-pay flag: `Services/PaymentChecker.cs`.
- Receipt HTML and PDF post: `Services/PaymentReceiptService.cs`.
- Graph SQL runner: `Services/GraphService.cs`.
- Request log insert: `classes/Logger.cs`.

## Completed features

Nothing in the repository is marked complete as a shipped milestone. The application arrived in one commit, `c01bc83`.

## In development

No branch other than `main`. No TODO issue tracker in the repo.

Comments that describe unfinished behaviour, still present in the running code:

- `Services/PaymentService.cs`: `terminalId = 0` with the comment "what goes here??".
- `serverless.yml` on `RunCronJob`: the comment says 8 hours and "2 hours for testing", while `rate(2 hours)` is the value that is not commented out.
- `Functions/External/IForce/PostPayment.cs`: "this call is not being used only from cron job", but the HTTP route is still declared.
- `Functions/External/Payments/PostIveriLiteTransaction.cs` contains charge-query methods that the insert handler does not call.
- S3 upload in `PaymentReceiptService` is commented out. `ReadFromS3` remains.

These are **Implemented** leftovers, not a separate in-development branch.

## Planned features

No roadmap file.

Commented deploy entry only:

```yaml
# deletepayment:
#   handler: AwsDotnetCsharp::AwsDotnetCsharp.Handler::DeletePayment
#   path: deletepayment
```

`AwsDotnetCsharp.Handler` and `DeletePayment` are not in the tree. **Unknown** whether delete-payment was planned or removed before `c01bc83`. The header comment in `serverless.yml` still lists `POST .../deletepayment`.

`README.md` describes `hello` and `getquerystring` functions and a `us-east-1` deploy. Those functions are not in `serverless.yml`. Treat the README as starter text, not a backlog.

## Recently changed

The only application change in git is `c01bc83` (2025-02-27, "deploy new"), which added the Lambda project. The same day added the SonarQube pipeline. No commit since 2025-02-27.

`paymyfines-frontend-new` in Silicon Ark was also snapshotted on 2025-02-27 (`a335e20`). A shared release is **Inferred** from the date, not from a commit message that names both repos.

## Deprecated or removed

| Item | Evidence | Status |
|---|---|---|
| `POST /deletepayment` | Commented in `serverless.yml`. Handler class absent | Not deployed |
| HTML-to-PDF NuGet `Select.HtmlToPdf.NetCore` | Commented in `AwsDotnetCsharp.csproj` | Not referenced. PDF is an HTTP service |
| S3 invoice upload | Commented in `PaymentReceiptService` | Not on the receipt path |
| Admin role query inside the cron | Commented in `RunCronJob.cs` | Not executed. Mail goes to one hardcoded address |
| Transaction status update on settlement | Commented SQL in `PaymentService` that would set the transaction to `SETTLED` | Infringement row is updated. Transaction row is not moved to `Source Approved Payment` by the cron |
| Sandbox base URLs | Commented in `Constants.cs` (`192.168.0.41`, `10.104.5.173`) | Not used. Live base URL is secret `pmf-enatis` |
| Older reCAPTCHA secret | Commented above the active constant | Not used. The active secret is still in source |
| AWS profile pins | Commented in `serverless.yml` and `environmentConfig.yml` | Deploy profile is chosen by the person running Serverless. `aws-lambda-tools.default.json` still says `pmf-prod` |

## Sample requests

`TestRequests/` contains event JSON for manual Lambda test-tool runs:

- `postiVeriTransaction.json`
- `postUserDetails.json`
- `getUserDetailsByUserId.json`
- `getGraphsReportData.json`
- `getFinanceReportData.json`
- `getAllFinesByUserId.json`
- `getAllFinesByIdNumber.json`

There is no test project that executes them.

## Source map for payments

| Step | File |
|---|---|
| Insert unpaid transaction and infringements | `Functions/External/Payments/PostIveriLiteTransaction.cs` |
| iVeri browser return | `Functions/External/Payments/IVeriPayment.cs` |
| Receipt | `Services/PaymentReceiptService.cs` |
| Already-paid check | `Services/PaymentChecker.cs` |
| Push to iForce and eNatis | `Services/PaymentService.cs` |
| Schedule | `Functions/Jobs/RunCronJob.cs` |
