f61929a5f0
- Add /fides route with Latin-only mode for all faith pages (rosary, prayers, individual prayers) - Add LA option to language selector for faith routes - Add Angelus/Regina Caeli streak counter with 3x daily tracking (morning/noon/evening bitmask) - Store streak data in localStorage (offline) and MongoDB (logged-in sync) - Show Annunciation/Coronation paintings via StickyImage with artist captions - Switch Angelus↔Regina Caeli in header and landing page based on Eastertide - Fix Eastertide to end at Ascension (+39 days) instead of Pentecost - Fix Lent Holy Saturday off-by-one with toMidnight() normalization - Fix non-reactive typedLang in faith layout - Fix header nav highlighting: exclude angelus/regina-caeli from prayers active state
25 lines
883 B
TypeScript
25 lines
883 B
TypeScript
import mongoose from 'mongoose';
|
|
|
|
const AngelusStreakSchema = new mongoose.Schema(
|
|
{
|
|
username: { type: String, required: true, unique: true },
|
|
streak: { type: Number, required: true, default: 0 },
|
|
lastComplete: { type: String, default: null }, // YYYY-MM-DD of last fully-completed day
|
|
todayPrayed: { type: Number, required: true, default: 0 }, // bitmask: 1=morning, 2=noon, 4=evening
|
|
todayDate: { type: String, default: null } // YYYY-MM-DD
|
|
},
|
|
{ timestamps: true }
|
|
);
|
|
|
|
interface IAngelusStreak {
|
|
username: string;
|
|
streak: number;
|
|
lastComplete: string | null;
|
|
todayPrayed: number;
|
|
todayDate: string | null;
|
|
}
|
|
|
|
let _model: mongoose.Model<IAngelusStreak>;
|
|
try { _model = mongoose.model<IAngelusStreak>("AngelusStreak"); } catch { _model = mongoose.model<IAngelusStreak>("AngelusStreak", AngelusStreakSchema); }
|
|
export const AngelusStreak = _model;
|