From 73d59ff506ccb4bfdaba55688ea784ea8ec488f1 Mon Sep 17 00:00:00 2001 From: Claude Project Manager Date: Thu, 25 Sep 2025 00:36:07 +0200 Subject: [PATCH] Alle SG erfasst --- backend/src/routes/organizationImport.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/src/routes/organizationImport.ts b/backend/src/routes/organizationImport.ts index 276e1cb..a996312 100644 --- a/backend/src/routes/organizationImport.ts +++ b/backend/src/routes/organizationImport.ts @@ -199,6 +199,17 @@ function parseOrganizationFromText(text: string) { continue } + // Sachgebiet Leitungsstab (z. B. "SG LStab 1 - ...") + const sgLStabMatch = line.match(/^SG\s+LStab\s+(\d+)/i) + if (sgLStabMatch) { + const num = sgLStabMatch[1].trim() + const sgName = line.replace(/^SG\s+LStab\s+\d+\s*-?\s*/i, '').trim() || `Sachgebiet LStab ${num}` + // Ensure Leitungsstab exists under DIR + ensure({ code: 'LStab', name: 'Leitungsstab', type: 'stabsstelle', level: 1, parentId: 'DIR', color: '#6b7280' }) + ensure({ code: `SG LStab ${num}`, name: sgName, type: 'sachgebiet', level: 2, parentId: 'LStab' }) + continue + } + const sgMatch = line.match(/^SG\s+([\d\.]+)/i) if (sgMatch) { const sgNum = sgMatch[1].trim()