Projektordner in der Nextcloud anlegen und je nach Status verschieben (P10)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
@@ -14,3 +14,5 @@ BACKUP_UHRZEIT=02:30
|
||||
NEXTCLOUD_URL=https://cloud.example.de/remote.php/dav/files/henning/Sicherungen/betrieb
|
||||
NEXTCLOUD_BENUTZER=henning
|
||||
NEXTCLOUD_PASSWORT=app-passwort-aus-nextcloud
|
||||
# Ordner, in dem „01 Angebot“, „02 laufende Projekte“, „03 Gewährl.-Projekte“ und „04 Archiv“ liegen (P10)
|
||||
NEXTCLOUD_PROJEKTE_URL=https://cloud.example.de/remote.php/dav/files/henning/Projekte
|
||||
|
||||
@@ -41,6 +41,9 @@ services:
|
||||
image: ${IMAGE}:${APP_VERSION}
|
||||
environment:
|
||||
DATABASE_URL: postgres://betrieb:${DB_PASSWORT}@db:5432/betrieb
|
||||
NEXTCLOUD_PROJEKTE_URL: ${NEXTCLOUD_PROJEKTE_URL:-}
|
||||
NEXTCLOUD_BENUTZER: ${NEXTCLOUD_BENUTZER:-}
|
||||
NEXTCLOUD_PASSWORT: ${NEXTCLOUD_PASSWORT:-}
|
||||
depends_on:
|
||||
db: { condition: service_healthy }
|
||||
db:
|
||||
|
||||
@@ -9,6 +9,7 @@ import { type Client, type Pool, transaktion } from "./db.js";
|
||||
import { mitNeuplanung, pruefeVerknuepfung, terminplan } from "./terminplan.js";
|
||||
import { uebersicht } from "./uebersicht.js";
|
||||
import { aufgabenKalender, baustellenKalender } from "./kalender.js";
|
||||
import { type Nextcloud, ordnerAbgleichen } from "./nextcloud.js";
|
||||
import { TABELLEN } from "./tabellen.js";
|
||||
import { EinstellungenSchema, type Einstellungen } from "./einstellungen.js";
|
||||
import { liquiditaet } from "../domain/liquiditaet.js";
|
||||
@@ -19,6 +20,8 @@ import { VERSION } from "./version.js";
|
||||
|
||||
export interface Optionen {
|
||||
pool: Pool;
|
||||
/** P10: Projektordner in der Nextcloud; ohne Zugang wird nichts angelegt */
|
||||
nextcloud?: Nextcloud;
|
||||
webOrdner?: string;
|
||||
logger?: boolean;
|
||||
}
|
||||
@@ -56,6 +59,28 @@ export async function baueApp(o: Optionen): Promise<FastifyInstance> {
|
||||
return { ok: true, version: VERSION };
|
||||
});
|
||||
|
||||
// P10: Ordner nach dem Speichern abgleichen. Ein Fehler in der Nextcloud macht die Änderung nicht
|
||||
// rückgängig; der Hinweis kommt mit zurück, und der Abgleich lässt sich wiederholen.
|
||||
async function mitOrdner(p: Record<string, any>, wer: string): Promise<Record<string, unknown>> {
|
||||
if (!o.nextcloud) return p;
|
||||
try {
|
||||
const pfad = await ordnerAbgleichen(o.nextcloud, p as { nummer: string; bezeichnung: string; status: string }, p.nextcloud_link ?? null);
|
||||
if (pfad === p.nextcloud_link) return p;
|
||||
return await transaktion(pool, wer, async (c) => (await c.query("update projekt set nextcloud_link = $2 where id = $1 returning *", [p.id, pfad])).rows[0]);
|
||||
} catch (err) {
|
||||
app.log.warn(err);
|
||||
return { ...p, ordner_fehler: `Projektordner in der Nextcloud: ${(err as Error).message}` };
|
||||
}
|
||||
}
|
||||
|
||||
app.post("/api/projekte/:id/ordner", async (req, reply) => {
|
||||
const { id } = IdParam.parse(req.params);
|
||||
const p = (await pool.query("select * from projekt where id = $1", [id])).rows[0];
|
||||
if (!p) return reply.status(404).send({ fehler: "Nicht gefunden" });
|
||||
if (!o.nextcloud) return reply.status(409).send({ fehler: "Für die Projektordner ist kein Nextcloud-Zugang eingerichtet." });
|
||||
return mitOrdner(p, benutzer(req));
|
||||
});
|
||||
|
||||
// Änderungen an Vorgängen und Verknüpfungen planen die Nachfolger in derselben Transaktion neu
|
||||
const PLAN = new Set(["vorgang", "vorgang_vorgaenger"]);
|
||||
async function geplant<T>(c: Client, tabelle: string, fn: () => Promise<T>, bewegt: string[] = []): Promise<T> {
|
||||
@@ -89,6 +114,7 @@ export async function baueApp(o: Optionen): Promise<FastifyInstance> {
|
||||
spalten.map((s) => daten[s]),
|
||||
)).rows[0]);
|
||||
});
|
||||
if (t.name === "projekt") return reply.status(201).send(await mitOrdner(row, benutzer(req)));
|
||||
return reply.status(201).send(row);
|
||||
});
|
||||
|
||||
@@ -108,6 +134,7 @@ export async function baueApp(o: Optionen): Promise<FastifyInstance> {
|
||||
[id, ...spalten.map((s) => daten[s])],
|
||||
)).rows[0], t.name === "vorgang" && daten.start !== undefined ? [id] : []);
|
||||
});
|
||||
if (row && t.name === "projekt" && (daten.nummer || daten.bezeichnung || daten.status)) return mitOrdner(row, benutzer(req));
|
||||
return row ?? reply.status(404).send({ fehler: "Nicht gefunden" });
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { erstellePool } from "./db.js";
|
||||
import { migriere } from "./migrate.js";
|
||||
import { baueApp } from "./app.js";
|
||||
import { Nextcloud } from "./nextcloud.js";
|
||||
|
||||
const url = process.env.DATABASE_URL;
|
||||
if (!url) {
|
||||
@@ -10,7 +11,10 @@ if (!url) {
|
||||
|
||||
const pool = erstellePool(url);
|
||||
await migriere(pool, (t) => console.log(t));
|
||||
const app = await baueApp({ pool, logger: true });
|
||||
// P10: Ordner der Projekte; gleicher Zugang wie für die Sicherung, eigene Adresse
|
||||
const { NEXTCLOUD_PROJEKTE_URL: ncUrl, NEXTCLOUD_BENUTZER: ncBenutzer, NEXTCLOUD_PASSWORT: ncPasswort } = process.env;
|
||||
const nextcloud = ncUrl && ncBenutzer && ncPasswort ? new Nextcloud({ url: ncUrl, benutzer: ncBenutzer, passwort: ncPasswort }) : undefined;
|
||||
const app = await baueApp({ pool, logger: true, nextcloud });
|
||||
const port = Number(process.env.PORT ?? 3000);
|
||||
await app.listen({ host: "0.0.0.0", port });
|
||||
|
||||
|
||||
103
src/server/nextcloud.ts
Normal file
103
src/server/nextcloud.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
// P10: Projektordner in Hennings Nextcloud anlegen und je nach Status verschieben (WebDAV, App-Passwort).
|
||||
// Statusordner und Unterordner wie in seiner Ablage (Henning, 18./19.10.2026).
|
||||
|
||||
export interface NextcloudZugang {
|
||||
/** WebDAV-Adresse des Ordners, in dem „01 Angebot“ … „04 Archiv“ liegen */
|
||||
url: string;
|
||||
benutzer: string;
|
||||
passwort: string;
|
||||
}
|
||||
|
||||
export const STATUSORDNER: Record<string, string> = {
|
||||
anfrage: "01 Angebot",
|
||||
angebot: "01 Angebot",
|
||||
auftrag: "02 laufende Projekte",
|
||||
ausfuehrung: "02 laufende Projekte",
|
||||
abgerechnet: "02 laufende Projekte",
|
||||
gewaehrleistung: "03 Gewährl.-Projekte",
|
||||
abgeschlossen: "04 Archiv",
|
||||
};
|
||||
|
||||
export const UNTERORDNER = ["01 Auftrag", "01 Auftrag/03 Stundenlohnarb.", "02 Umsetzung", "03 Bilder"];
|
||||
|
||||
/** „P-26-020 Terrassendachsanierung“; Schrägstriche und Steuerzeichen sind in Ordnernamen nicht erlaubt. */
|
||||
export function ordnerName(nummer: string, bezeichnung: string): string {
|
||||
return `${nummer} ${bezeichnung}`.replace(/[\\/:*?"<>|\u0000-\u001f]/g, "-").replace(/\s+/g, " ").trim();
|
||||
}
|
||||
|
||||
export function zielPfad(p: { nummer: string; bezeichnung: string; status: string }): string {
|
||||
return `${STATUSORDNER[p.status] ?? STATUSORDNER.anfrage}/${ordnerName(p.nummer, p.bezeichnung)}`;
|
||||
}
|
||||
|
||||
const kodiert = (pfad: string) => pfad.split("/").map(encodeURIComponent).join("/");
|
||||
|
||||
export class Nextcloud {
|
||||
constructor(private z: NextcloudZugang, private abruf: typeof fetch = fetch) {}
|
||||
|
||||
private adresse(pfad: string): string {
|
||||
return `${this.z.url.replace(/\/+$/, "")}/${kodiert(pfad)}`;
|
||||
}
|
||||
|
||||
private async anfrage(methode: string, pfad: string, kopf: Record<string, string> = {}, body?: string): Promise<Response> {
|
||||
return this.abruf(this.adresse(pfad), {
|
||||
method: methode,
|
||||
headers: { authorization: `Basic ${btoa(`${this.z.benutzer}:${this.z.passwort}`)}`, ...kopf },
|
||||
body,
|
||||
});
|
||||
}
|
||||
|
||||
async gibtEs(pfad: string): Promise<boolean> {
|
||||
const r = await this.anfrage("PROPFIND", pfad, { depth: "0" });
|
||||
if (r.status === 404) return false;
|
||||
if (r.ok || r.status === 207) return true;
|
||||
throw new Error(`Nextcloud antwortet mit ${r.status} für ${pfad}`);
|
||||
}
|
||||
|
||||
/** Namen der Unterordner (eine Ebene) */
|
||||
async liste(pfad: string): Promise<string[]> {
|
||||
const r = await this.anfrage("PROPFIND", pfad, { depth: "1" });
|
||||
if (r.status === 404) return [];
|
||||
if (r.status !== 207) throw new Error(`Nextcloud antwortet mit ${r.status} für ${pfad}`);
|
||||
const xml = await r.text();
|
||||
const basis = new URL(this.adresse(pfad)).pathname.replace(/\/+$/, "");
|
||||
return [...xml.matchAll(/<d:href>([^<]+)<\/d:href>/gi)]
|
||||
.map((m) => decodeURIComponent(m[1]!).replace(/\/+$/, ""))
|
||||
.filter((h) => h !== decodeURIComponent(basis) && h.startsWith(decodeURIComponent(basis)))
|
||||
.map((h) => h.slice(decodeURIComponent(basis).length + 1));
|
||||
}
|
||||
|
||||
async ordner(pfad: string): Promise<void> {
|
||||
const r = await this.anfrage("MKCOL", pfad);
|
||||
if (!(r.status === 201 || r.status === 405)) throw new Error(`Ordner ${pfad} ließ sich nicht anlegen (${r.status})`);
|
||||
}
|
||||
|
||||
async verschiebe(von: string, nach: string): Promise<void> {
|
||||
const r = await this.anfrage("MOVE", von, { destination: this.adresse(nach), overwrite: "F" });
|
||||
if (!(r.status === 201 || r.status === 204)) throw new Error(`${von} ließ sich nicht nach ${nach} verschieben (${r.status})`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bringt den Ordner eines Projekts an die richtige Stelle. `bisher` ist der zuletzt bekannte Pfad
|
||||
* (projekt.nextcloud_link). Ohne bekannten Pfad wird ein vorhandener Ordner mit derselben Nummer in
|
||||
* den Statusordnern gesucht und übernommen, sonst ein neuer mit Unterordnern angelegt.
|
||||
* Gibt den neuen Pfad zurück.
|
||||
*/
|
||||
export async function ordnerAbgleichen(nc: Nextcloud, p: { nummer: string; bezeichnung: string; status: string }, bisher: string | null): Promise<string> {
|
||||
const ziel = zielPfad(p);
|
||||
if (bisher === ziel && (await nc.gibtEs(ziel))) return ziel;
|
||||
let quelle = bisher && (await nc.gibtEs(bisher)) ? bisher : null;
|
||||
if (!quelle) {
|
||||
for (const s of new Set(Object.values(STATUSORDNER))) {
|
||||
const treffer = (await nc.liste(s)).find((n) => n === p.nummer || n.startsWith(`${p.nummer} `));
|
||||
if (treffer) { quelle = `${s}/${treffer}`; break; }
|
||||
}
|
||||
}
|
||||
await nc.ordner(ziel.split("/")[0]!);
|
||||
if (quelle && quelle !== ziel) await nc.verschiebe(quelle, ziel);
|
||||
if (!quelle) {
|
||||
await nc.ordner(ziel);
|
||||
for (const u of UNTERORDNER) await nc.ordner(`${ziel}/${u}`);
|
||||
}
|
||||
return ziel;
|
||||
}
|
||||
@@ -118,12 +118,17 @@ function bestaetigen(frage: string): Promise<boolean> {
|
||||
async function bearbeiten(pfad: string, titel: string, felder: Feld[], zeile: Zeile | null, vorgaben: Zeile = {}): Promise<boolean> {
|
||||
const e = await dialog(titel, felder, zeile ?? vorgaben, !!zeile);
|
||||
if (!e) return false;
|
||||
let antwort: Zeile | undefined;
|
||||
if (e.aktion === "loeschen") await api(`${pfad}/${zeile!.id}`, "DELETE");
|
||||
else if (zeile) await api(`${pfad}/${zeile.id}`, "PATCH", e.daten);
|
||||
else await api(pfad, "POST", { ...vorgaben, ...e.daten });
|
||||
else if (zeile) antwort = await api(`${pfad}/${zeile.id}`, "PATCH", e.daten);
|
||||
else antwort = await api(pfad, "POST", { ...vorgaben, ...e.daten });
|
||||
// gespeichert, aber z. B. der Projektordner in der Nextcloud hat nicht geklappt
|
||||
if (antwort?.ordner_fehler) hinweisNachLaden = antwort.ordner_fehler;
|
||||
return true;
|
||||
}
|
||||
|
||||
let hinweisNachLaden = "";
|
||||
|
||||
function tabelle(spalten: { titel: string; wert: (z: Zeile) => string; klasse?: string }[], zeilen: Zeile[], klick?: (z: Zeile) => void): HTMLTableElement {
|
||||
const t = document.createElement("table");
|
||||
t.innerHTML = `<thead><tr>${spalten.map((s) => `<th class="${s.klasse ?? ""}">${esc(s.titel)}</th>`).join("")}</tr></thead>
|
||||
@@ -137,7 +142,8 @@ function tabelle(spalten: { titel: string; wert: (z: Zeile) => string; klasse?:
|
||||
|
||||
// Kopf wie bei Plancraft: Titel links, Hauptknopf rechts; darunter eine Leiste für Filter
|
||||
function seite(titel: string, knopf?: { text: string; aktion: () => void }): HTMLElement {
|
||||
inhalt.innerHTML = `<div class="kopf"><h1>${esc(titel)}</h1></div>`;
|
||||
inhalt.innerHTML = `<div class="kopf"><h1>${esc(titel)}</h1></div>${hinweisNachLaden ? `<div class="warnung">${esc(hinweisNachLaden)}</div>` : ""}`;
|
||||
hinweisNachLaden = "";
|
||||
if (knopf) {
|
||||
const b = document.createElement("button");
|
||||
b.className = "haupt";
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Prüft Server und Datenbank zusammen. Läuft nur mit TEST_DATABASE_URL (lokal und in der CI).
|
||||
import { describe, it, expect, beforeAll, afterAll } from "vitest";
|
||||
import { falscheNextcloud } from "./falsche-nextcloud.js";
|
||||
import type { FastifyInstance } from "fastify";
|
||||
import { erstellePool, type Pool } from "../src/server/db.js";
|
||||
import { migriere } from "../src/server/migrate.js";
|
||||
@@ -231,3 +232,38 @@ describe.skipIf(!url)("Übernahme aus V70 über die API", () => {
|
||||
expect((await app.inject(`/kalender/${kalenderToken.slice(0, -1)}${kalenderToken.endsWith("x") ? "y" : "x"}/baustellen.ics`)).statusCode).toBe(404);
|
||||
});
|
||||
});
|
||||
|
||||
describe.skipIf(!url)("Projektordner in der Nextcloud über die API", () => {
|
||||
let pool: Pool;
|
||||
let app: FastifyInstance;
|
||||
const f = falscheNextcloud();
|
||||
|
||||
beforeAll(async () => {
|
||||
pool = erstellePool(url!);
|
||||
await pool.query("drop schema public cascade; create schema public;");
|
||||
await migriere(pool);
|
||||
app = await baueApp({ pool, webOrdner: "/gibt-es-nicht", nextcloud: f.nc });
|
||||
});
|
||||
afterAll(async () => {
|
||||
await app?.close();
|
||||
await pool?.end();
|
||||
});
|
||||
|
||||
it("neues Projekt bekommt einen Ordner, Statuswechsel verschiebt ihn", async () => {
|
||||
const p = (await app.inject({ method: "POST", url: "/api/projekte", payload: { nummer: "A-26-130", bezeichnung: "Carport Most", status: "angebot" } })).json();
|
||||
expect(p.nextcloud_link).toBe("01 Angebot/A-26-130 Carport Most");
|
||||
const q = (await app.inject({ method: "PATCH", url: `/api/projekte/${p.id}`, payload: { nummer: "P-26-021", status: "auftrag" } })).json();
|
||||
expect(q.nextcloud_link).toBe("02 laufende Projekte/P-26-021 Carport Most");
|
||||
expect(f.relativ()).toContain("02 laufende Projekte/P-26-021 Carport Most/02 Umsetzung");
|
||||
});
|
||||
|
||||
it("Fehler der Nextcloud verhindert das Speichern nicht", async () => {
|
||||
f.ordner.clear(); // Wurzel fehlt: jede Anlage schlägt fehl
|
||||
const r = await app.inject({ method: "POST", url: "/api/projekte", payload: { nummer: "A-26-131", bezeichnung: "Gaube", status: "angebot" } });
|
||||
expect(r.statusCode).toBe(201);
|
||||
expect(r.json().ordner_fehler).toMatch(/Nextcloud/);
|
||||
f.ordner.add(f.wurzel);
|
||||
const nochmal = (await app.inject({ method: "POST", url: `/api/projekte/${r.json().id}/ordner` })).json();
|
||||
expect(nochmal.nextcloud_link).toBe("01 Angebot/A-26-131 Gaube");
|
||||
});
|
||||
});
|
||||
|
||||
36
test/falsche-nextcloud.ts
Normal file
36
test/falsche-nextcloud.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Nextcloud } from "../src/server/nextcloud.js";
|
||||
|
||||
/** Kleine WebDAV-Nachbildung im Speicher: nur Ordner, wie Nextcloud sie beantwortet */
|
||||
export function falscheNextcloud(basis = "https://cloud.test/remote.php/dav/files/henning/Projekte") {
|
||||
const ordner = new Set<string>();
|
||||
const pfad = (u: string) => decodeURIComponent(new URL(u).pathname).replace(/\/+$/, "");
|
||||
const wurzel = pfad(basis);
|
||||
ordner.add(wurzel);
|
||||
const abruf = (async (u: string | URL, init?: RequestInit) => {
|
||||
const p = pfad(String(u));
|
||||
const kopf = (init?.headers ?? {}) as Record<string, string>;
|
||||
const eltern = p.slice(0, p.lastIndexOf("/"));
|
||||
switch (init?.method) {
|
||||
case "PROPFIND": {
|
||||
if (!ordner.has(p)) return new Response(null, { status: 404 });
|
||||
const kinder = kopf.depth === "1" ? [...ordner].filter((o) => o.startsWith(p + "/") && !o.slice(p.length + 1).includes("/")) : [];
|
||||
const hrefs = [p, ...kinder].map((o) => `<d:response><d:href>${o.split("/").map(encodeURIComponent).join("/")}/</d:href></d:response>`).join("");
|
||||
return new Response(`<?xml version="1.0"?><d:multistatus xmlns:d="DAV:">${hrefs}</d:multistatus>`, { status: 207 });
|
||||
}
|
||||
case "MKCOL":
|
||||
if (ordner.has(p)) return new Response(null, { status: 405 });
|
||||
if (!ordner.has(eltern)) return new Response(null, { status: 409 });
|
||||
ordner.add(p);
|
||||
return new Response(null, { status: 201 });
|
||||
case "MOVE": {
|
||||
const ziel = pfad(kopf.destination!);
|
||||
if (!ordner.has(p) || ordner.has(ziel) || !ordner.has(ziel.slice(0, ziel.lastIndexOf("/")))) return new Response(null, { status: 409 });
|
||||
for (const o of [...ordner]) if (o === p || o.startsWith(p + "/")) { ordner.delete(o); ordner.add(ziel + o.slice(p.length)); }
|
||||
return new Response(null, { status: 201 });
|
||||
}
|
||||
}
|
||||
return new Response(null, { status: 400 });
|
||||
}) as typeof fetch;
|
||||
const relativ = () => [...ordner].filter((o) => o !== wurzel).map((o) => o.slice(wurzel.length + 1)).sort();
|
||||
return { nc: new Nextcloud({ url: basis, benutzer: "henning", passwort: "geheim" }, abruf), ordner, wurzel, relativ };
|
||||
}
|
||||
35
test/nextcloud.test.ts
Normal file
35
test/nextcloud.test.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { ordnerAbgleichen, ordnerName } from "../src/server/nextcloud.js";
|
||||
import { falscheNextcloud } from "./falsche-nextcloud.js";
|
||||
|
||||
describe("Projektordner in der Nextcloud (P10)", () => {
|
||||
it("Ordnername ohne verbotene Zeichen", () => {
|
||||
expect(ordnerName("P-26-020", "Terrassendach / Carport")).toBe("P-26-020 Terrassendach - Carport");
|
||||
});
|
||||
|
||||
it("legt neu an mit Unterordnern und verschiebt nach Status und Umbenennung", async () => {
|
||||
const f = falscheNextcloud();
|
||||
const p = { nummer: "A-26-120", bezeichnung: "Terrassendachsanierung", status: "angebot" };
|
||||
let pfad = await ordnerAbgleichen(f.nc, p, null);
|
||||
expect(pfad).toBe("01 Angebot/A-26-120 Terrassendachsanierung");
|
||||
expect(f.relativ()).toContain("01 Angebot/A-26-120 Terrassendachsanierung/01 Auftrag/03 Stundenlohnarb.");
|
||||
// Angebot angenommen: neue Nummer und Status Auftrag
|
||||
pfad = await ordnerAbgleichen(f.nc, { ...p, nummer: "P-26-020", status: "auftrag" }, pfad);
|
||||
expect(pfad).toBe("02 laufende Projekte/P-26-020 Terrassendachsanierung");
|
||||
expect(f.relativ()).toContain("02 laufende Projekte/P-26-020 Terrassendachsanierung/03 Bilder");
|
||||
expect(f.relativ().some((o) => o.startsWith("01 Angebot/"))).toBe(false);
|
||||
pfad = await ordnerAbgleichen(f.nc, { ...p, nummer: "P-26-020", status: "gewaehrleistung" }, pfad);
|
||||
expect(pfad).toBe("03 Gewährl.-Projekte/P-26-020 Terrassendachsanierung");
|
||||
});
|
||||
|
||||
it("übernimmt einen vorhandenen Ordner mit gleicher Nummer statt einen zweiten anzulegen", async () => {
|
||||
const f = falscheNextcloud();
|
||||
f.ordner.add(`${f.wurzel}/02 laufende Projekte`);
|
||||
f.ordner.add(`${f.wurzel}/02 laufende Projekte/P-26-014 Bohlentausch Stadt`);
|
||||
f.ordner.add(`${f.wurzel}/02 laufende Projekte/P-26-014 Bohlentausch Stadt/Fotos`);
|
||||
const pfad = await ordnerAbgleichen(f.nc, { nummer: "P-26-014", bezeichnung: "Bohlentausch", status: "abgeschlossen" }, null);
|
||||
expect(pfad).toBe("04 Archiv/P-26-014 Bohlentausch");
|
||||
expect(f.relativ()).toContain("04 Archiv/P-26-014 Bohlentausch/Fotos");
|
||||
expect(f.relativ().filter((o) => o.includes("P-26-014"))).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user