Add Logbuch: project update blog with admin, media and API

Public archive with sidebar navigation, project pages, month archive,
search and entry pages with image blocks. Admin area for brands,
projects, post types, users, api clients, media and the entry editor
with drag and drop images, preview per audience, scheduling and
publish checks. Read and write API with bearer tokens, audience
scoping, idempotent creation, OpenAPI document and editorial guide.
Magic link login with configurable allowed domains, whole app behind
the session gate. 456 tests including design rule checks.
This commit is contained in:
Matthias Giesselmann
2026-07-31 21:33:42 +02:00
commit b90ff252d1
291 changed files with 43671 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
import { describe, expect, it } from 'vitest'
import { canTransition } from '~/domain/post-status'
import type { PostStatus } from '~/domain/types'
describe('canTransition', () => {
it('erlaubt den Weg vom Entwurf bis zur Veröffentlichung', () => {
expect(canTransition('draft', 'review')).toBe(true)
expect(canTransition('review', 'published')).toBe(true)
expect(canTransition('draft', 'published')).toBe(true)
expect(canTransition('draft', 'scheduled')).toBe(true)
expect(canTransition('scheduled', 'published')).toBe(true)
})
it('erlaubt Zurückziehen und Wiederaufnahme', () => {
expect(canTransition('published', 'archived')).toBe(true)
expect(canTransition('archived', 'draft')).toBe(true)
})
it('verbietet Sprünge zurück aus der Veröffentlichung in den Entwurf', () => {
expect(canTransition('published', 'draft')).toBe(false)
expect(canTransition('published', 'review')).toBe(false)
})
it('verbietet gleichbleibenden Status als Übergang', () => {
expect(canTransition('draft', 'draft')).toBe(false)
})
})
describe('canTransition deckt alle 25 Paare ab', () => {
const states: PostStatus[] = ['draft', 'review', 'scheduled', 'published', 'archived']
const expected: Record<PostStatus, PostStatus[]> = {
draft: ['review', 'scheduled', 'published', 'archived'],
review: ['draft', 'scheduled', 'published', 'archived'],
scheduled: ['draft', 'published', 'archived'],
published: ['archived'],
archived: ['draft'],
}
for (const from of states) {
for (const to of states) {
const allowed = expected[from].includes(to)
it(`${from} nach ${to}: ${allowed}`, () => {
expect(canTransition(from, to)).toBe(allowed)
})
}
}
})