Släktträd och tidslinje

Relationer får ett släktband (förälder, partner, syskon) och en period.
Nytt släktträd som ritas av släktbanden, och en tidslinje som samlar
födelse och död, scenarier, egna händelser och relationsperioder med
ålder vid varje tillfälle. Datum skrivs som ÅÅÅÅ, ÅÅÅÅ-MM eller
ÅÅÅÅ-MM-DD. Följer med i export, import och papperskorg. Migreringen
0006 ger gamla relationer som "Förälder till" rätt släktband.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-01 23:54:27 +01:00
1 parent dcb5d43429
commit bd269d70a5
32 files changed
+2285 -25

No files matched your search

+4 -4
View File
@@ -5,7 +5,7 @@ import { beforeEach, expect, it } from "vitest";
import { buildExport, importBook, readImportFile } from "@/lib/book-transfer";
import { UPLOAD_DIR, saveImageBytes } from "@/lib/files";
import { nextMapCode, nextMarkerCode, nextScheduleCode } from "@/lib/ids";
import { entityRow, makeImage, validExport } from "../helpers/fixtures";
import { entityRow, makeImage, relationRow, validExport } from "../helpers/fixtures";
import { describeDb, filesIn, makeBook, makeEntity, makeRelation, makeUser, prisma, resetAll } from "../helpers/db";
/** Skickar exporten genom samma zip-format som exportknappen och läser tillbaka den. */
@@ -136,9 +136,9 @@ describeDb("export och import", () => {
const data = validExport({
entities: [entityRow("a", "CHARACTER", "Anna", { image: "saknas.png" }), entityRow("b", "CHARACTER", "Bo", { image: "skräp.png" })],
relations: [
{ id: "r1", code: null, fromId: "a", toId: "b", type: "Vänner", description: null, data: {}, members: ["finns-inte"] },
{ id: "r2", code: null, fromId: "a", toId: "okänd", type: "Fiende", description: null, data: {}, members: [] },
{ id: "r3", code: null, fromId: "a", toId: "a", type: "Självrelation", description: null, data: {}, members: [] },
relationRow("r1", "a", "b", "Vänner", { members: ["finns-inte"] }),
relationRow("r2", "a", "okänd", "Fiende"),
relationRow("r3", "a", "a", "Självrelation"),
],
shifts: [{ personId: "okänd", workplaceId: null, weekday: 0, startTime: "08:00", endTime: "16:00", weeks: "ALL", label: null, scheduleCode: null }],
});