fix(core): PDF-Export — Titel aus jobTitle-Feld statt erster Erfahrung

- getExportData(): jobTitle zu den selektierten User-Feldern hinzugefuegt
- ExportData-Interface: jobTitle: string | null ergaenzt
- PDF: Unter dem Namen wird jetzt data.jobTitle angezeigt statt
  profile.experiences[0].area

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Reitz 2026-03-14 09:35:45 +01:00
parent 382beab9c3
commit 196515daa8
2 changed files with 6 additions and 5 deletions

View file

@ -310,6 +310,7 @@ export class ExpertProfileService {
postalCode: true,
city: true,
avatar: true,
jobTitle: true,
expertProfile: {
include: {
experiences: { orderBy: { createdAt: 'desc' } },

View file

@ -74,6 +74,7 @@ interface ExportData {
postalCode: string | null;
city: string | null;
avatar: string | null;
jobTitle: string | null;
expertProfile: {
skills: string[];
experiences: ExportExperience[];
@ -293,12 +294,11 @@ export class ProfileExportService {
doc.text(fullName, leftColX, yLeft, { width: leftColWidth, align: 'center' });
yLeft += doc.heightOfString(fullName, { width: leftColWidth }) + 5;
// Rolle (erste Erfahrung als Titel)
if (profile && profile.experiences.length > 0) {
const mainRole = profile.experiences[0].area;
// Titel aus dem Profil
if (data.jobTitle) {
doc.font('Helvetica').fontSize(10).fillColor(accentColor);
doc.text(mainRole, leftColX, yLeft, { width: leftColWidth, align: 'center' });
yLeft += doc.heightOfString(mainRole, { width: leftColWidth }) + 8;
doc.text(data.jobTitle, leftColX, yLeft, { width: leftColWidth, align: 'center' });
yLeft += doc.heightOfString(data.jobTitle, { width: leftColWidth }) + 8;
}
// Akzentlinie