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

#### TRR-015 | Threshold-start course ("starts when the minimum is reached")
**Source:** A-p.3–7, A-p.13–14, A-p.18 · **Actor:** trainer, training center
- **Goal:** create a course without a fixed date: it is announced and takes enrollments, and when the
  enrollees reach the required minimum the owner is notified to set the date. For providers who do not
  want to commit to a date before enough people sign up.
- **New field "Course start mechanism":** *fixed date* (existing flow unchanged: date, time, other
  execution data) · *after the required number is reached* (no date/time asked at creation).
- **Fields for the second case:**

| Field | Type | Required |
|---|---|---|
| Minimum to start | integer | Yes |
| Maximum seats | integer | Yes |
| Deadline for reaching the minimum | date | Yes (A-p.14, A-p.18) |

- **Creation journey:** create course → basic data → choose start mechanism → fixed date? yes: date and
  time; no: "starts after the number is reached" + minimum + total seats → complete course data →
  submit for review → admin review → approve → publish.
- **Admin sees in review:** start mechanism "starts after the number is reached", minimum, maximum
  seats, number of sessions, course type, the rest of the data.
- **Minimum reached:** the owner gets the notification *"The number required to start the course
  '{name}' has been reached. Please set the course date."*; the trainer screen shows the action **"Set
  course date"**: course date · start time · the other time data in the system → **Save date**.
- **System after the date is set:** update the course data; treat the course as having a fixed date;
  notify **all enrolled trainees**; show the date in course details, My courses and the ticket (when
  in-person and the hall data is complete).
- **In-person course (hall booked from a provider):** a final hall booking cannot be made without a
  date, so: minimum reached → trainer sets the date → searches a hall → sends the booking request
  (Pending → Accepted = external agreement → Booked = hall linked to the course) → course updated →
  enrolled trainees notified.
- **External course:** minimum reached → trainer sets the start date → adds the current / first
  session link → save → enrollees notified. The number of sessions is known in the course; the trainer
  updates the current session link when needed.
- **Business rules:**
  - The owner chooses between a fixed date and a minimum number of enrollments.
  - With "after the number is reached", date and time are not required at creation; the **minimum
    becomes mandatory** and must **not exceed total seats**.
  - Only **confirmed enrollments** count toward the minimum.
  - The trainee clearly sees that the date is not set yet and will be set after the minimum is reached
    (TRN-026).
  - On reaching the minimum the system notifies the owner, who can then set the date; all confirmed
    enrollees are notified when it is set.
  - In-person: hall booking/linking is completed after the date is set. External: the current session
    link is added/updated after the date is set.
  - **No separate waiting list.** This option is not a waiting-list system: the course is published and
    enrolled in normally; the system only defers setting the date until confirmed enrollments reach the
    owner's minimum.
- **Exception handling (A-p.13–14):**

| Situation | Handling |
|---|---|
| Minimum not reached | Course stays published, waiting for the minimum. |
| Minimum reached, trainer has not set the date | Trainer sees status **"Awaiting date"** and can be sent a reminder; a **deadline set by the admin** applies, after which the case is shown to the admin (ADM-032). |
| Minimum reached, no hall available | Date and place stay unconfirmed for trainees until the hall booking is complete. |
| Trainer set a date then wants to change it | Follows the rules for changing a published course's date, with enrollees notified (TRR-021). |
| Enrollments reach maximum seats | New enrollments stop; show "Seats full". |
| Trainer tries to set the date before the minimum | Blocked, unless the admin approves an exception. |
| Trainer wants to cancel the course | Submits a cancellation request; the course is cancelled only after admin approval (TRR-023). |
| Deadline passed (minimum not reached, or date not set) — **cancellation policy** | **No automatic action.** The admin either **extends the deadline** (the countdown updates) or cancels the course and the refund policy applies (C-§05, C-§06, ADM-032). |
| Minimum not reached for a long time | When the **deadline** passes without the minimum, the course is referred to the **admin** to decide whether to keep taking enrollments or cancel it. **No automatic cancellation** before the fate of paid enrollments is decided. |

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

- WF-05 — Threshold-start course — Publish without date → trainees enroll (confirmed count, countdown) → minimum reached → owner notified → set date (in-person: book hall; external: session link) → enrollees notified → ticket; deadline passed or date not set in time → admin decides — TRR-015, TRN-026, ADM-032, TRN-024
- BR-CRS-04 — Only confirmed enrollments count against seats and toward a threshold minimum. — TRN-012, TRR-024, TRR-015, CTR-011
- BR-CNL-03 — Nothing cancels a course automatically: not a passed deadline, a trainer subscription ending or a lost hall. At a passed threshold deadline the admin extends it or cancels (C-§05, §06, §15, §19, notes). — TRR-015, ADM-032, TRR-030
