Hub 2.26.0: the Church App, demo scenarios and devotionals

The App installs from New install on app.<address>, with Accounts 1.9.0
first, and is in every product list and filter (installs, Updates).
Every product has demo data; a demo client loads a whole demo scenario
in one seed-scenario job (agent 1.7.0), and installs show whether they
are out of step with it. The Website's and App's .env from the Hub.

Devotionals: written or imported from CSV up to 3 months ahead in the
free translations (KJV, BSB), and GET /api/v2/devotionals for App
licences. An alert when an App's active-member band is above its tier.

Contracts 1.23.0 vendored. Migration 20261130120000_app_scenarios_devotionals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-30 22:24:28 +02:00
co-authored by Claude Opus 5.5
parent 9b551bf9ed
commit 16f69afa6f
34 changed files with 1395 additions and 62 deletions
+54 -1
View File
@@ -5,7 +5,60 @@ versions follow [Semantic Versioning](https://semver.org/).
## [Unreleased]
## [2.25.1] - 2026-11-27
## [2.26.0] - 2026-11-30
The Church App (crosscode-platform docs/APP-1.0-PLAN.md §6, §12). One migration
(`20261130120000_app_scenarios_devotionals`: `Customer.demoScenario`, `demoScenarioAt`,
`demoScenarioJobId`, `Deployment.demoScenario`, and the `Devotional` table). No API is removed.
Contracts 1.23.0 (vendored).
### Added
- **The Church App from New install**, on `app.<church's address>` (app.hope.co.za →
accounts.hope.co.za). It always signs in through the church's Accounts and takes its email and
WhatsApp from it, so a church without Accounts gets Accounts installed first (as for the Website
and Cross Events 3), and one whose Accounts is older than 1.9.0 is asked to update it, even when
the App's release notes don't say "requires". A `CCP-` licence on the Mustard Seed tier.
- **Load a demo scenario** on a demo client (customer → "Load a demo scenario"): one of the eight
demo churches (contracts `DEMO_SCENARIOS`) on every product the client has, in one
`seed-scenario` job (agent 1.7.0+): Accounts first (the church profile, logo and people), then
Cross Events, the Website and the App, skipping what isn't installed. The popup shows each
install it replaces, in order, and what stops it: not a demo client, an agent before 1.7.0, an
install on a release older than the scenario needs (Accounts 1.9.0, Events 3.8.0, Website 1.8.0,
App 1.0.0), installs under more than one short name, or a scenario already loading. Typing the
short name confirms it. The report's `loaded` / `skipped` go in the email; a failure says which
products are out of step. The customer shows the scenario last loaded and when; an install
shows "Scenario: …" or "Out of step with the scenario" (one product's demo loaded on its own).
`GET /api/admin/demo-scenarios`, `GET|POST /api/admin/customers/:id/scenario`, audited as
`demo_scenario_queued`.
- **Devotionals** (new page): Cross Code's devotionals for every App set to "From Cross Code".
Write and schedule them up to 3 months ahead in the free translations only (KJV, BSB; others
need their publisher's written permission), on a calendar of the days filled and empty, with a
warning for a passage over 25 verses. **Import CSV** checks every row first (contracts
`checkDevotionalCsv`: dates, required fields, a passage YouVersion can open, the translation,
days already filled, too far ahead) and imports the valid rows, skipping or replacing days
already filled; the template CSV downloads from the page. Admin API under
`/api/admin/devotionals`; audited as `devotional_created` / `_updated` / `_deleted` and
`devotionals_imported`.
- **`GET /api/v2/devotionals?from=YYYY-MM-DD`** for App installs (contracts
`hub.DEVOTIONALS_PATH`, `devotionalsReplySchema`): the next 3 months, with the install's licence
token as `Authorization: Bearer`. App licences only (`403 NOT_AN_APP`), active or in their grace
days (`403 LICENCE_INACTIVE`); a missing or forged token is `401 BAD_LICENCE`.
- **The App's tier**: an App whose active-member band (heartbeat `activeMembers90d`) is above its
licence's tier gets an alert (`tier_above`, info) saying which tier the annual review moves it to.
### Changed
- **Demo data for every product.** The App and Accounts can have a scenario church's demo loaded
on their own (agent 1.7.0+, App 1.0.0 / Accounts 1.9.0), and Cross Events has the eight scenario
churches next to its four profiles (Events 3.8.0+; `RELEASE_TOO_OLD` on an older one). One
product's demo on its own marks that install out of step with its customer's scenario.
- **An install's .env from the Hub for the Website and the App too** (the Website's on agent
1.6.0+, the App's on 1.7.0+), not only Cross Events and Accounts.
- **The App everywhere a product is listed**: New install, the installs list's product filter
(now from the products list), and the Updates tabs (the App's tab showed only once it had an
install).
No migration; no API is removed. Frontend only.