<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        \Illuminate\Support\Facades\DB::table('users')->insert([
            'name' => 'Administrator',
            'username' => 'admin',
            'password' => bcrypt('password'),
            'role' => 'admin',
            'status' => true,
            'created_at' => now(),
            'updated_at' => now(),
        ]);

        \Illuminate\Support\Facades\DB::table('users')->insert([
            'name' => 'Kasir Utama',
            'username' => 'kasir',
            'password' => bcrypt('password'),
            'role' => 'cashier',
            'status' => true,
            'created_at' => now(),
            'updated_at' => now(),
        ]);

        $categories = ['Bebas', 'Bebas Terbatas', 'Keras', 'Narkotika'];
        foreach($categories as $cat) {
            \Illuminate\Support\Facades\DB::table('categories')->insert(['name' => $cat, 'created_at' => now(), 'updated_at' => now()]);
        }

        $units = ['Strip', 'Tablet', 'Botol', 'Tube', 'Box'];
        foreach($units as $unit) {
            \Illuminate\Support\Facades\DB::table('units')->insert(['name' => $unit, 'created_at' => now(), 'updated_at' => now()]);
        }

        \Illuminate\Support\Facades\DB::table('suppliers')->insert([
            'name' => 'PT. Kimia Farma',
            'contact' => '081234567890',
            'address' => 'Jl. Kesehatan No. 1',
            'created_at' => now(),
            'updated_at' => now(),
        ]);
    }
}
