fix(dienstgrad): add ASB→Abschnittssachbearbeiter, remove non-existent ranks (FA/FF/BOI/BAM variants), sync DB constraint, TS types, and display map
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
-- Migration 090: Add 'Abschnittssachbearbeiter' and remove non-existent ranks
|
||||
-- (Feuerwehranwärter, Feuerwehrfrau variants, Brandoberinspektor, Brandamtmann)
|
||||
-- from the mitglieder_profile dienstgrad CHECK constraint.
|
||||
|
||||
-- Null out any existing rows with ranks that are being removed
|
||||
UPDATE mitglieder_profile
|
||||
SET dienstgrad = NULL
|
||||
WHERE dienstgrad IN (
|
||||
'Feuerwehranwärter',
|
||||
'Feuerwehrfrau',
|
||||
'Oberfeuerwehrfrau',
|
||||
'Hauptfeuerwehrfrau',
|
||||
'Brandoberinspektor',
|
||||
'Brandamtmann',
|
||||
'Ehren-Feuerwehrfrau',
|
||||
'Ehren-Oberfeuerwehrfrau',
|
||||
'Ehren-Hauptfeuerwehrfrau',
|
||||
'Ehren-Brandoberinspektor',
|
||||
'Ehren-Brandamtmann'
|
||||
);
|
||||
|
||||
ALTER TABLE mitglieder_profile
|
||||
DROP CONSTRAINT IF EXISTS mitglieder_profile_dienstgrad_check;
|
||||
|
||||
ALTER TABLE mitglieder_profile
|
||||
ADD CONSTRAINT mitglieder_profile_dienstgrad_check
|
||||
CHECK (dienstgrad IS NULL OR dienstgrad IN (
|
||||
-- Standard Dienstgrade
|
||||
'Jugendfeuerwehrmann',
|
||||
'Probefeuerwehrmann',
|
||||
'Feuerwehrmann',
|
||||
'Oberfeuerwehrmann',
|
||||
'Hauptfeuerwehrmann',
|
||||
'Löschmeister',
|
||||
'Oberlöschmeister',
|
||||
'Hauptlöschmeister',
|
||||
'Brandmeister',
|
||||
'Oberbrandmeister',
|
||||
'Hauptbrandmeister',
|
||||
'Brandinspektor',
|
||||
'Oberbrandinspektor',
|
||||
'Verwaltungsmeister',
|
||||
'Oberverwaltungsmeister',
|
||||
'Hauptverwaltungsmeister',
|
||||
'Verwalter',
|
||||
'Sachbearbeiter',
|
||||
'Abschnittssachbearbeiter',
|
||||
-- Ehrendienstgrade
|
||||
'Ehren-Feuerwehrmann',
|
||||
'Ehren-Oberfeuerwehrmann',
|
||||
'Ehren-Hauptfeuerwehrmann',
|
||||
'Ehren-Löschmeister',
|
||||
'Ehren-Oberlöschmeister',
|
||||
'Ehren-Hauptlöschmeister',
|
||||
'Ehren-Brandmeister',
|
||||
'Ehren-Oberbrandmeister',
|
||||
'Ehren-Hauptbrandmeister',
|
||||
'Ehren-Brandinspektor',
|
||||
'Ehren-Oberbrandinspektor',
|
||||
'Ehren-Verwaltungsmeister',
|
||||
'Ehren-Oberverwaltungsmeister',
|
||||
'Ehren-Hauptverwaltungsmeister',
|
||||
'Ehren-Verwalter',
|
||||
'Ehren-Sachbearbeiter',
|
||||
'Ehren-Abschnittssachbearbeiter'
|
||||
));
|
||||
@@ -6,13 +6,11 @@ import { z } from 'zod';
|
||||
// ============================================================
|
||||
|
||||
export const DIENSTGRAD_VALUES = [
|
||||
'Feuerwehranwärter',
|
||||
'Jugendfeuerwehrmann',
|
||||
'Probefeuerwehrmann',
|
||||
'Feuerwehrmann',
|
||||
'Feuerwehrfrau',
|
||||
'Oberfeuerwehrmann',
|
||||
'Oberfeuerwehrfrau',
|
||||
'Hauptfeuerwehrmann',
|
||||
'Hauptfeuerwehrfrau',
|
||||
'Löschmeister',
|
||||
'Oberlöschmeister',
|
||||
'Hauptlöschmeister',
|
||||
@@ -21,8 +19,12 @@ export const DIENSTGRAD_VALUES = [
|
||||
'Hauptbrandmeister',
|
||||
'Brandinspektor',
|
||||
'Oberbrandinspektor',
|
||||
'Brandoberinspektor',
|
||||
'Brandamtmann',
|
||||
'Verwaltungsmeister',
|
||||
'Oberverwaltungsmeister',
|
||||
'Hauptverwaltungsmeister',
|
||||
'Verwalter',
|
||||
'Sachbearbeiter',
|
||||
'Abschnittssachbearbeiter',
|
||||
] as const;
|
||||
|
||||
export const STATUS_VALUES = [
|
||||
|
||||
Reference in New Issue
Block a user