diff --git a/app/Http/Controllers/V2/Terrafund/TerrafundClipGeometryController.php b/app/Http/Controllers/V2/Terrafund/TerrafundClipGeometryController.php index 04205eda..b9e699c8 100644 --- a/app/Http/Controllers/V2/Terrafund/TerrafundClipGeometryController.php +++ b/app/Http/Controllers/V2/Terrafund/TerrafundClipGeometryController.php @@ -32,6 +32,7 @@ public function clipOverlappingPolygonsBySite(string $uuid) 'entity_id' => $site->id, 'entity_type' => get_class($site), 'is_acknowledged' => false, + 'name' => 'Polygon Fix', ]); $job = new FixPolygonOverlapJob($delayedJob->id, $polygonUuids, $user->id); dispatch($job); @@ -89,6 +90,7 @@ public function clipOverlappingPolygonsOfProjectBySite(string $uuid) 'entity_type' => get_class($sitePolygon), 'created_by' => $user->id, 'is_acknowledged' => false, + 'name' => 'Polygon Fix', ]); $job = new FixPolygonOverlapJob($delayedJob->id, $uniquePolygonUuids, $user->id); dispatch($job); @@ -148,6 +150,7 @@ public function clipOverlappingPolygons(Request $request) 'entity_type' => get_class($entity), 'created_by' => $user->id, 'is_acknowledged' => false, + 'name' => 'Polygon Fix', ]); $job = new FixPolygonOverlapJob($delayedJob->id, $polygonUuids, $user->id); dispatch($job); diff --git a/app/Http/Controllers/V2/Terrafund/TerrafundCreateGeometryController.php b/app/Http/Controllers/V2/Terrafund/TerrafundCreateGeometryController.php index a2e41ca2..bddbd5c1 100755 --- a/app/Http/Controllers/V2/Terrafund/TerrafundCreateGeometryController.php +++ b/app/Http/Controllers/V2/Terrafund/TerrafundCreateGeometryController.php @@ -245,6 +245,7 @@ function ($attribute, $value, $fail) { 'entity_id' => $entity->id, 'entity_type' => get_class($entity), 'is_acknowledged' => false, + 'name' => 'Polygon Upload', ]); $job = new InsertGeojsonToDBJob( @@ -412,6 +413,7 @@ public function uploadShapefile(Request $request) 'entity_id' => $entity->id, 'entity_type' => get_class($entity), 'is_acknowledged' => false, + 'name' => 'Polygon Upload', ]); $job = new InsertGeojsonToDBJob( @@ -639,6 +641,7 @@ public function uploadGeoJSONFile(Request $request) 'entity_id' => $entity->id, 'entity_type' => get_class($entity), 'is_acknowledged' => false, + 'name' => 'Polygon Upload', ]); $job = new InsertGeojsonToDBJob( @@ -1251,6 +1254,7 @@ public function runSiteValidationPolygon(Request $request) 'entity_id' => $entity->id, 'entity_type' => get_class($entity), 'is_acknowledged' => false, + 'name' => 'Polygon validation', ]); $job = new RunSitePolygonsValidationJob($delayedJob->id, $sitePolygonsUuids); dispatch($job); @@ -1280,6 +1284,7 @@ public function runPolygonsValidation(Request $request) 'entity_id' => $entity->id, 'entity_type' => get_class($entity), 'is_acknowledged' => false, + 'name' => 'Polygon validation', ]); $job = new RunSitePolygonsValidationJob($delayedJob->id, $uuids); dispatch($job); diff --git a/app/Models/DelayedJob.php b/app/Models/DelayedJob.php index 497f4e0a..51e547df 100644 --- a/app/Models/DelayedJob.php +++ b/app/Models/DelayedJob.php @@ -18,7 +18,7 @@ class DelayedJob extends Model protected $table = 'delayed_jobs'; - protected $fillable = ['uuid', 'status', 'status_code', 'payload', 'entity_type', 'entity_id', 'created_by', 'is_acknowledged']; + protected $fillable = ['uuid', 'status', 'status_code', 'payload', 'entity_type', 'entity_id', 'created_by', 'is_acknowledged', 'name']; protected $casts = [ 'uuid' => 'string', diff --git a/database/migrations/2024_12_17_150134_add_name_to_jobs.php b/database/migrations/2024_12_17_150134_add_name_to_jobs.php new file mode 100644 index 00000000..edc2c5c1 --- /dev/null +++ b/database/migrations/2024_12_17_150134_add_name_to_jobs.php @@ -0,0 +1,27 @@ +string('name')->nullable()->after('id'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('delayed_jobs', function (Blueprint $table) { + $table->dropColumn('name'); + }); + } +};