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:
@@ -0,0 +1,22 @@
|
||||
-- Hub 2.26.0: demo scenarios (APP-1.0-PLAN §12) and Cross Code's devotionals (§6).
|
||||
ALTER TABLE "Customer" ADD COLUMN "demoScenario" TEXT;
|
||||
ALTER TABLE "Customer" ADD COLUMN "demoScenarioAt" TIMESTAMP(3);
|
||||
ALTER TABLE "Customer" ADD COLUMN "demoScenarioJobId" TEXT;
|
||||
ALTER TABLE "Deployment" ADD COLUMN "demoScenario" TEXT;
|
||||
|
||||
CREATE TABLE "Devotional" (
|
||||
"id" TEXT NOT NULL,
|
||||
"date" TEXT NOT NULL,
|
||||
"title" TEXT NOT NULL,
|
||||
"passage" JSONB NOT NULL,
|
||||
"body" TEXT NOT NULL,
|
||||
"prayer" TEXT,
|
||||
"author" TEXT,
|
||||
"createdById" TEXT,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "Devotional_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX "Devotional_date_key" ON "Devotional"("date");
|
||||
@@ -74,6 +74,11 @@ model Customer {
|
||||
// installs can have demo data loaded.
|
||||
isDemo Boolean @default(false)
|
||||
demoSince DateTime?
|
||||
// Hub 2.26.0 (APP-1.0-PLAN §12): the demo scenario last loaded on its installs (contracts
|
||||
// agent.DEMO_SCENARIOS), when, and the seed-scenario job loading one now.
|
||||
demoScenario String?
|
||||
demoScenarioAt DateTime?
|
||||
demoScenarioJobId String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
licences Licence[]
|
||||
@@ -606,6 +611,9 @@ model Deployment {
|
||||
adminEmail String?
|
||||
// A demo site (2.4.0): only these can have their data replaced with demo data (seed-demo jobs).
|
||||
isDemo Boolean @default(false)
|
||||
// Hub 2.26.0: the demo scenario its data is from. A scenario load sets it; loading this product's
|
||||
// demo on its own clears it, so it shows as out of step with its customer's demoScenario.
|
||||
demoScenario String?
|
||||
status DeploymentStatus @default(installing)
|
||||
// The release it runs (from reports and heartbeats).
|
||||
version String?
|
||||
@@ -701,3 +709,21 @@ model Export {
|
||||
deletedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
// Hub 2.26.0 (APP-1.0-PLAN §6, contracts crosscode.devotional/1): Cross Code's devotionals, one per
|
||||
// day, written here up to 3 months ahead and fetched by Apps set to "From Cross Code"
|
||||
// (GET /api/v2/devotionals). Only the free translations (FREE_BIBLE_TRANSLATION_IDS).
|
||||
model Devotional {
|
||||
id String @id @default(uuid())
|
||||
// The day it's for, YYYY-MM-DD (shown from midnight in each church's timezone).
|
||||
date String @unique
|
||||
title String
|
||||
// { reference, location, translation, text } (contracts devotionalPassageSchema)
|
||||
passage Json
|
||||
body String
|
||||
prayer String?
|
||||
author String?
|
||||
createdById String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user