Programs
Multi-week training programs: how a member starts one and follows its schedule, and how staff build them.
For the Full Stack package
What a program is
A program is a plan over several weeks: a name and description in English and Arabic, a picture, a number of weeks and sessions per week, a level and a focus. Each week lists its days, and each day is a workout from the catalogue or a rest day. The seed ships four programs, and the demo member is in week 6 of 8 of Strength Foundation.
Following a program
- The Programs tab of Workouts (
/en/dashboard/workouts?view=programs) lists every program, with the active one on top showing its current week and how far along it is. - Starting a program replaces the active one and begins at week 1. Starting the same one again stops it.
- The schedule shows the current week of the active program, day by day.
Building programs
Staff with fitness.manage build programs under Content, then Programs (/en/dashboard/content/programs). The list filters by level, number of weeks and sessions per week, and searches by name, description, focus and slug.
- A day names a workout by its slug, or is a rest day. A week cannot list the same day twice.
- Saving replaces the whole schedule with the one in the form.
- Deleting a program also ends every member's enrolment in it. A workout that a program day still schedules cannot be deleted.
The program routes
| Method | Path | Permission | What it does |
|---|---|---|---|
GET | /api/fitness/workouts/programs | fitness.view | Every program, the active one with its week and progress, and its schedule. |
POST | /api/fitness/workouts/programs/:slug/enroll | fitness.edit | Starts the program at week 1, or stops it when it is already active. |
GET, POST | /api/fitness/manage/programs | fitness.manage | A page of programs (page, page_count, search, order, level, weeks, sessions_per_week), or a new one. |
GET, PATCH, DELETE | /api/fitness/manage/programs/:id | fitness.manage | One program, a change, a delete. |
An unknown workoutSlug on a day answers 400 workout_unknown, a day listed twice in a week 400 days_duplicate.