# Features — prsa_cio

Evidence date: 2026-10-06.

Source: `git@bitbucket.org:overdrive/prsa_cio.git`, `master` at `2832986` (2023-09-20).

There is no features document in the source tree. Status labels describe the code on that revision.

## Identity and shell

| Feature | Status | Evidence |
|---|---|---|
| Solution name `prsa_cio` with web, API, BL, and DAL folders | Current | `prsa_cio.sln` |
| Login chrome "PRSA - CIO" | Current as markup | `src/app/PRSA.App/Pages/Account/Login.cshtml` |
| Page title "Reporting System" | Current | `Index.cshtml`, `IndexModel.OnGet` |
| AdminLTE 3 layout, sidebar, and demo user "Alexander Pierce" | Present, unused | `Pages/Shared/_Layout.cshtml`. `_ViewStart.cshtml` sets `Layout = null` |
| Favicon and vendored Bootstrap, jQuery, jquery-validation, AdminLTE CSS/JS | Current files | `src/app/PRSA.App/wwwroot` |
| Privacy page with template copy | Current | `Pages/Privacy.cshtml` at `/Privacy` |
| Error page with request id, no-store cache | Current | `Pages/Error.cshtml.cs`. Wired only when the web app is not Development |

## Reporting page

| Feature | Status | Evidence |
|---|---|---|
| Route `/` | Current | `@page "/"` on `Index.cshtml` |
| Tabs Tracker, SalesForecast, StockBalance, QlikviewSales | Current, hard-coded | `IndexModel` list. Comment says "replace with your logic" |
| Empty DataTables markup per tab | Current | `Index.cshtml` |
| DataTables initialisation and AJAX load | Commented out, not current behaviour | Script block in `Index.cshtml` |
| First tab shown with Bootstrap's tab plugin | Current script | `$('#tabs a:first').tab('show')` |
| File input accepting `.xlsx` | Current browser hint | `accept=".xlsx"`. Server does not check the extension |
| Multipart upload form | Current | `enctype="multipart/form-data"` |
| Success alert "File uploaded successfully!" | Current when the posted file length is greater than 0 | `OnPostAsync` |
| Danger alert "An error occurred during upload." | Written, not reachable from the current `try` body | `UploadError` |
| Saving or parsing the uploaded stream | Not implemented | Comment in `OnPostAsync` says processing would be added later |

## Tracker API

| Feature | Status | Evidence |
|---|---|---|
| `GET api/FileUpload/getTrackerData` | Current | `FileUploadController` |
| JSON list of tracker rows, unfiltered | Current | `FileUploadService.GetTrackerData` |
| Fields omitted from that JSON: `brand_group`, FY-1, RF1, audit columns | Current | Projection in `GetTrackerData`. `brand_group` exists on `TrackerModel` but is not assigned |
| `POST api/FileUpload/uploadFile` with string `filePath` | Current | Controller action. Not an `IFormFile` |
| Excel COM open of the first worksheet | Current | `UploadTrackerSheet` |
| Map columns 1–14 into `Imports.tracker` | Current | Same method |
| Skip rows before 9 and the last 8 used rows | Current | Loop bounds |
| Treat a hyphen in a numeric cell as zero | Current | `Text.Contains("-")` |
| Treat parentheses as a negative number | Current | Replace `(` and `)` and multiply by `-1` |
| Strip `%` on the two percent columns without scaling | Current | Columns 13 and 14 |
| Treat blank stock cover as zero | Current | Column 6 only |
| Append rows; do not replace the table | Current | `AddRange` then `SaveChanges`, no delete |
| Stamp user id `1` and `DateTime.Now` | Current | Entity initialiser |
| Success text and caught-error text both returned as HTTP 200 | Current | Service return plus `Ok(result)` |
| Swagger UI in Development | Current | `PRSA.API/Program.cs`, launch profile opens `swagger` |
| Call from the Razor page into this API | Not implemented | `PRSA.App.csproj` does not reference the API or the service. No `HttpClient` |

## Login

| Feature | Status | Evidence |
|---|---|---|
| Page at `/Login` | Current | `Login.cshtml` |
| Email and password inputs | Current markup, not posted as named fields | Inputs have no `name` and no model |
| Sign In posts to `/Index` | Current | `formaction="/Index"` |
| Credential check, session, or redirect after a real sign-in | Not implemented | `LoginModel.OnGet` only |
| Remember me, social login, forgot password, register | Commented out | `Login.cshtml` |
| Use of `Core.users` (`ad_token`, `role_id`, `active`) | Not implemented | Entity exists. No LINQ against `users` |

## Modelled data with no feature code

These tables were selected in EF Core Power Tools and generated under `src/dal/PRSA.DAL/DB`. No controller, service, or page reads or writes them.

| Table | Status | Notable columns |
|---|---|---|
| `Core.settings` | Scaffold only | `key_name`, `value` |
| `Core.users` | Scaffold only | `fullname`, `username`, `email`, `ad_token`, `role_id`, `active` |
| `Imports.le3` | Scaffold only | `sku_code`, `supersession`, `month`, `value` |
| `Imports.mapping` | Scaffold only | `wh`, `region`, `region2`, `bond_duty`, `item_no`, `rev_sa`, `rev_nam`, `check` |
| `Imports.master_data` | Scaffold only | `day`, `week`, `month`, `concat`. Audit column on the entity is `update_by` |
| `Imports.open_orders` | Scaffold only | `item_number`, `total_open`, `tracker`, `variance`. `tracker` is an `int`, and no FK is configured |
| `Imports.qlikview_sales` | Scaffold only | `item_no`, YTD volume fields, `supersession`, `variance`, `summary` |
| `Imports.sales_forecast` | Scaffold only | `sku_code`, `month`, `month_sales`, `value`, `processed` |
| `Imports.stock_balance` | Scaffold only | `code`, `item_no`, `format`, `unit`, `atp`, `supersession`, `sum_atp`, `tracker`, `variance` |

The web app registers `PRSAContext` and never injects it into a page. Provenance: **Implemented** in `src/app/PRSA.App/Program.cs` and the page models.

## Quality and delivery

| Feature | Status | Evidence |
|---|---|---|
| Bitbucket Pipelines SonarQube step on `master` | Current | `bitbucket-pipelines.yml` |
| Same step for branch `development` | Declared. Branch absent | YAML branch filter `'{development}'`. `git branch -a` showed only `master` |
| `dotnet build` in the pipeline | Current YAML | No `dotnet test` |
| Deploy, IIS profile, Docker, or release pipeline | Not in the repository | No publish profiles, Dockerfile, or deploy step |
| Automated tests | Not in the repository | No test project in the solution |
| Local Sonar helper scripts | Not in Git | Onboarding inventory on 2026-09-28 named `sonar-project.properties` and `sonarqube_scan.bat`. No history for those paths |

## Planned or commented behaviour

Comments that describe work not present in the executable path:

- `Index.cshtml.cs`: sheet names should be replaced with real logic; file processing is still to be implemented.
- `Index.cshtml`: DataTables options and AJAX load are commented out.
- `FileUploadService`: comment says each sheet is read. Code reads worksheet 1.
- `Login.cshtml`: remember-me and alternate sign-in methods are commented HTML.

These are **Inferred** as unfinished intent from comments, not as an approved backlog. No issue tracker link is in the repository.

## Recently changed

Last product code change is `20da76a` (2023-08-24): API, `FileUploadService`, `TrackerModel`, tracker context tweak. Later commits only add and edit `bitbucket-pipelines.yml` (`6d47763` on 2023-09-01, `2832986` on 2023-09-20).

The landing page replaced a large AdminLTE index in `3a4de40` (2023-08-24). The previous index is not the current page.

## Removed or superseded

| Item | What happened |
|---|---|
| `src/bl/PRSA.Services/Class1.cs` | Added in `ea57f0d`, deleted in `20da76a` |
| Original `Index.cshtml` (about 922 lines) | Replaced in `3a4de40` by the tabbed reporting page |
| Scaffold login copy (remember me, social buttons, register) | Commented in the login page that landed in `ea57f0d` and was lightly edited in `3a4de40` |

## Tests as a feature

No test project, no test step, and no fixture workbook are in the repository. Tracker import rules cannot be executed from this tree without SQL Server, a connection string, and Excel on Windows.
