# Features — lifechoiceMVC_net

Evidence date: 2026-10-10.

Source: `master` at `69783e2` (2019-12-03). One commit, so this file cannot separate "recent" from "original" by git history. Dates below come from comments, migration names, and the assembly copyright.

Status words:

- **Current** — code path is reachable from a controller that still compiles in this tree.
- **Template** — generated ASP.NET Identity or project-template behaviour, still present.
- **Schema only** — tables or seed data with no MVC use found.
- **Commented / unused** — left in source and not called by the live menu or action.
- **Not in git** — named at task creation, absent from `69783e2`.

## Current

| Feature | What it does | Where |
|---|---|---|
| Public brochure pages | Home, About, Terms, Contact. FAQ action exists and is not in the anonymous menu | `HomeController`, `Views/Home`, `Views/Shared/_Layout.cshtml` |
| Practice self-registration | Anonymous register link. Creates user, practice (`ActiveIndic` false), practice manager, contacts. Emails the user and `verification@healthchoice.co.za` | `AccountController.RegisterPractice`, `_LoginPartial.cshtml` |
| Email confirmation | Link marks the person email contact validated and confirms the Identity email. Account type 7 also sets practice `ActiveIndic` | `AccountController.ConfirmEmail` |
| Practice activation | Anonymous activate/decline links set or clear `ValidatedDate`. Activation of account type 7 emails the user | `AccountController.ConfirmAccount` |
| Sign-in gate | Password sign-in, then person and activated-practice checks, session practice id, site-admin redirect | `AccountController.Login` |
| Practice menu | Practice admins (session `practiceadmin`) get practitioners, patients, administrators. Other signed-in users get patients | `_LoginPartial.cshtml` |
| Practitioner invite | Email from the practice with a one-time registration link (GUID on `PracticeInvite`) | `PeopleController.InvitePractitioner` |
| Practitioner registration | From the invite. HPCSA, discipline, SA ID length, duplicate checks | `AccountController.RegisterPractitioner` |
| Patient maintenance | List and edit patients for the session practice, including medical scheme fields | `PeopleController.IndexPatient`, `EditPatient` |
| Practitioner maintenance | List and edit practitioners, discipline and HPCSA fields | `PeopleController.IndexPractitioner`, `EditPractitioner` |
| Practice administrator maintenance | List and edit practice managers and practice admins | `PeopleController.IndexAdminPerson`, `EditAdmin` |
| Site user administration | List, create, edit, delete Identity users. Add and remove roles. Support-user registration | `SiteAdminController`, `CommonController` |
| User type and user role CRUD | SiteAdmin only | `UserTypeController`, `UserRoleController` |
| Network affiliation CRUD | Partner initiative list used by practice registration | `NetworkAffiliationsController` |
| Discipline dropdown | External API list filtered by lookup `alloweddisciplines` | `HCLocalService.GetDisciplines`, `HCWebService` |
| Password reset | Email link when the account exists and email is confirmed | `AccountController.ForgotPassword` |
| Cookie authentication | Application cookie, 30-minute security-stamp revalidation, external-login cookie, two-factor cookies | `Startup.Auth.cs` |
| en-ZA JSON dates | ISO dates, unspecified timezone, culture `en-ZA` on the JSON formatter | `Global.asax.cs` |

## Template features still in the project

| Feature | Notes | Where |
|---|---|---|
| Account manage page | Change password, phone, two-factor, external logins. Menu link commented out | `ManageController` |
| Generic `Account/Register` | Still creates an Identity user and sends confirmation. Does not create a practice or person. GET prefills `AccountType` 4. Public Register link does not point here | `AccountController.Register` |
| Facebook login | Configured. Other social providers commented out | `Startup.Auth.cs` |
| Two-factor | Phone and email providers registered. SMS send does nothing | `IdentityConfig.SmsService` |
| Project readme | Visual Studio "Congratulations" page | `Project_Readme.html` |
| Bundling | Bootstrap, jQuery, validation, input masks | `App_Start/BundleConfig.cs` |

## Legacy provider feature, still compiled

These screens belong to the earlier provider record (`provider`, `user_link`) rather than the 2019 practice/person model.

| Feature | Status | Where |
|---|---|---|
| Provider list, details, full edit, delete | Current as code. Not linked from the layout menu that was read | `ProviderController` |
| Short provider create and edit | Current as code. `CreateShort` adds role keys `"3"` and `"7"`. The post-register redirect to `CreateShort` is commented (2019-08-22) | `ProviderController.CreateShort` |
| Provider registration create | Current as code. Also adds role keys `"3"` and `"7"` | `ProviderRegistrationController.Create` |
| Terms and conditions action on the provider controller | Current as an action | `ProviderController.TermsAndConditions` |
| Home account redirect by account type | Action exists. Menu link commented out. Type 4 goes to `Provider/Edit` | `HomeController.AccountRedirect` |
| 48-hour contract message on the home page | Shown for `AccountType == 4` when the role check fails. Fax and `contracts@healthchoice.co.za` | `HomeController.Index` |

## Schema only

Present in `HCDB` SQL project. No C# query against these tables was found in the MVC project.

| Area | Tables or seed | Notes |
|---|---|---|
| Provider contracting wizard data | `prov_practice`, `prov_unit`, `prov_company`, `prov_bank_details`, `prov_contract`, `prov_network`, `prov_ipa`, addresses | Parallel to, and different from, EF `Practice` |
| Patients and clinical data | `patient`, diagnoses, medications, conditions, comorbidities, measurements | EF patient is a `Person` plus `PersonField` |
| Authorisations | `auth_main`, `auth_diagnosis`, `auth_product`, `auth_notes` | Process type 3 seed describes sending an auth to a scheme |
| Treatments | `treatment_main`, facility, product, service | No controller |
| Schemes | `scheme`, `scheme_option`, `scheme_type` | MVC patient screen uses lookup `medschemes` instead |
| Process engine | `process`, `process_step`, `process_type`, `process_status`, `process_user` | Seeded steps for four process types |
| Geography and banks | `geo`, `banks`, `branches` | Matching `HCWebService` methods are commented out |
| Logging database | `HCLogDB` (`Log`, `Category`, `ELMAH_Error`, write procedures) | Project is not in the `.sln`. Web `.csproj` has no reference |

`HCUserDB` tables (`AspNetUsers` and related) match ASP.NET Identity and are used.

## Commented or unused in the running menu

| Item | Evidence |
|---|---|
| User Admin, Role Admin, Prov Admin, Logs menu items | Commented in `_Layout.cshtml` |
| My Account and Manage menu items | Commented in `_LoginPartial.cshtml` |
| `HCWebService` methods for countries, provinces, cities, suburbs, banks, diagnoses, ICD, NAPPI | Entire methods commented |
| `PersonPersonType` entity | Dropped by migration `20190910b`. DbSet left commented in `HCDBEntities` |
| Test banner "THIS IS A TEST!" in confirmation mail | Commented. `EnvironmentSetting` is still `TEST` |
| Sign-in immediately after `Account/Register` | Commented 2019-08-22 |
| `Globals.practiceId` | Commented in `Global.asax.cs` |

## Lookup data shipped in SQL versus lookup names the site asks for

Seeded in `HCDB/PostDeployScripts/Script.LookupTableData.sql`: `id_no_type`, `gender`, `comorbidity`, `entitytype`, `PDI`, `title`, `auth_process_status`, `auth_scheme_status`, `auth_type`, `bbbee_status`, `business_type`, `company_types`, `country`, `dispensing_type`, `field_data_type`, `form_element_type`, `patient_address_type`, `phone_number_type`, `product_frequency`, `product_type`, `provider_address_type`, `provider_registration_process`, `provider_speciality_type`.

Queried by MVC and **not** present in that seed file:

| Lookup type | Used by |
|---|---|
| `alloweddisciplines` | Discipline filter |
| `titleid` | Practice and people title dropdowns |
| `medschemes` | Patient medical scheme dropdown |

`title` (seeded) is used by the legacy provider screens. `titleid` (not seeded) is used by practice registration and people. Empty dropdowns are the result if those rows are not loaded some other way. **Requires Confirmation.**

## Planned

No roadmap, issue list, or TODO file was found. Comments that describe intended follow-up, not a plan:

- `AccountController.Register` GET says "remove this after testing" above the `AccountType = 4` prefill.
- `RegisterPractice` GET has the same "remove this after testing" comment.
- `SendRegistrationEmail` contains a commented alternate recipient.

These are not approved backlog items.

## Removed or replaced inside the 2019 model

| Change | Evidence |
|---|---|
| `PersonPersonType` join table removed; `PracticePerson` points straight at `PersonType` | Migration `201909101855042_20190910b` |
| EF automatic migrations turned on | `Migrations/Configuration.cs` |
| Practice manager date of birth no longer collected; stored as 1900-01-01 | `RegisterPractice` |

`HCUserDB/oldtables/sql for deleted tables` exists. The file name says tables were deleted. The script body was not treated as a current requirement.

## Not in the git tree

`sonar-project.properties` and `sonarqube_scan.bat` were listed when OVER-186 was created. They are not in commit `69783e2`. SonarQube scanning is **not** a feature of this commit.

## Tests

No test project, no automated test files, and no CI definition were found.
