# Project plan — bitool_dotnet

Evidence date: 2026-10-19.

Source repository: `git@bitbucket.org:overdrive/bitool_dotnet.git`. `origin/HEAD` is `master` at `b958e154` (2023-11-15, Jaco Brits, "bitbucket-pipelines.yml edited online with Bitbucket"). That matches the task-creation snapshot.

This plan describes what is in Git. It does not decide which branch is production.

The task-creation path `~/projects/sonar_scan/repos/bitool_dotnet` was not on this machine. Evidence is a clone of the remote. The task-creation file list also named `sonar-project.properties` and `sonarqube_scan.bat`. Neither file is in Git on `master` or `develop` (`git log --all -- "*sonar*"` is empty).

There was no `bitool_dotnet/` directory in Silicon Ark before this set.

Related Silicon Ark sets, other repositories:

- `bitool_frontend/` documents `git@bitbucket.org:overdrive/bitool_frontend.git`. That frontend calls paths with the same names (`/getFilters`, `/getChartData`, and the table paths). It is a separate repository. Whether it still calls this API is **Unknown / Requires Confirmation**.
- `bi_tool_php/` documents PHP scripts that write a local database named `sawis_bitool`. This .NET solution does not reference that database name.
- `bi_tool_frontend_phase6/` documents branch `phase_6` of `bitool_frontend`.

## Branch reality

`master` and `develop` diverged at `037bae06` (2023-10-13, "Initial commit - adding solution").

| Branch | Tip | Date | Subject | Relation |
|---|---|---|---|---|
| `master` | `b958e154` | 2023-11-15 | bitbucket-pipelines.yml edited online with Bitbucket | Default. 6 commits. 4 commits not in `develop` |
| `develop` | `2223f18b` | 2024-02-22 | Merge branch 'develop' of bitbucket into develop (Dewald Stander) | 278 commits. 276 commits not in `master` |

`master` contains the solution shell: an ASP.NET Core API project, an empty `MapperDataModel`, an empty `IChartDataService` / `ChartDataService`, and `bitbucket-pipelines.yml`. It has no controllers, no SQL, and no React app.

`develop` contains the API, the chart and table services, and the React client. The behaviour in the rest of this set is **Implemented** on `develop` unless a section says otherwise. `master` does not implement it.

No other remote branches were returned by `git branch -a`.

Which branch is deployed is **Unknown / Requires Confirmation**. The React client on `develop` calls `https://biadmin.sawisonline.co.za/api/controller`. That host is not described in this repository.

## Product

**Inferred** from the HTML title, the npm package name, the contact link, and the queries: a SAWIS (SA Wine Industry Information and Systems) export-volume dashboard.

On `develop`:

- `ClientApp/public/index.html` title is "SAWIS Report".
- `ClientApp/package.json` name is "SAWIS BI", version `0.1.0`.
- The header links to `mailto:bi@sawis.co.za`.
- The favicon URL is `https://www.sawisonline.co.za//images/icon.ico`.

There is no README, PRD, or product charter in the source repository. Nothing on `master` states a product purpose.

## Objectives visible in the repository

Recovered from UI headings, controller routes, and service comments on `develop`. They are not a signed charter.

1. Show wine-export litres for a selected year, ending month, and reporting-period length.
2. Let a visitor filter by product type, country, package type, and cultivar.
3. Show overview charts and pivot tables, and download a table to Excel.
4. Compare the selected window with the same window one year earlier, and show a ten-year exports series.

## Scope

### On `develop`

In the running UI (`ClientApp/src/components/Home.js`, `Sidebar.js`, `Overview.jsx`, `Tables.jsx`):

- One page, route index only (`AppRoutes.js`).
- Sidebar filters and an Apply action.
- Overview tab: litre totals, five charts.
- Tables tab: five pivot tables, each with an Excel download (`PivotTable.jsx`).

In the API (`src/api/sawis_bi_tool.API`):

- Filter lookup.
- Chart and table queries against MySQL.

Out of this repository, confirmed by what was read:

- A data-access project. The solution has a folder named "4. DAL" and no project under it (`sawis_bi_tool.sln` on `develop`).
- User accounts, login, and roles. No authentication middleware is registered.
- A schema, migration, or seed for the MySQL database.
- A deployment pipeline. `bitbucket-pipelines.yml` runs a SonarQube scan and `dotnet build`. It does not publish or deploy.
- The process that loads `export_data` / `export_data_qa`.

### On `master`

The solution compiles as two projects (`sawis_bi_tool.API`, `sawis_bi_tool.Services`) with no HTTP actions. `Program.cs` maps controllers and registers `IChartDataService`, and the `Controllers` folder is an empty MSBuild folder include.

## Architecture

**Implemented** on `develop`.

```text
Browser (Create React App, "SAWIS BI")
  fetch POST/GET
  https://biadmin.sawisonline.co.za/api/controller
        |
        v
sawis_bi_tool.API  (ASP.NET Core, net7.0)
  ChartDataController, FilterController, TableDataController
        |
        v
sawis_bi_tool.Services
  ChartDataService, FilterService, TableDataService
        |
        v
MySQL connection string name "SAWIS"
  tables export_data_qa (active in source),
         product_type_lookup, country_group_lookup
```

The React app is also hosted as an ASP.NET Core SPA project, `sawis_bi_tool.react`. Its development proxy only forwards `/weatherforecast` to the SPA host. Chart and filter calls do not use that proxy. They use the hard-coded `biadmin` host. A commented alternative is `https://localhost:7003/api/controller`.

`sawis_bi_tool.react` still contains the ASP.NET React template `WeatherForecastController`. The product UI does not call it.

## Milestones visible in history

These are commit clusters on `develop`, not a project plan.

| When | What the commits describe |
|---|---|
| 2023-10-13 | Solution on `master`. React project and `develop` branch created |
| 2023-10-15 to 2023-10-16 | Filter and chart APIs, dashboard boilerplate |
| 2023-10-17 to 2023-10-20 | Year-on-year, exports, cultivar chart, CORS, publish folders, command timeouts |
| 2023-10-23 to 2023-11-01 | Tables, Excel export, ECharts, filter fixes |
| 2023-11-15 | `master` pipeline file only. `develop` is not updated that day |
| 2024-02-22 | Last `develop` commit, a merge of `develop` into itself |

No milestone dates, owners, or remaining backlog are written down.

## Current status

| Item | State | Evidence |
|---|---|---|
| Default branch | `master`, skeleton | `origin/HEAD`, file tree |
| Working dashboard | On `develop`, last commit 2024-02-22 | file tree and services |
| Active fact table in source | `export_data_qa`. `export_data` is commented and labelled LIVE | `ChartDataService`, `FilterService`, `TableDataService` |
| Connection string value | Not in Git | `*.json` is gitignored; no `appsettings` commit exists |
| Tests | One Create React App render test. No API tests | `App.test.js` |
| CI | SonarQube begin, `dotnet build`, SonarQube end, on `master` and `develop` | `bitbucket-pipelines.yml` |
| Planned work | None written in the repository | no TODO file, no issues in Git |

## Known dependencies

| Dependency | Evidence | Notes |
|---|---|---|
| .NET 7 SDK | `TargetFramework` `net7.0`, pipeline image `mcr.microsoft.com/dotnet/sdk:7.0` | Whether this runtime is still in vendor support is **Unknown / Requires Confirmation** |
| MySQL, connection name `SAWIS` | `MySqlConnector` 2.2.7, `GetConnectionString("SAWIS")` | Host, database name, and credentials are not in Git |
| Node.js and npm | SPA project runs `npm install` / `npm start` on build and publish | Version is not pinned |
| SonarQube | pipeline variables `SONAR_TOKEN`, `SONAR_HOST_URL` | Values are not in Git. Project key `overdrive_bitool_dotnet_AYvU0vSvT-jCdK_QYjRZ` |
| Public host `biadmin.sawisonline.co.za` | `filterStore.js` | Ownership and whether it still serves this build are **Unknown** |
| Google Analytics `G-1RFV9ZJG9K` | `ClientApp/src/index.js` | Initialised after 3 seconds via `ga-4-react` |

## Human confirmation

- Whether `develop` or `master` is the branch that should be treated as the product.
- Whether `https://biadmin.sawisonline.co.za` still runs this API, and which table it reads (`export_data` or `export_data_qa`).
- Where the MySQL connection string is stored, and which database it points at.
- Whether `bitool_frontend` replaced this embedded React app.
- What `sonar-project.properties` and `sonarqube_scan.bat` were on the scan host. They are not in Git.
