Files
breakpilot-compliance/backend-compliance/migrations/112_sop_template.sql
T
Benjamin Admin 9b4be663f7 feat: Rollenkonzept backend + SOP template (Phase 1-3)
- Migration 111: 3 new tables (org_roles, document_reviews, document_role_mapping)
  with seed data mapping all 71 doc types to 7 compliance roles
- org_role_routes.py: CRUD for roles, seed defaults, test email, mapping API
- document_review_routes.py: Review lifecycle (create→send→approve/reject)
  with approval notification to all affected roles
- Migration 112: SOP template (ISO 9001 structure, 21 placeholders)
- Added standard_operating_procedure to TemplateType, doc-labels, presets

[migration-approved]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-03 13:03:38 +02:00

138 lines
5.2 KiB
SQL

-- Migration 112: Standard Operating Procedure (SOP) Template
-- ISO 9001-konforme Struktur, eigene Formulierung (kein Normtext)
INSERT INTO compliance_legal_templates (
tenant_id, document_type, template_type, language, jurisdiction,
document_title, description, version, status,
text, placeholders,
license_id, license_name, source_name, attribution_required
) VALUES (
'__default__',
'standard_operating_procedure',
'standard_operating_procedure',
'de',
'DE',
'Standard Operating Procedure (SOP)',
'Vorlage fuer standardisierte Verfahrensanweisungen mit Rollen-Matrix, Ablaufbeschreibung und Freigabeprozess',
'1.0',
'published',
$template$# Standard Operating Procedure (SOP)
**{{COMPANY_NAME}}** | SOP-Nr.: {{SOP_NUMBER}} | Version {{DOCUMENT_VERSION}} | Stand: {{VERSION_DATE}}
---
## 1. Zweck
{{SOP_PURPOSE}}
## 2. Geltungsbereich
{{SOP_SCOPE}}
## 3. Verantwortlichkeiten
| Rolle | Verantwortung | Name |
|-------|---------------|------|
| Ersteller | Erstellung und Pflege dieser SOP | {{SOP_AUTHOR_NAME}} |
| Pruefer/in | Fachliche Pruefung auf Richtigkeit | {{SOP_REVIEWER_NAME}} |
| Freigebende/r | Formale Freigabe und Inkraftsetzung | {{SOP_APPROVER_NAME}} |
| Durchfuehrende/r | Operative Umsetzung des Verfahrens | {{SOP_EXECUTOR_NAME}} |
### Zusaetzliche Rollen
{{#IF HAS_ADDITIONAL_ROLES}}
| Rolle | Verantwortung | Kontakt |
|-------|---------------|---------|
{{SOP_ADDITIONAL_ROLES}}
{{/IF}}
## 4. Begriffe und Abkuerzungen
{{SOP_DEFINITIONS}}
## 5. Ablaufbeschreibung
### 5.1 Voraussetzungen
{{SOP_PREREQUISITES}}
### 5.2 Durchfuehrung
{{SOP_PROCEDURE_STEPS}}
### 5.3 Nachbereitung und Qualitaetskontrolle
{{SOP_POST_STEPS}}
### 5.4 Eskalation
{{#IF HAS_ESCALATION}}
Bei Abweichungen vom Standardprozess gilt folgender Eskalationsweg:
{{SOP_ESCALATION_PATH}}
{{/IF}}
{{#IF_NOT HAS_ESCALATION}}
Abweichungen sind dem/der Freigebenden ({{SOP_APPROVER_NAME}}) unverzueglich zu melden.
{{/IF_NOT}}
## 6. Dokumentation und Nachweise
{{SOP_DOCUMENTATION_REQUIREMENTS}}
**Aufbewahrungsfrist:** {{SOP_RETENTION_PERIOD}}
**Speicherort:** {{SOP_STORAGE_LOCATION}}
## 7. Abweichungsbehandlung
{{SOP_DEVIATION_HANDLING}}
## 8. Referenzen
{{SOP_REFERENCES}}
## 9. Revisionshistorie
| Version | Datum | Autor | Aenderungen |
|---------|-------|-------|-------------|
| {{DOCUMENT_VERSION}} | {{VERSION_DATE}} | {{SOP_AUTHOR_NAME}} | Erstversion |
## 10. Freigabe
| Rolle | Name | Datum | Unterschrift |
|-------|------|-------|-------------|
| Erstellt von | {{SOP_AUTHOR_NAME}} | {{VERSION_DATE}} | _______________ |
| Geprueft von | {{SOP_REVIEWER_NAME}} | | _______________ |
| Freigegeben von | {{SOP_APPROVER_NAME}} | | _______________ |
---
*Dieses Dokument wurde mit dem BreakPilot Compliance SDK erstellt.*
$template$,
'[
{"key": "{{COMPANY_NAME}}", "label": "Firmenname", "required": true, "section": "PROVIDER"},
{"key": "{{SOP_NUMBER}}", "label": "SOP-Nummer (z.B. SOP-DS-001)", "required": true, "section": "LEGAL"},
{"key": "{{DOCUMENT_VERSION}}", "label": "Version (z.B. 1.0)", "required": true, "section": "LEGAL"},
{"key": "{{VERSION_DATE}}", "label": "Datum (YYYY-MM-DD)", "required": true, "section": "LEGAL"},
{"key": "{{SOP_PURPOSE}}", "label": "Zweck der SOP", "required": true, "section": "LEGAL"},
{"key": "{{SOP_SCOPE}}", "label": "Geltungsbereich", "required": true, "section": "LEGAL"},
{"key": "{{SOP_AUTHOR_NAME}}", "label": "Ersteller (Name)", "required": true, "section": "PROVIDER"},
{"key": "{{SOP_REVIEWER_NAME}}", "label": "Pruefer/in (Name)", "required": true, "section": "PROVIDER"},
{"key": "{{SOP_APPROVER_NAME}}", "label": "Freigebende/r (Name)", "required": true, "section": "PROVIDER"},
{"key": "{{SOP_EXECUTOR_NAME}}", "label": "Durchfuehrende/r (Name)", "required": true, "section": "PROVIDER"},
{"key": "{{SOP_ADDITIONAL_ROLES}}", "label": "Weitere Rollen (Markdown-Tabelle)", "required": false, "section": "PROVIDER"},
{"key": "{{SOP_DEFINITIONS}}", "label": "Begriffe und Abkuerzungen", "required": false, "section": "LEGAL"},
{"key": "{{SOP_PREREQUISITES}}", "label": "Voraussetzungen", "required": true, "section": "LEGAL"},
{"key": "{{SOP_PROCEDURE_STEPS}}", "label": "Ablaufbeschreibung (Schritte)", "required": true, "section": "LEGAL"},
{"key": "{{SOP_POST_STEPS}}", "label": "Nachbereitung / QS", "required": false, "section": "LEGAL"},
{"key": "{{SOP_ESCALATION_PATH}}", "label": "Eskalationsweg", "required": false, "section": "LEGAL"},
{"key": "{{SOP_DOCUMENTATION_REQUIREMENTS}}", "label": "Dokumentationspflichten", "required": true, "section": "LEGAL"},
{"key": "{{SOP_RETENTION_PERIOD}}", "label": "Aufbewahrungsfrist", "required": false, "section": "LEGAL"},
{"key": "{{SOP_STORAGE_LOCATION}}", "label": "Speicherort", "required": false, "section": "LEGAL"},
{"key": "{{SOP_DEVIATION_HANDLING}}", "label": "Abweichungsbehandlung", "required": true, "section": "LEGAL"},
{"key": "{{SOP_REFERENCES}}", "label": "Referenzen / Normen", "required": false, "section": "LEGAL"}
]'::jsonb,
'mit', 'MIT License', 'BreakPilot Compliance', false
) ON CONFLICT DO NOTHING;