<?php


namespace App\Console\Commands\Install;

use App\Models\OrderManagement\Order;
use App\Models\OrderManagement\BillingDesk;
use App\Models\PaymentManagement\Payment;
use App\Models\ProductManagement\Category;
use App\Models\ProductManagement\Product;
use App\Models\UserManagement\Customer;
use Database\Seeders\OrderSeeder;
use Database\Seeders\PointOfSalesSeeder;
use Database\Seeders\StockSeeder;
use Database\Seeders\WarehouseSeeder;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;


class InstallDemoCommand extends Command{

    protected $signature = 'install:demo';
    protected $description = "";

    public function handle(){

        Category::factory(5)->create();
        echo __("5 Products Categories created\n");

        Product::factory(100)->create();
        echo __("100 Products created\n");

        Artisan::call("db:seed",['class' => WarehouseSeeder::class]);
        Artisan::call("db:seed",['class' => StockSeeder::class]);

        Customer::factory(50)->has(Payment::factory(),"payments")->create();
        echo __("50 Customers  with payments created\n");

        Artisan::call("db:seed",['class' => PointOfSalesSeeder::class]);

        Artisan::call("db:seed",['class' => OrderSeeder::class]);

        Customer::factory(10)->create();
        echo __("10 Customers  without payments created\n");

        Order::factory(10)->create();
        echo __("10 Orders created\n");




    }
}
