User ID and Username carry the Alpenwerk UUID
All checks were successful
CI / Lint, Typen, Tests, Build (push) Successful in 11m2s
CI / Migrationen auf leerer Datenbank (push) Successful in 10m6s

Both columns now hold employees.id, and they hold the same value: in
Alpenwerk the user name and the user id never diverge. If they did,
Cornerstone would show two identities for one person and every
reference to them -- manager, reports -- could hit the wrong one.

The UUID rather than the personnel number, because it is the identifier
that never changes. A personnel number can be corrected, and the person
would then be somebody else in Cornerstone.

Local System ID keeps the personnel number as LOGA assigns it, which is
what that column is for. Customfield ID AD keeps the directory account
name (vorname.nachname); it is a separate thing from the Cornerstone
user name and always was.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-27 20:25:41 +02:00
parent 410acfe01f
commit 6717412c9f
2 changed files with 60 additions and 10 deletions

View File

@@ -30,6 +30,8 @@ import { toCsv } from "@/lib/export";
const VORGABE =
"User ID,Local System ID,Prefix,First Name,Middle Name,Last Name,Suffix,Username,Approver,Manager,Absent,Allow Reconciliation,Email,Required Training Approvals,Gender,Exempt,Ethnicity,Months of Service,Compensation Currency,Address Line 1,Address Line 2,City,State,Zip,Mailstop,Country,Original Hire Date,Last Hire Date,Phone,Mobile,Home Phone,Fax,Status,User activation date,User de-activation date,Personal Email,Language,Time Zone,User Type,Employment Status,Leave Reason,Termination Type,Termination Reason,Termination Date,Eligible For Rehire,Rehired Employee,Division ID,Position ID,Grade ID,Cost Center ID,Location ID,Retention Rules,Organisationsstufe,Customfield ID AD,Customfield ID Doxis,Customfield ID Interflex,Customfield ID LGVplus";
const UUID = "8f2b1c40-9d3e-4a77-b2c1-5e6f70a81234";
const kontext: CornerstoneKontext = {
managerNummer: new Map([["chef", 1000]]),
kostenstelle: new Map([["pos-1", { id: "k", code: "41130", name: "Waffelproduktion" }]]),
@@ -37,7 +39,7 @@ const kontext: CornerstoneKontext = {
function person(teil: Partial<CornerstoneQuelle> = {}): CornerstoneQuelle {
return {
id: "e1",
id: UUID,
personnel_number: 9002,
first_name: "Max",
last_name: "Alpentest",
@@ -140,7 +142,7 @@ describe("Eine Zeile gegen das Muster vom 27.09.2026", () => {
"Local System ID": "9002",
"First Name": "Max",
"Last Name": "Alpentest",
Username: "max.alpentest",
Username: UUID,
Email: "m.test@alpenwerk.test.com",
Gender: "male",
"Compensation Currency": "EUR",
@@ -235,6 +237,36 @@ describe("Abhängige Felder", () => {
});
});
describe("Benutzername und Benutzer-ID", () => {
it("tragen denselben Wert", () => {
// In Alpenwerk sind die beiden stets im Gleichklang. Liefen sie
// auseinander, zeigte Cornerstone zwei Kennungen für eine Person, und
// jeder Verweis darauf (Manager, Berichte) träfe womöglich die falsche.
const z = zeile();
expect(z.Username).toBe(z["User ID"]);
});
it("sind die UUID aus Alpenwerk, nicht die Personalnummer", () => {
// Die UUID aendert sich nie; eine Personalnummer kann berichtigt werden,
// und dann waere die Person in Cornerstone eine andere.
const z = zeile();
expect(z["User ID"]).toBe(UUID);
expect(z.Username).toBe(UUID);
});
it("fuehren die LOGA-Personalnummer in Local System ID", () => {
expect(zeile()["Local System ID"]).toBe("9002");
});
it("lassen den Anmeldenamen im Customfield AD stehen", () => {
// Der Verzeichnisdienst kennt die Person unter vorname.nachname; das ist
// nicht der Username in Cornerstone, sondern eine eigene Angabe.
const z = zeile();
expect(z["Customfield ID AD"]).toBe("max.alpentest");
expect(z["Customfield ID AD"]).not.toBe(z.Username);
});
});
describe("Kennungen statt Namen", () => {
it("verweist auf die vorgesetzte Person über deren Personalnummer", () => {
// Cornerstone verknüpft über die User ID, nicht über den Namen.