fix(ops): prevent automatic wipe of Stabile 0021 data without explicit reset-temp flag

This commit is contained in:
michele 2026-08-03 14:13:17 +02:00
parent 67f2055baf
commit b660353dde

View File

@ -435,7 +435,7 @@ public function handle(): int
$this->purgeAuthoritativeLegacyReplica($steps);
}
if ($this->option('stabile') === '0021' && ! $dry && in_array('unita', $steps, true)) {
if ($this->option('stabile') === '0021' && ! $this->option('update-only') && $this->option('reset-temp') && ! $dry && in_array('unita', $steps, true)) {
$this->line('⚠️ DIRETTIVA DI LIVELLO 3: Azzeramento dati Stabile 0021');
$stabileId = 4;
$unitaIds = DB::table('unita_immobiliari')->where('stabile_id', $stabileId)->pluck('id')->toArray();