legacy: --since-Delta für legacy:import + Importer setzen Timestamps wieder korrekt

--since=<Zeitpunkt> schränkt den Quell-Scan auf Legacy-Zeilen ein, deren
created_at ODER updated_at im Fenster liegt (users/companies/contacts/
press-releases; Kategorien und link-associations bleiben ungefiltert).
Kombiniert mit --force werden geänderte Bestandszeilen aktualisiert —
damit dauert ein Tages-Delta Sekunden statt eines Volldurchlaufs über
150k+ Zeilen.

Dazu Bugfix, der den Delta erst rund macht: User-/Company-/Contact-
Importer übergaben created_at/updated_at innerhalb von updateOrCreate —
die Felder sind nicht fillable und wurden stillschweigend verworfen
(Live-Befund: NULL-Timestamps, bisher nur durch legacy:fix-timestamps
geheilt). Jetzt explizit per forceFill wie im PressReleaseImporter.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-07-20 13:03:07 +00:00
parent 263f030a6e
commit 4668cfc9fe
8 changed files with 136 additions and 11 deletions

View file

@ -3,9 +3,14 @@
namespace App\Services\Import;
use App\Enums\Portal;
use Illuminate\Support\Carbon;
/**
* Hält den Kontext für einen Import-Lauf.
*
* `since` schränkt den Quell-Scan auf Legacy-Zeilen ein, deren
* created_at ODER updated_at ab dem Stichtag liegt (Delta-Läufe) —
* Kategorien und link-associations bleiben davon unberührt.
*/
final class ImportContext
{
@ -17,6 +22,7 @@ final class ImportContext
public readonly string $portal, // 'presseecho' | 'businessportal24' | 'all'
public readonly bool $dryRun = false,
public readonly bool $force = false,
public readonly ?Carbon $since = null,
) {
if ($portal === 'all') {
$this->portalEnum = null;