Deploy on 2026-06-06 12:04:41

This commit is contained in:
Hamza-Ayed
2026-06-06 12:04:41 +03:00
parent f468227019
commit ed60fa3ce2
5 changed files with 110 additions and 35 deletions

View File

@@ -250,7 +250,7 @@ class Collector
private function createOpportunity(array $entry, array $analysis, ?int $orgId, array $source): void
{
try {
$score = min(100, max(0, $analysis['score'] ?? 10));
$score = min(100, max(0, $analysis['fit_score'] ?? $analysis['score'] ?? 10));
$stmt = $this->pdo->prepare(
"INSERT INTO opportunities (title, description, type, organization_id, url, status, score, raw_data)
@@ -293,7 +293,7 @@ class Collector
$oppType = $analysis['opportunity_type'] ?? $analysis['type'] ?? 'other';
$importantTypes = ['vc_funding', 'accelerator', 'incubator', 'grant', 'competition'];
if ($score >= $minScore && in_array($oppType, $importantTypes)) {
if ($score >= $minScore && in_array($oppType, $importantTypes) && !empty($analysis['is_opportunity'])) {
$orgName = '';
if ($orgId) {
$orgStmt = $this->pdo->prepare("SELECT name FROM organizations WHERE id = ?");
@@ -304,10 +304,15 @@ class Collector
$this->notifier->notifyNewOpportunity([
'title' => $entry['title'],
'type' => $oppType,
'score' => $score,
'fit_score' => $score,
'url' => $entry['url'],
'description' => $analysis['summary'] ?? $entry['description'],
'org_name' => $orgName,
'why_it_matters' => $analysis['why_it_matters'] ?? [],
'requirements' => $analysis['requirements'] ?? [],
'deadline' => $analysis['deadline'] ?? null,
'effort' => $analysis['effort'] ?? 'متوسط',
'potential_return' => $analysis['potential_return'] ?? 'متوسط',
]);
}
}