feat(content): add catalogue review metadata

Add reversible review states, audit history, and super-admin controls for catalogue entities without changing current client visibility.

Stage 30 high-risk production packs for archival review, cap generated content at non-explicit language, and preserve a checksummed pre-change production catalogue snapshot.
This commit is contained in:
jjbrunton committed 2026-08-28 11:32:55 +01:00
1 parent b43804d8fd
commit 94c76535a4
30 files changed
+46906 -128

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
import type { ContentReviewStatus } from '@sauci/shared';
import { auditedSupabase } from '@/hooks/useAuditedSupabase';
export { CONTENT_STATUS_LABELS } from '@/lib/contentReviewStatus';
export type ReviewableContentTable =
| 'categories'
| 'question_packs'
| 'questions'
| 'dare_packs'
| 'dares';
export async function updateContentReviewStatus(
table: ReviewableContentTable,
id: string,
status: ContentReviewStatus,
reason: string,
): Promise<void> {
const normalizedReason = reason.trim();
if (!normalizedReason) {
throw new Error('A review reason is required');
}
const { error } = await auditedSupabase.update(table, id, {
content_status: status,
content_review_reason: normalizedReason,
});
if (error) throw error;
}