feat: DB backend and API implemementation

This commit is contained in:
Robert Wartenberg committed 2026-08-28 10:13:55 +02:00
1 parent 39b891cd63
commit a78e84515a
14 files changed
+955 -652

No files matched your search

@@ -0,0 +1,24 @@
import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import test from 'node:test';
test('liefert eine externe, idempotente Anfangsmigration für Termine und Anmeldungen', async () => {
const migration = await readFile(new URL('../database/migrations/001_booking_schema.sql', import.meta.url), 'utf8');
assert.match(migration, /CREATE TABLE IF NOT EXISTS `sufw_booking_events`/);
assert.match(migration, /CREATE TABLE IF NOT EXISTS `sufw_booking_registrations`/);
assert.match(migration, /FOREIGN KEY \(`event_id`\)/);
assert.match(migration, /CHECK \(`capacity` BETWEEN 1 AND 100\)/);
});
test('hält die statische Vorschaukopie der Buchungsassets identisch', async () => {
const [componentScript, previewScript, componentStyle, previewStyle] = await Promise.all([
readFile(new URL('../public/booking/booking.js', import.meta.url), 'utf8'),
readFile(new URL('../public/perspektivwerk/js/booking.js', import.meta.url), 'utf8'),
readFile(new URL('../public/booking/booking.css', import.meta.url), 'utf8'),
readFile(new URL('../public/perspektivwerk/js/booking.css', import.meta.url), 'utf8'),
]);
assert.equal(previewScript, componentScript);
assert.equal(previewStyle, componentStyle);
});