diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d5565d0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,19 @@ +# Changelog + +[Unreleased changes](https://github.com/justbetter/laravel-magento-async/compare/1.0.1...main) +## [1.0.1](https://github.com/justbetter/laravel-magento-async/releases/tag/1.0.1) - 2024-08-20 + +### What's Changed +* Only update bulk statusses if there are open operations by @VincentBean in https://github.com/justbetter/laravel-magento-async/pull/1 + +### New Contributors +* @VincentBean made their first contribution in https://github.com/justbetter/laravel-magento-async/pull/1 + +**Full Changelog**: https://github.com/justbetter/laravel-magento-async/compare/1.0.0...1.0.1 + +## [1.0.0](https://github.com/justbetter/laravel-magento-async/releases/tag/1.0.0) - 2024-07-03 + +Initial release + +**Full Changelog**: https://github.com/justbetter/laravel-magento-async/commits/1.0.0 + diff --git a/src/Actions/UpdateBulkStatuses.php b/src/Actions/UpdateBulkStatuses.php index 4d14790..2d25cee 100644 --- a/src/Actions/UpdateBulkStatuses.php +++ b/src/Actions/UpdateBulkStatuses.php @@ -15,7 +15,9 @@ public function update(): void { BulkRequest::query() ->whereHas('operations', function (Builder $query): void { - $query->where('status', '=', OperationStatus::Open); + $query + ->where('status', '=', OperationStatus::Open) + ->orWhereNull('status'); }) ->get() ->each(fn (BulkRequest $bulkRequest): PendingDispatch => UpdateBulkStatusJob::dispatch($bulkRequest)); diff --git a/tests/Actions/UpdateBulkStatusesTest.php b/tests/Actions/UpdateBulkStatusesTest.php index d1af8b9..933f9ed 100644 --- a/tests/Actions/UpdateBulkStatusesTest.php +++ b/tests/Actions/UpdateBulkStatusesTest.php @@ -54,7 +54,7 @@ public function it_can_update_bulk_statuses(): void $status2->operations()->create([ 'operation_id' => 1, - 'status' => OperationStatus::Open, + 'status' => null, ]); $status3->operations()->create([