add fake data
This commit is contained in:
@@ -4,9 +4,11 @@ namespace App\Enums;
|
||||
|
||||
enum PeopleMessageActions: int
|
||||
{
|
||||
case x = 1;
|
||||
case y = 2;
|
||||
case z = 3;
|
||||
case ADAM_NIAZ_BE_SABT_MOSHKEL_RAH = 1;
|
||||
case ADAM_NIAZ_BE_SABT_MOSHKEL_HAML_NAGHL = 2;
|
||||
case ADAM_NIAZ_BE_SABT_MOSHKEL_AVAREZI = 3;
|
||||
case SABT_SAVANEH_MOSHKEL_RAH = 4;
|
||||
case SABT_SAVANEH_MOSHKEL_HAML_NAGHL = 5;
|
||||
|
||||
public static function name(int $state): string
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
@@ -17,7 +18,12 @@ class OperatorDialogueFactory extends Factory
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
'cdr_unique_id' => $this->faker->uuid(),
|
||||
'date' => $this->faker->date(),
|
||||
'supervisor_id' => User::factory(),
|
||||
'is_listen' => $this->faker->boolean(),
|
||||
'is_good' => $this->faker->boolean(),
|
||||
'description' => $this->faker->text(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\PeopleMessageActions;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
@@ -17,7 +18,16 @@ class PeopleMessageFactory extends Factory
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
'caller_phone_number' => $this->faker->numerify('09#########'),
|
||||
'date' => $this->faker->date(),
|
||||
'voice' => $this->faker->name,
|
||||
'review_duration' => $this->faker->numberBetween(30, 60),
|
||||
'listen_at' => $this->faker->dateTime,
|
||||
'is_listen' => $this->faker->boolean(),
|
||||
'action_id' => $this->faker->randomElement([PeopleMessageActions::x->value, PeopleMessageActions::y->value]),
|
||||
'action_name' => $this->faker->word(),
|
||||
'description' => $this->faker->text(),
|
||||
'savaneh_id' => $this->faker->randomElement([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,14 @@ class SystemMessageFactory extends Factory
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
'duration' => $this->faker->numberBetween(30, 60),
|
||||
'date' => $this->faker->date(),
|
||||
'voice' => $this->faker->name,
|
||||
'description' => $this->faker->text(),
|
||||
'message_quality' => $this->faker->numberBetween(0, 1),
|
||||
'format_quality' => $this->faker->numberBetween(0, 1),
|
||||
'type_id' => $this->faker->numberBetween(1, 2),
|
||||
'type_name' => $this->faker->name,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ return new class extends Migration
|
||||
$table->integer('duration');
|
||||
$table->dateTime('date');
|
||||
$table->string('voice');
|
||||
$table->string('description')->nullable();
|
||||
$table->integer('message_quality');
|
||||
$table->integer('format_quality');
|
||||
$table->integer('type_id');
|
||||
|
||||
@@ -19,7 +19,7 @@ return new class extends Migration
|
||||
$table->integer('review_duration')->nullable();
|
||||
$table->dateTime('listen_at')->nullable();
|
||||
$table->boolean('is_listen')->default(false);
|
||||
$table->foreignId('action_id')->nullable()->constrained();
|
||||
$table->foreignId('action_id')->nullable()->constrained('people_message_actions');
|
||||
$table->string('action_name')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
$table->unsignedBigInteger('savaneh_id')->nullable();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\OperatorDialogue;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
@@ -12,6 +13,6 @@ class OperatorDialogueSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
OperatorDialogue::factory()->count(10)->create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class PeopleMessageActionSeeder extends Seeder
|
||||
{
|
||||
@@ -12,6 +13,12 @@ class PeopleMessageActionSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
DB::table('people_message_actions')->insert([
|
||||
['id' => 1, 'name' => 'عدم نیاز به ثبت (مشکل راه)', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 2, 'name' => 'عدم نیاز به ثبت (مشکل حمل و نقلی)', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 3, 'name' => 'عدم نیاز به ثبت (مشکل عوارضی)', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 4, 'name' => 'ثبت سوانح (مشکل راه)', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 5, 'name' => 'ثبت سوانح (مشکل حمل و نقلی)', 'created_at' => now(), 'updated_at' => now()],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\PeopleMessage;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
@@ -12,6 +13,6 @@ class PeopleMessageSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
PeopleMessage::factory()->count(10)->create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\SystemMessage;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
@@ -12,6 +13,6 @@ class SystemMessageSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
SystemMessage::factory()->count(10)->create();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user