Let a service unit use stock and machines
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -25,6 +25,11 @@ class ServiceUnitFactory extends Factory
|
||||
];
|
||||
}
|
||||
|
||||
public function usingStock(): static
|
||||
{
|
||||
return $this->state(fn (): array => ['uses_stock' => true]);
|
||||
}
|
||||
|
||||
public function inactive(): static
|
||||
{
|
||||
return $this->state(fn (): array => ['is_active' => false]);
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Whether stock and machine features are used in a service unit
|
||||
* (spec 19: "Varaston ja koneiden käyttö").
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('service_units', function (Blueprint $table) {
|
||||
$table->boolean('uses_stock')->default(false)->after('is_shared');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('service_units', function (Blueprint $table) {
|
||||
$table->dropColumn('uses_stock');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user