feat(scanner): Funde mit Akquise und Opportunities abgleichen

Neu gefundene Projekte mit Treffer werden einmalig per gpt-5.6-luna mit den
Akquise-Eintraegen und Opportunities der letzten N Tage (Vorgabe 14)
verglichen. Passt ein Eintrag, zeigt der Scanner "bereits beworben!" samt
Begruendung. Schalter und Zeitraum (Tage/Wochen) in Einstellungen -> Scanner,
Neupruefung von Hand im Detail.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sascha Wolf
2026-09-17 17:12:17 +02:00
co-authored by Claude Opus 5
parent 87ca52a34b
commit af3ca33743
15 changed files with 549 additions and 10 deletions
+30
View File
@@ -45,6 +45,36 @@ const Project = sequelize.define('Project', {
allowNull: true,
field: 'published_at',
},
// Abgleich mit Akquise und Opportunities (services/appliedCheck.js). Die
// Spalten zieht initScannerDatabase() per ALTER TABLE nach.
alreadyApplied: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
field: 'already_applied',
},
appliedRefs: {
type: DataTypes.TEXT,
allowNull: true,
field: 'applied_refs',
comment: 'JSON array: [{ type, id, title, consultant, reason }]',
get() {
const rawValue = this.getDataValue('appliedRefs');
try {
return rawValue ? JSON.parse(rawValue) : [];
} catch {
return [];
}
},
set(value) {
this.setDataValue('appliedRefs', value ? JSON.stringify(value) : null);
},
},
appliedCheckAt: {
type: DataTypes.DATE,
allowNull: true,
field: 'applied_check_at',
},
}, {
tableName: 'projects',
indexes: [