This commit is contained in:
Matthias Hochmeister
2026-03-13 21:01:54 +01:00
parent ab29c43735
commit b7b4fe2fc9
14 changed files with 566 additions and 60 deletions

View File

@@ -36,7 +36,6 @@ class MemberService {
-- profile columns (aliased with mp_ prefix to avoid collision)
mp.id AS mp_id,
mp.user_id AS mp_user_id,
mp.mitglieds_nr AS mp_mitglieds_nr,
mp.fdisk_standesbuch_nr AS mp_fdisk_standesbuch_nr,
mp.dienstgrad AS mp_dienstgrad,
mp.dienstgrad_seit AS mp_dienstgrad_seit,
@@ -54,6 +53,11 @@ class MemberService {
mp.schuhgroesse AS mp_schuhgroesse,
mp.bemerkungen AS mp_bemerkungen,
mp.bild_url AS mp_bild_url,
mp.geburtsort AS mp_geburtsort,
mp.geschlecht AS mp_geschlecht,
mp.beruf AS mp_beruf,
mp.wohnort AS mp_wohnort,
mp.plz AS mp_plz,
mp.created_at AS mp_created_at,
mp.updated_at AS mp_updated_at
FROM users u
@@ -83,7 +87,6 @@ class MemberService {
? {
id: row.mp_id,
user_id: row.mp_user_id,
mitglieds_nr: row.mp_mitglieds_nr,
fdisk_standesbuch_nr: row.mp_fdisk_standesbuch_nr ?? null,
dienstgrad: row.mp_dienstgrad,
dienstgrad_seit: row.mp_dienstgrad_seit,
@@ -101,6 +104,11 @@ class MemberService {
schuhgroesse: row.mp_schuhgroesse,
bemerkungen: row.mp_bemerkungen,
bild_url: row.mp_bild_url,
geburtsort: row.mp_geburtsort ?? null,
geschlecht: row.mp_geschlecht ?? null,
beruf: row.mp_beruf ?? null,
wohnort: row.mp_wohnort ?? null,
plz: row.mp_plz ?? null,
created_at: row.mp_created_at,
updated_at: row.mp_updated_at,
}
@@ -137,7 +145,6 @@ class MemberService {
OR u.email ILIKE $${paramIdx}
OR u.given_name ILIKE $${paramIdx}
OR u.family_name ILIKE $${paramIdx}
OR mp.mitglieds_nr ILIKE $${paramIdx}
)`);
values.push(`%${search}%`);
paramIdx++;
@@ -168,7 +175,6 @@ class MemberService {
u.profile_picture_url,
u.is_active,
mp.id AS profile_id,
mp.mitglieds_nr,
mp.fdisk_standesbuch_nr,
mp.dienstgrad,
mp.funktion,
@@ -204,7 +210,6 @@ class MemberService {
profile_picture_url: row.profile_picture_url,
is_active: row.is_active,
profile_id: row.profile_id ?? null,
mitglieds_nr: row.mitglieds_nr ?? null,
fdisk_standesbuch_nr: row.fdisk_standesbuch_nr ?? null,
dienstgrad: row.dienstgrad ?? null,
funktion: row.funktion ?? [],
@@ -286,7 +291,6 @@ class MemberService {
const query = `
INSERT INTO mitglieder_profile (
user_id,
mitglieds_nr,
fdisk_standesbuch_nr,
dienstgrad,
dienstgrad_seit,
@@ -306,14 +310,13 @@ class MemberService {
bild_url
) VALUES (
$1, $2, $3, $4, $5, $6, $7, $8, $9, $10,
$11, $12, $13, $14, $15, $16, $17, $18, $19
$11, $12, $13, $14, $15, $16, $17, $18
)
RETURNING *
`;
const values = [
userId,
data.mitglieds_nr ?? null,
data.fdisk_standesbuch_nr ?? null,
data.dienstgrad ?? null,
data.dienstgrad_seit ?? null,
@@ -392,7 +395,6 @@ class MemberService {
let paramIdx = 1;
const fieldMap: Record<string, any> = {
mitglieds_nr: rest.mitglieds_nr,
fdisk_standesbuch_nr: rest.fdisk_standesbuch_nr,
funktion: rest.funktion,
status: rest.status,