Skip to content

Commit

Permalink
Deactivate auditing for time entries in importer
Browse files Browse the repository at this point in the history
  • Loading branch information
korridor committed Sep 16, 2024
1 parent 37400d2 commit 5c6b32d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public function importData(string $data, string $timezone): void
]);
}
$timeEntry = new TimeEntry;
$timeEntry->disableAuditing();
$timeEntry->user_id = $userId;
$timeEntry->member_id = $memberId;
$timeEntry->task_id = $taskId;
Expand Down
1 change: 1 addition & 0 deletions app/Service/Import/Importers/SolidtimeImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ public function importData(string $data, string $timezone): void
$taskId = $this->taskImportHelper->getKeyByExternalIdentifier($timeEntryRow['task_id']);
}
$timeEntry = new TimeEntry;
$timeEntry->disableAuditing();
$timeEntry->user_id = $userId;
$timeEntry->member_id = $memberId;
$timeEntry->task_id = $taskId;
Expand Down
1 change: 1 addition & 0 deletions app/Service/Import/Importers/TogglTimeEntriesImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public function importData(string $data, string $timezone): void
]);
}
$timeEntry = new TimeEntry;
$timeEntry->disableAuditing();
$timeEntry->user_id = $userId;
$timeEntry->member_id = $memberId;
$timeEntry->task_id = $taskId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function test_import_of_test_file_succeeds(): void
$queryLog = DB::getQueryLog();

// Assert
$this->assertCount(23, $queryLog);
$this->assertCount(21, $queryLog);
$testScenario = $this->checkTestScenarioAfterImportExcludingTimeEntries();
$this->checkTimeEntries($testScenario);
$this->assertSame(2, $report->timeEntriesCreated);
Expand Down Expand Up @@ -67,7 +67,7 @@ public function test_import_of_test_file_twice_succeeds(): void
$queryLog = DB::getQueryLog();

// Assert
$this->assertCount(15, $queryLog);
$this->assertCount(13, $queryLog);
$testScenario = $this->checkTestScenarioAfterImportExcludingTimeEntries();
$this->checkTimeEntries($testScenario, true);
$this->assertSame(2, $report->timeEntriesCreated);
Expand Down

0 comments on commit 5c6b32d

Please sign in to comment.