<!-- generated by php artisan docs:split-brd from brd/BRD-Morvia-Project-Guide-en.md — edit the BRD, not this file -->

#### TRR-016 | Create course package (trainer)
**Source:** p.45–47 · **Actor:** trainer
- **Built as (TD-42):** `/trainer/packages` for independent trainers (an affiliated trainer's center owns the packages). A package is "bought" once a purchase is awaiting payment or paid; from then on it cannot be edited, only deactivated.
- **Purpose:** bundle several of the trainer's published courses and offer them at a total price lower
  than buying each separately. After creation the package appears in the trainee app's packages
  section, where trainees open it, view the included courses and enroll per the payment process.
- **Basic data:** name · description · image if any · status.
- **Included courses:** pick the courses to add from the list of courses available to add; each shows
  name · date · type · original price · status.
- **Price summary:** total of the included courses' prices before discount · final package price ·
  saving for the trainee (computed automatically as the difference).

| Field | Type | Required |
|---|---|---|
| Package name | text | Yes |
| Package description | long text | Yes |
| Package image | image | No |
| Included courses | multi-select | Yes |
| Original total price | computed | Yes |
| Package price | decimal | Yes |
| Package status | active / inactive | Yes |

- **Actions:** create package · add / remove a course (before saving).
- **Business rules:**
  1. A trainer builds packages from **their own courses only**.
  2. A trainer cannot add another trainer's course.
  3. A package must contain **more than one course**.
  4. The same course cannot be added twice.
  5. Only courses eligible by status are shown.
  6. Only **published and active** courses can be added, so a trainee never sees a package containing
     an unavailable course.
  7. Not allowed: rejected · under review · cancelled · completed when no longer open for enrollment.
  8. The original total is computed automatically from the selected courses.
  9. The trainer sets the final package price.
  10. **Package price < sum of the included courses' prices.** Example: 300 + 400 = 700; package 600;
      the trainee sees "Save 100".
  11. An inactive package is hidden from trainees and cannot be bought.
  12. Deactivating a package does not delete it or its past purchases.
  13. **No edits** are allowed to a package that trainees have already bought.
  14. The package data, price and included courses at purchase time are **kept as the transaction
      record** (snapshot).
- Packages are **not reviewed** before they are visible; both the **owner** and the **admin** can
  deactivate a package (DEC-09, C-§16). A package has a **start and end date** of sale (DEC-21).

**Acceptance, rules and screen notes citing TRR-016:**

- BR-ENR-05 — Price, package content and offer data are snapshotted at purchase; later edits never rewrite history. — TRR-016, TRR-021, ADM-036
- BR-PKG-01 — A package holds more than one published, active course of the same owner; package price < sum of its course prices. — TRR-016, CTR-012
- BR-PKG-02 — A bought package cannot be edited; deactivating it stops new purchases only; it is never hard-deleted. — TRR-016, ADM-013
- BR-CNL-10 — A package withdrawn from sale by its owner or the admin stays valid for past buyers, with no refund for that reason; a cancelled course inside a bought package leaves the package running, and its share is settled outside the system (C-§16, §17). — TRR-016, ADM-013, TRN-017
