# Project plan — im_angular_app

Evidence date: 2026-10-12.

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

Inspected revision: `master` at `060172dda5a4f7287c50d38211292f476b16db9c` (`060172d`, 2024-06-25 14:47:06 +0000, Dirk Jansen van rensburg, "Merged in dev (pull request #43)"). `origin/HEAD` points at `master`.

The scan-host path `~/projects/sonar_scan/repos/im_angular_app` was not on the machine used for this inspection. The tree was read from a clone of the Bitbucket remote at that revision.

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

No Silicon Ark directory existed for this project before these files. The source README is the Angular CLI starter plus a short note from Liam dated 02 May 2023. `README_OLD.md` is one line: "I&M Capital Poc project , deploying to AWS amplify and use lambda for 3rd party calls".

## Product

The browser title is **ImBank** (`src/index.html`). The npm package and Angular project name are `im-bank`. The dashboard document title inside the component template is **I&M Dashboard**. The terms screen calls the product **I&M Wealth Capital Fund**. The header logout label is **Back to OTG**. The coming-soon button says **Back to OTG Dashboard**. The footer says **©2021 I&M Bank**.

**Documented** names: `README.md` ("ImBank"), `README_OLD.md` ("I&M Capital Poc"). **Implemented** names: the templates and `index.html` above. Which string is the approved product name is **Unknown / Requires Confirmation**. The footer year 2021 is earlier than the first commit (2023-05-02).

What the screens do is a signed-in web client for buying units, withdrawing, and reading statements against Sanlam member records, using an I&M Bank (test DXP) login and I&M customer accounts. Third-party calls go through an AWS API Gateway stage named `dev`. That shape matches the one-line POC note. Whether the POC is still the intended status is **Unknown / Requires Confirmation**.

## Branch reality

| Line | Tip | What was established |
|---|---|---|
| `master` (default; `origin/HEAD`) | `060172d` (2024-06-25) | Inspected tree. Merge of `dev` via pull request #43 |
| `dev` | `15eaf335631dd87f105d4cb562628601acf754bb` | Remote head only. SHA differs from `master`. Files on this tip were not diffed |
| `statements-ui` | `bdbba09244d5b44661166d009cdb3bd5ccd8945d` | Remote head only. SHA differs from `master`. Files on this tip were not diffed |

No tags were requested. Whether `dev` or `statements-ui` contain commits that never landed on `master` is **Unknown / Requires Confirmation** beyond the fact that their tip SHAs are not `060172d`.

The clone used for this document contains 211 commits. The oldest is `64d5989` (2023-05-02, liam-ovd, "Initial commit from local repo"). The newest is `060172d`. Nothing on `master` is newer than 2024-06-25.

## Objectives

No objectives document exists beyond the READMEs and the on-screen copy. The following are **Inferred** from those texts and from the screens that are wired on `master`:

- Let an I&M customer open a web app for the I&M Wealth Capital Fund.
- Sign the customer in through the I&M retail test realm and only continue when a whitelist check returns a member number.
- Show portfolio value and daily yield, recent Sanlam transactions, and a statement that can be downloaded as a PDF.
- Purchase units from an I&M account and withdraw to that relationship, with a one-time code or PIN step.
- Send the customer back to the I&M OTG context when they leave.

## Scope

### In this repository (`master`)

- Angular 15 single-page application. Two routes: `/landing` and `/dashboard`. `/` redirects to `/landing`.
- I&M OpenID Connect redirect (fragment tokens) and calls to an AWS API Gateway `/dev` stage for Sanlam, payments, OTP, customers, and sessions.
- Dashboard actions: Purchase, Withdraw, Statements.
- Terms acceptance for a whitelist member who is not yet a local user, and a coming-soon panel when the whitelist check does not yield a member number.
- Unit-test scaffolding (Karma / Jasmine). Specs that were opened only assert that the service is created.
- SonarQube project key and a Bitbucket pipeline that runs a Sonar scan on `master`. A GitHub Actions workflow file scans on branch `main`, which is not the Bitbucket default branch.

### Out of this repository

- The AWS Lambda / API implementation behind the Gateway URL. This repo only calls it.
- The Sanlam system and the I&M DXP / Keycloak realm.
- AWS Amplify app configuration. `README_OLD.md` names Amplify. No `amplify.yml` or Amplify project file is in the tree.
- A production API stage or a production I&M host. `environment.ts` and `environment.prod.ts` contain the same `/dev` Gateway URL and the same `test-dxp.imbank.com` hosts.

## Architecture (as implemented)

```text
Browser (Angular, /landing and /dashboard)
  -> I&M test realm (OpenID Connect, fragment tokens)
  -> AWS API Gateway .../dev/  (customer, accounts, Sanlam, OTP, payments, sessions)
  -> api.ipify.org (public IP stored for the session record)
Logout / coming-soon "Back to OTG" -> I&M retail select-context URL
```

There is no backend, database, queue, or worker in this repository.

## Major components

| Area | Where it lives | Role |
|---|---|---|
| Routes | `src/app/app-routing.module.ts` | `/landing`, `/dashboard` |
| Sign-in and gate | `src/app/core/components/landing/` | Read fragment tokens, whitelist, terms or coming soon |
| Fund home | `src/app/core/components/dashboard/` | Portfolio, transactions, purchase, withdraw, statements |
| I&M and Sanlam calls | `src/app/core/services/` | HTTP clients. No interceptor |
| API hosts | `src/app/core/environments/` | Gateway, I&M auth, terms, privacy |

`app-purchase-block`, `app-withdrawal-block`, and `app-portfolio-block` are declared on `AppModule` and are not placed in any parent template. `app-transaction-model` (`#transactionModal`) is in the dashboard template, and no template sets `data-bs-target` to that id. The path that the greeting buttons actually open is `app-transaction-block`, then `#reviewWithdrawalModal`.

## Milestones visible in history

These are commit themes, not an approved plan.

| When | What landed |
|---|---|
| 2023-05-02 | Repository created (liam-ovd). Purchase modal work starts the same day |
| Later commits on the inspected history | Accounts API, purchase and withdrawal UI, OTP, charges, statements, mobile layout, token refresh service |
| 2024-06-25 | `dev` merged to `master` (pull request #43) |

No milestone after 2024-06-25 is in `master`.

## Implementation plan

There is no written plan in the repository for remaining work. The code still contains commented payment-log calls, an unused token-refresh starter, and environment files that do not differ between development and production. Whether any of that is scheduled work is **Unknown / Requires Confirmation**.

## Known dependencies

- Angular CLI 15.2.6, Angular 15.2, TypeScript 4.9.4, RxJS 7.8, Zone.js 0.12.
- Bootstrap 5 (bundled) and a Bootstrap 4.5.2 stylesheet loaded from `maxcdn.bootstrapcdn.com` in `index.html`.
- DataTables, jQuery, ApexCharts, jsPDF, Pikaday, jwt-decode.
- I&M test DXP realm `inm-retail`, client id `bb-web-client` on the login redirect and client id `im-wealth` inside the unused refresh call.
- AWS API Gateway id `5t9f8yr10b` in `eu-west-1`, stage `dev`.
- Sanlam operations are reached only through that Gateway (`sanlamgettoken`, `getsanlammembers`, and the other `sanlam*` paths).
- Public IP from `https://api.ipify.org/?format=json`.

## Current project status

**Implemented** on `master` as a frontend POC pointed at test I&M hosts and a Gateway stage named `dev`. Last change 2024-06-25. No route guard beyond a token check inside the dashboard component. No separate production configuration in the environment files.

**Unknown / Requires Confirmation:** whether any environment still deploys this build, whether Amplify is the host, and whether `dev` or `statements-ui` should be documented as the live line instead of `master`.
