# Features — theear (The Ear)

Evidence date: 2026-10-01. Source: `master` at `f1a82c841` (2023-08-10).

**Current** means the code is on `master` and a route or admin method can reach it. **Dormant** means the file or method exists and is not the path the active routes or comments describe. **Unknown** means the repo does not show whether it is still used in production.

## Current

### Public site

`Home` pages: index, home, home_new, individuals, educators, courses, course, search, teachers, pricing, classes, collaborators, musicians, jobs, social impact, about, demo, forum, contact, campaigns, instrument landings (drums, guitar, piano, electric bass, saxophone, trumpet), Earspace explainer and how-to, terms, privacy, cookies, beta terms is on `Home_olda` only (see Dormant).

Evidence: `application/controllers/Home.php`.

### Accounts

Registration, email verification, set password, forgot and reset password, learner login, admin login, admin TOTP, logout, profile update, splash screen.

Evidence: `Login.php`, `Home::login`, `Home::admin_login`, `Home::verify_email_address`, `Home::set_password`, `User_model::update_mfa`.

### Earspace and learner tools

Post-login redirect to Earspace. My courses, wishlist, cart, purchase history, messages, notifications, notes, dictionary-term search, mailing-list action, link preview, quiz submit, course progress, certificate route `certificate/(:any)` → `addons/certificate/generate_certificate`.

Evidence: `Login.php`, `Home.php`, `routes.php`. `application/controllers/addons/` contains Bundle, Course_analytics, and Course_bundles only. No `Certificate.php` under `application/`. The certificate route is present and its controller file is not.

### Enrolment and PayFast

Cart add/remove, level switch, free trial, 100% coupon checkout, PayFast checkout and return, cancel subscription, downgrade, refund course, invoices.

Evidence: `Home::handleCartItems`, `handleEnrolCartItems`, `switchCourseLevel`, `free_trial_payment`, `coupon_100_payment`, `payfast_checkout`, `payfast_payment`, `cancel_course_subscription`, `downgrade_course_subscription`, `refund_course`.

### Hearing practice and playgrounds

Admin and instructor hearing-content CRUD and ordering. Learner hearing status and facet status updates. Playground and facet pages. MIDI fields on hearing rows. Lesson tracking statuses `new`, `in_progress`, `completed`.

Evidence: `Admin::hearing_content`, `User::hearing_content`, `Hearing_model`, `Home::playground`, `Home::facets`, `db_updates/update.6.liam.sql`, `update.17.liam.sql` (`hearing_tracking`).

### Course bundles addon

Public bundle list, search, details, buy, my bundles, invoice, ratings. Stripe and PayPal checkout methods on the addon. Admin bundle CRUD and subscription report.

Evidence: `routes.php`, `addons/Course_bundles.php`, `addons/Bundle.php`.

### Course analytics addon

Enrolment chart body and about pages.

Evidence: `addons/Course_analytics.php`.

### Instructor tools

Web: courses, sections, lessons, quizzes, resources, sales report, payout settings, withdrawal, preview. API: login, profile, course and lesson CRUD, pricing, sales, payouts, withdrawals.

Evidence: `User.php`, `Api_instructor.php`.

### Admin operations

Dashboard, categories, courses, people (users, instructors, admins, testers, institution users, deactivated), enrol history, coupons and coupon CSV, affiliates, tickets, email templates and email report, frontend/payment/SMTP/instructor/theme settings, languages, revenue reports (admin, instructor, coupon, affiliate, subscriptions, free trials, no enrolment), PayFast purchases, credit notes, CloudFront invalidation, resource cleanup, permission assignment.

Evidence: `Admin.php`, `admin_permission.php`.

### Institutions

Create institution, attach users, pause and resume institution enrolments, progress and login reports.

Evidence: `Admin::institutions`, `institution_users`, `institution_progress`, `institution_logins`, `Institution_model`, `update.37.liam.sql`, `update.38.liam.sql`.

### Affiliates and coupons

Affiliate codes and commission percentage, payout table, coupon types Once Off, Special Promotion, Limited Months.

Evidence: `update.28.liam.sql`, `update.29.liam.sql`, `update.1.rachel.sql`, `Admin::coupons`, `Admin::affiliates`.

### Finance jobs and Xero

Daily PayFast transaction import, invoice generation, credit notes, subscription failure and cancellation, access revocation for 6- and 12-month outright, cancelled monthly, lower level, and 100% coupon. Xero OAuth views and manual journals.

Evidence: `cron_daily.php`, `cron_hourly.php`, `authorizedResource.php`, `Admin::xero_crons_authorization`, `xero_callback`, `run_xero_manual_journals_cron`.

### Lifecycle email

Check-in (day 3, no purchase and no login), still deciding (day 8, same), trial feedback (day 7), trial expiry warning (day 12), end of trial (day 14). Templates seeded for reset, verification, purchase, certificate, payment failure, subscription suspended, successful payment, account suspended.

Evidence: `cron_daily.php`, `update.1.rachel.sql`, `Email_model.php`.

### Learner mobile API

Token login and course, wishlist, lesson, quiz, progress, profile, and certificate-addon endpoints.

Evidence: `Api.php`, `TokenHandler.php`, `application/config/rest.php`.

### Deployment

`master` and `production` CodeDeploy pipelines. AppSpec destination `/usr/share/nginx/html`.

Evidence: `bitbucket-pipelines.yml`, `appspec.yml`.

## Dormant or leftover

### Home_old.php and Home_olda.php

Earlier `Home` controllers. `Home_old` still has Razorpay checkout and a `jitsi` method. `Home_olda` has `beta_terms`. Default routing uses `Home`, not these classes. They remain reachable if a client requests `home_old/...` or `home_olda/...`, because CodeIgniter maps the class name. Provenance: **Implemented, not the default controller**.

### Checker.php

Methods for classes, attendance, marks, parents, teachers, notices, and messages. That domain is a school ERP, not the instrument catalogue. No menu reference was confirmed. Provenance: **Implemented controller. Product use Unknown**.

### Install.php and Updater.php

Academy installer (purchase code, blank SQL, route rewrite) and updater. Provenance: **Implemented**. Whether they are still exposed on the server is an operations question.

### Stripe, PayPal, Razorpay

Still compiled into `Home`, `Payment_model`, bundle addon, and instructor payout methods. The daily money jobs call PayFast only. Provenance: **Implemented code, operational status Unknown**.

### bitbucket-pipelines-ftp.yml

FTP push on `master` using `git-ftp`. It is not the filename Bitbucket executes by default. Provenance: **Present file. Whether it was ever selected Unknown**.

### research/MIDI.js-master

Vendored MIDI.js examples and soundfonts. Not referenced from `Home` in the searches performed. Provenance: **In repository. Runtime use Unknown**.

### Academy certificate route

`routes.php` sends `certificate/(:any)` to `addons/certificate/generate_certificate`. No `Certificate.php` exists under `application/`. Provenance: **Route present. Controller file absent.**

## Planned

No roadmap, TODO product list, or issue tracker file was found. `Home` contains commented methods (`account`, `createBug`). Those are not a plan.

## Recently changed (shallow history only)

Visible commits run from 2023-03-03 to 2023-08-10. Later commits in that window:

- Pipeline variable and CodeDeploy key edits on `bitbucket-pipelines.yml` (several merges, tip `f1a82c841`).
- Instrument book links (`instrument-links-update`, March 2023 messages "as per Jacqui" / "per marco").
- Email report switched toward server-side datatable (`bug-119-emails`).
- Homepage, playground block position, iPad tweaks (`560-home-page-update`).
- Removal of log files from the repo.

Anything before 2023-03-03 is outside this clone's history.

## Removed

`8e6cd4b` message: "Remove log files from repo". No feature flag or menu label was found that names a removed product feature. `sonar-project.properties` and `sonarqube_scan.bat` were listed at task creation and are not in this tree. `sonar-scanner.bat` is present. Provenance of the missing Sonar files: **Unknown** (untracked on the scan host, or deleted before `f1a82c841`).
