# Project plan — SHOU-1 (The Shoulder Practice)

Evidence date: 2026-10-04.

Source repository: `git@bitbucket.org:overdrive/shou-1.git`.

Inspected revision: `main` at `30a710c` (2026-09-22, Renier van Rooyen, "Merged in Bugfixes-on-security-enhancements (pull request #1)").

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

No formal project plan existed in the source repository or in `silicon_ark/SHOU-1/` before this file. The only product-facing README in the tree is `tools/password-migrate/README.md`, which covers password migration, not the practice system as a whole.

## Product

**SHOU-1** is a tenant of the **Palette / Evolution Software Unified Framework** (assembly product name "Evolution Software Framework", company "Evolution SoftWare" in `library/Properties/AssemblyInfo.cs`).

The tenant brand in the site fork is **The Shoulder Practice**, a Cape Town orthopaedic shoulder-surgery practice. `core_custom/SHOU-1/Core.master` sets the page title to "The Shoulder Practice | Cape Town | Orthopaedic Surgeon" and the meta description names Dr Christelle van der Watt as a shoulder-surgery specialist based in Milnerton and Claremont. `core_custom/SHOU-1/Web.config` sets `website` to "The Shoulder Practice SHOU-1 DEV" and the outbound From address to `no-reply@theshoulderpractice.net`. Login and registration pages use `images/admin/TSP_login_sml.png`.

`business/classes/xSurfaceCustomMethod.cs` loads an `oMedicalPractice` row whose `name` is "The Shoulder Practice". Billing comments in `business/classes/xDebtors.cs` refer to that practice as TSP.

What the letters SHOU expand to is **Unknown / Requires Confirmation**. The code uses `SHOU-1` as the tenant `setup.code` and as `oUser.customerCode`.

The same git repository also contains other tenant trees and scripts (`core_custom/GLOB-1`, `core_custom/GLOB-3`, `data/Scripts/REAP-1`, `data/Scripts/CAPI-1`, and others). Sonar analysis excludes the GLOB forks (`sonar-project.properties`). Those trees are not the SHOU-1 product. Whether they are still deployed from this repository is **Unknown / Requires Confirmation**.

## Branch reality

Default branch is `main`. `HEAD` at inspection is `30a710c`. Visible history on `main` is 18 commits, from two "Initial commit" revisions on 2025-03-05 through the security-enhancement merge on 2026-09-22.

SQL scripts under `data/Scripts/SHOU-1/` include filenames dated 2020 (`SHOU-1_insert_new_open_surgery_type_11022020.sql`, `SHOU-1_update_place_of_service_28042020.sql`, `SHOU-1_update_referring_doc_num_01042020.sql`). Comments in billing and login code cite dates in 2016 and 2018. The practice system is older than the git history in this clone. How the repository was cut from the earlier Evolution/Palette codebase is **Unknown / Requires Confirmation**.

| Commit | Date | What the subject records |
|---|---|---|
| `dbe2f84`, `8d6a69c` | 2025-03-05 | Initial commit (two commits) |
| `1318028` | 2026-02-25 | Tariff `0083` (ultrasound equipment): modifier lines are not added when posting |
| `cee89a8` through `745afc8` | 2026-07-06 to 2026-07-13 | `.env` configuration, BCrypt passwords, password policy, login lockout, user deactivation, central auth catalog, CodeDom deploy, removal of committed Google client secrets, Sonar project file |
| `1610774` | 2026-09-02 | Debtors assisted report defaults to today; `MedicalSchemeDisplay`; surface-control backup ignore; async postback error handling |
| `e212c77`, `ef88b7a` | 2026-09-09 | Calendar week alignment and overlap/recurring event fetch |
| `64bb0e0`, `30a710c` | 2026-09-22 | Enquiry links for deleted history and unprocessed remittance advices; surface drawing (jSignature); security-enhancement merge (pull request #1) |

## Scope in the repository

In scope of what is present for tenant SHOU-1:

- ASP.NET Web Forms site `core_custom/SHOU-1` (public site, patient pages, admin back office, medical reference data, sales page).
- Upstream web template `core-dev`, described in `sonar-project.properties` as a manual fork source with no auto-sync into `core_custom/SHOU-1`.
- Class libraries `library` (`framework_library.dll`) and `business` (`framework_business.dll`).
- WCF site `service` (`framework_service.svc`).
- SQL scripts, especially `data/Scripts/SHOU-1/`, plus a thin SSDT project `data/data.sqlproj`.
- Batch console `tools/scheduler` (campaigns, MediSwitch, imports) and WinForms launcher `SchedulerTool`.
- Operator tools: `tools/password-migrate`, `tools/constructor`, `tools/dataImporter`, `tools/exporter`.
- Tenant-specific clinical UI `core_custom/SHOU-1/controls/surface_custom/SurgicalNotes_*`.
- Prebuilt site snapshots under `publish/SHOU-1` and `publish/service`.
- Version bundles `release/1.0.0.1` and `release/1.0.5` (`files.zip` and `scripts.zip` in each).
- SonarQube project key `overdrive_shou_1` (`sonar-project.properties`), with a comment that the scan host is `scan.appmonitor.co.za`.

Out of scope of evidenced SHOU-1 behaviour, or present without a demonstrated SHOU-1 caller:

- `tools/CAPI.Custom` and `tools/CEP` (Entity Framework quote/purchase-order tooling for a CAPI catalog).
- `mobile` (a class library whose project file references a Xamarin asset and contains no application screens).
- The solution entry named `core` in `SHOU-1.sln`, which points at `http://localhost:45935`. No `core/` folder exists in the tree.
- Which Palette modules are switched on for this practice. The admin menu reads `oModule` and the user's module list from the database. That data is not in git.

## System architecture

```text
Browser
  → core_custom/SHOU-1 (ASP.NET Web Forms, Telerik, session)
       → framework_business.dll + framework_library.dll
            → SQL Server catalog Framework_SHOU-1 (tenant data)
            → SQL Server catalog Framework_EVOL-1 (central users and password hashes)
       → WCF client → service/framework_service.svc (dynamic data calls, version files)

tools/scheduler (console, outside IIS)
  → same catalogs
  → MediSwitch SOAP gateways
  → SMTP, SMS, optional Google Sheets
```

`core-dev` is the shared web template. `core_custom/SHOU-1` is the deployed tenant fork. Tenant rules that are not in the fork live in `business/` and branch on `handler.ReturnSetup().code == "SHOU-1"`.

Provenance: **Implemented** layout. The runtime hostnames, IIS bindings, and which catalog is production versus QA are **Unknown / Requires Confirmation**. The committed `Web.config` sets `WebAddy` to `http://localhost:21904` and points MediSwitch at the QA gateway URLs. Live MediSwitch URLs are present only as comments.

## Major components

| Component | Role |
|---|---|
| `core_custom/SHOU-1` | Tenant web site. Public canvas, login, registration, patient info redirect, admin modules, medical master data, enquiry/billing, calendar, surgical-notes surfaces |
| `core-dev` | Upstream Palette web template. Not auto-synced with the tenant fork |
| `library` | Data access, SMTP/SMS, payments client, environment loading, exceptions, video conversion helper |
| `business` | Users, passwords, surfaces, debtors, calendar search, MediSwitch-related actions, Google Sheets helper, document/letter generation |
| `service` | WCF service: `ProcessInteraction`, `GetVersion`, `SaveVersion` |
| `data` | SQL scripts and an SSDT project shell |
| `tools/scheduler` | Palette batch: campaigns, loyalty email hour gate, transaction lock, MediSwitch, surface import, Google Sheet import |
| `tools/password-migrate` | One-way move of legacy TripleDES passwords to BCrypt for `customerCode = 'SHOU-1'` |
| `components` | Compiled third-party and framework DLLs consumed by the web sites |
| `publish` | Checked-in published copies of the SHOU-1 site and the service |
| `release` | Two numbered zip bundles (`1.0.0.1`, `1.0.5`) |

## Milestones visible in this repository

There is no milestone document in the tree. The following phases are named in code comments and in `tools/password-migrate/README.md`. They describe work already represented by scripts and classes. They are not a forward roadmap.

| Phase label in the tree | What the code and scripts show | Status in git |
|---|---|---|
| Password storage (README: Phase 3) | `pal_UserPassword` on the central catalog, shared views on the tenant, BCrypt hashes, legacy cipher still accepted on login | Scripts `SHOU-1_3.0.01` through `SHOU-1_3.0.05`; `PasswordService`; migration console |
| Password policy (comment: Phase 4) | Length, character classes, denylist, email-local-part check | `PasswordPolicy.cs`; registration, reset, and admin user screens |
| Login lockout and deactivation | Failed-attempt counter; `isDeactivated` on central `pal_User` | Scripts `SHOU-1_3.0.06` through `SHOU-1_3.0.08`; admin user actions |
| Secrets out of git | `.env.example`, `.gitignore` for `.env`, Google credentials, and `business/client_secrets.json` | Commits on 2026-07-09 |
| Calendar visibility | Overlap and recurring series included in the visible week range | Commits on 2026-09-09 |
| Enquiry access | Link buttons for deleted billing history and unprocessed remittance advices | Commit on 2026-09-22 |

No issue, branch, or comment in this repository states a next milestone. Planned work is **Unknown / Requires Confirmation**.

## Known dependencies

- Windows / IIS hosting for the Web Forms site and the WCF service. **Inferred** from `Web.config`, `system.web`, and the website project type. The IIS site definition is not in the repo.
- .NET Framework 4.8 for the site compilation target (`core_custom/SHOU-1/Web.config`). `httpRuntime targetFramework` in the same file is `4.6`.
- SQL Server. Catalog names in `.env.example`: `Framework_SHOU-1` (tenant), `Framework_EVOL-1` (central auth). Optional `Framework_REAP-1` is commented as a secondary string.
- NuGet packages restored before build (comment in `.env.example`): BCrypt.Net-Next 4.0.3 and Microsoft.CodeDom.Providers.DotNetCompilerPlatform 4.1.0, plus the packages under `packages/`.
- Telerik Web UI assemblies under `components/` (handlers registered in `Web.config`).
- MediSwitch SOAP gateways (QA URLs active in the committed config; live URLs commented).
- SMTP settings and SMS credentials from `.env` (`SMTP_*`, `SMS_USERNAME`, `SMS_PASSWORD`). SendEasy SOAP client endpoint `http://sms.netgen.co.za/SMS_V2.asmx` is in the tenant `Web.config`.
- Optional Google service account file named by `GOOGLE_SHEETS_CREDENTIALS_FILE`.
- SonarQube scanner configuration in `sonar-project.properties`. The pipeline that invokes it is **Unknown / Requires Confirmation**. `BuildProcessTemplates/` holds legacy TFS 2011 XAML definitions. No Bitbucket Pipelines file was found.

## Current project status

**Implemented** and present on `main`: a full Palette tenant site for The Shoulder Practice, with clinical surfaces, medical-aid billing (MediSwitch, debtors, enquiry), a public/patient web path, and a 2026 security pass (BCrypt, policy, lockout, deactivation, secrets moved to `.env`).

The committed web configuration is a **development** profile: localhost `WebAddy`, `website` text ending in "DEV", `compilation debug="true"`, and MediSwitch QA endpoints. Whether production uses a different config transform is **Unknown / Requires Confirmation**. No `Web.Release.config` was identified as the production source of truth during this inspection.

There is no automated test project in `SHOU-1.sln`. `tools/CEP/CEP.ConsoleTests` is a manual proof-of-concept runner for the CAPI quote library, not a SHOU-1 test suite.

## Implementation plan

No forward implementation plan is stored in the repository. The build notes that are stored are in `.env.example` and `tools/password-migrate/README.md`:

1. Copy `.env.example` to `.env` at the repo root (or set `ENV_FILE`). Do not commit `.env`.
2. `nuget restore SHOU-1.sln`.
3. Build `library` and `business`. AfterBuild copies `framework_*.dll`, BCrypt, Newtonsoft, and CodeDom into `core_custom/SHOU-1/Bin`. Alternatively run `core_custom/SHOU-1/deploy-codedom.ps1`.
4. Apply `data/Scripts/SHOU-1/` in the order the password-migration README states, against the central catalog and the tenant catalog. The tool does not run the SQL itself.
5. Run `tools/password-migrate` when legacy TripleDES passwords must move to BCrypt (`--dry-run` is supported).
6. Host `core_custom/SHOU-1` (or the snapshot in `publish/SHOU-1`) and `service` on IIS, with the repo-root `.env` available to the process.
7. Schedule `tools/scheduler` outside the web app. `Global.asax` comments say MediSwitch delayed processing on the web cache callback is commented out and the scheduler owns that work.

## Human confirmation

1. Production URL, and whether the public site is `theshoulderpractice.net`, `SHOU-1.mypalette.co.za` (the scheduler builds `http://{setup.code}.mypalette.co.za`), or another host.
2. Which Palette modules are enabled in `Framework_SHOU-1` for this practice.
3. Whether `core_custom/GLOB-1`, `core_custom/GLOB-3`, and the non-SHOU script folders are still in scope for this repository.
4. Whether the committed `Web.config` (QA MediSwitch, debug compilation, localhost) is what production runs.
5. What `release/1.0.0.1` and `release/1.0.5` correspond to, and whether they are still shipped.
6. The next product milestone, if any. None is written down in this repository.
