Uebersicht: Eintritte (YTD) verweist auf dieselben Ereignistypen, die sie zaehlt
Die Kachel zaehlt Eintritt, Wiedereintritt und Uebernahme, der Verweis oeffnete den Bericht nur mit "Eintritt" - der Bericht zeigte damit weniger Ereignisse als die Kachel. Beide lesen jetzt EINTRITT_TYPEN. Geprueft: lint, tsc, Unit-Tests, Waechter.
This commit is contained in:
@@ -34,6 +34,14 @@ export type DashboardParams = {
|
||||
arten: AnstehendArt[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Was die Kachel „Eintritte (YTD)" zählt. Eine Übernahme von extern zählt wie
|
||||
* ein Eintritt, fachlich so vorgegeben: die Person kommt neu in den eigenen
|
||||
* Bestand. Der Verweis der Kachel auf die Berichte trägt dieselbe Liste —
|
||||
* sonst zeigte der Bericht eine kleinere Zahl als die Kachel.
|
||||
*/
|
||||
export const EINTRITT_TYPEN: readonly HistoryEventType[] = ["Eintritt", "Wiedereintritt", "Übernahme"];
|
||||
|
||||
export async function loadDashboardData(tx: Tx, p: DashboardParams) {
|
||||
const { userId, today, yearStart, ytdBis, bisIso, arten } = p;
|
||||
const zeigt = (art: AnstehendArt) => arten.includes(art);
|
||||
@@ -67,13 +75,9 @@ export async function loadDashboardData(tx: Tx, p: DashboardParams) {
|
||||
.orderBy("id")
|
||||
).as("staffRows"),
|
||||
|
||||
// Entries/exits count history events, which is what the linked report
|
||||
// counts too. `entry_date` would also sweep up rehires, whose event is
|
||||
// logged as 'Wiedereintritt' — the tile and its destination would then
|
||||
// show different numbers for the same year.
|
||||
// Eine Übernahme von extern zählt wie ein Eintritt, fachlich so
|
||||
// vorgegeben: die Person kommt neu in den eigenen Bestand.
|
||||
jsonObjectFrom(countIn(eb, ["Eintritt", "Wiedereintritt", "Übernahme"])).as("hiresYtd"),
|
||||
// Ein- und Austritte zählen Ereignisse der Historie, so wie der
|
||||
// verlinkte Bericht. Was dazugehört, steht bei EINTRITT_TYPEN.
|
||||
jsonObjectFrom(countIn(eb, EINTRITT_TYPEN)).as("hiresYtd"),
|
||||
jsonObjectFrom(countIn(eb, ["Austritt"])).as("exitsYtd"),
|
||||
|
||||
...orgMapsAbfragen(eb),
|
||||
|
||||
Reference in New Issue
Block a user