Alpenwerk HR 0.1.0 Betrieb auf Windows Server - Die Anwendung läuft im IIS (HttpPlatformHandler) unter dem Konto des Anwendungspools, ohne Administratorrechte und ohne eigenen Windows-Dienst - Das Zertifikat kommt aus dem Zertifikatsspeicher; die Bindung folgt jeder Erneuerung automatisch - Neue Versionen mit aktualisieren.ps1 -Paket <zip>, mit Sicherung vorab; Rückstieg mit zuruecksetzen.ps1 - HR-Zugang für ganze Domains mit freischalten.ps1 -Domain; Einzelsperren haben Vorrang - Anmeldung ausschließlich über Microsoft Entra ID - Das Windows-Paket hängt an jedem Release Fachliche Erweiterungen - Änderungen per Austauschdatei importieren, mit Vorschau, Prüfung und Fehlerdatei - Einstellung: eigene Maske für externe Personen, Übernahme von Leiharbeitskräften, Planstellen zum Eintrittstag - Organisationsstruktur: Einheiten und Kostenstellen anlegen, umbenennen und abschließen; Suche nach Planstelle, Einheit und Kostenstelle - Historie: Austritt, Versetzung und Eintritt berichtigen oder zurücknehmen; Planstelle mit Bezeichnung - Abwesenheiten ohne Ende, geplante Abwesenheiten mit Art, Checklisten mit Anlass, auch zur Rückkehr - Berichte mit Mehrfachauswahl in allen Kriterien; Kostenstelle als Filter und Gruppierung - Stammdaten: mehrere Notfallkontakte, Lehrzeit, Ferialkraft, Altersteilzeit, erweiterte Beschäftigtengruppen und Geschlechtsangaben
71 lines
3.0 KiB
SQL
71 lines
3.0 KiB
SQL
-- Geburtsdatum bei der Einstellung freiwillig
|
|
--
|
|
-- Fachlich vorgegeben: eine Einstellung darf ohne Geburtsdatum erfasst
|
|
-- werden; es wird nachgetragen, sobald es vorliegt. Die Spalte ist damit
|
|
-- nicht mehr NOT NULL. Ein leer geschicktes Feld wird null und nicht in ein
|
|
-- Datum umgewandelt — sonst bräche die Umwandlung von '' ab.
|
|
--
|
|
-- Geändert wird an der laufenden Definition, an genau einem Anker je
|
|
-- Funktion.
|
|
|
|
alter table employees alter column birth_date drop not null;
|
|
|
|
do $migration$
|
|
declare
|
|
v_ziele text[][] := array[
|
|
array['hire_employee',
|
|
$a$(payload->>'birth_date')::date, payload->>'sv_nummer',$a$,
|
|
$a$nullif(payload->>'birth_date', '')::date, payload->>'sv_nummer',$a$],
|
|
array['rehire_employee',
|
|
$a$birth_date = coalesce((payload->>'birth_date')::date, birth_date),$a$,
|
|
$a$birth_date = coalesce(nullif(payload->>'birth_date', '')::date, birth_date),$a$],
|
|
array['change_employee_data',
|
|
$a$birth_date = coalesce((v_person->>'birth_date')::date, birth_date),$a$,
|
|
$a$birth_date = coalesce(nullif(v_person->>'birth_date', '')::date, birth_date),$a$],
|
|
array['apply_due_pending_changes',
|
|
$a$birth_date = coalesce((v_rec.payload->'person'->>'birth_date')::date, birth_date),$a$,
|
|
$a$birth_date = coalesce(nullif(v_rec.payload->'person'->>'birth_date', '')::date, birth_date),$a$]
|
|
];
|
|
v_def text;
|
|
v_treffer integer;
|
|
i integer;
|
|
begin
|
|
for i in 1 .. array_length(v_ziele, 1) loop
|
|
select pg_get_functiondef(p.oid) into v_def
|
|
from pg_proc p join pg_namespace n on n.oid = p.pronamespace
|
|
where n.nspname = 'public' and p.prokind = 'f' and p.proname = v_ziele[i][1];
|
|
if v_def is null then
|
|
raise exception '% ist nicht vorhanden.', v_ziele[i][1];
|
|
end if;
|
|
if position(v_ziele[i][3] in v_def) > 0 then
|
|
raise notice '% ist bereits angepasst — nichts zu tun.', v_ziele[i][1];
|
|
continue;
|
|
end if;
|
|
v_treffer := (length(v_def) - length(replace(v_def, v_ziele[i][2], ''))) / length(v_ziele[i][2]);
|
|
if v_treffer <> 1 then
|
|
raise exception '%: der Anker kommt % mal vor, erwartet genau einmal.', v_ziele[i][1], v_treffer;
|
|
end if;
|
|
execute replace(v_def, v_ziele[i][2], v_ziele[i][3]);
|
|
end loop;
|
|
end
|
|
$migration$;
|
|
|
|
do $pruefung$
|
|
declare
|
|
v_def text;
|
|
begin
|
|
if exists (select 1 from information_schema.columns
|
|
where table_schema = 'public' and table_name = 'employees'
|
|
and column_name = 'birth_date' and is_nullable = 'NO') then
|
|
raise exception 'employees.birth_date ist weiter NOT NULL.';
|
|
end if;
|
|
select pg_get_functiondef(p.oid) into v_def
|
|
from pg_proc p join pg_namespace n on n.oid = p.pronamespace
|
|
where n.nspname = 'public' and p.prokind = 'f' and p.proname = 'hire_employee';
|
|
if position($a$nullif(payload->>'birth_date', '')::date$a$ in v_def) = 0
|
|
or position('require_hr_admin()' in v_def) = 0 or position('lehrzeit_von' in v_def) = 0 then
|
|
raise exception 'hire_employee ist nicht wie erwartet angepasst.';
|
|
end if;
|
|
end
|
|
$pruefung$;
|