--- name: Package-by-domain architecture description: New features must be organised as domain packages, not by type (no Admin/, Api/, Data/ etc.) type: feedback --- Always organise code package-by-domain, not package-by-type. **Why:** User explicitly requested the restructure on 2026-03-30. Package-by-type (Admin/, Api/, Data/, Frontend/, Model/, Roles/) was the initial scaffold but was replaced before any real features shipped. **How to apply:** - New domain → new directory under `src//` (e.g. `src/Availability/`, `src/Booking/`, `src/Auth/`) - All classes for a domain (value objects, repositories, admin controllers, REST endpoints, shortcode pages) live inside that directory under the sub-namespace `Unsupervised\Schedular\\` - Cross-cutting wiring that glues domains together (Plugin, AdminMenu, RestRegistrar, ShortcodeRegistrar, Schema) lives at `src/` root with namespace `Unsupervised\Schedular\` - Tests mirror the domain structure: `tests/Unit//` - Never create `src/Admin/`, `src/Api/`, `src/Data/`, `src/Frontend/`, `src/Model/`, or `src/Roles/` directories