<?php

namespace Database\Seeders\SodaVendorMachine;

use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;

class SodaVendorContractObligationsTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */

    // user insert coin and select soda at vendor machine
    // vendor machine drop selected soda to user
    // user pickup the soda

    public function run()
    {
        DB::table('contract_obligations')->insert([
            [
                'id' => 1,
                'user_id' => 2,
                'contract_id' => 1,
                'contract_template_obligation_id' => 1,
                'contract_entity_id' => 1,
                'name' => 'user insert coin and select soda at vendor machine',
                'reference' => null,
                'content' => null,
                'must_complete' => 1,
                'must_accept' => 1,
                'complete_status' => config('constants.contract_obligation.complete_status.pending'),
                'accept_status' => config('constants.contract_obligation.accept_status.pending'),
                'type' => config('constants.contract_obligation.type.money'),
                'in_time_contract_obligation_template' => json_encode([]),
                'status' => 1,
                'completed_at' => null,
                'failed_at' => null,
                'start_at' => Carbon::now(),
                'end_at' => Carbon::now()->addDays(1),
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s')
            ],
            [
                'id' => 2,
                'user_id' => 2,
                'contract_id' => 1,
                'contract_template_obligation_id' => 2,
                'contract_entity_id' => 2,
                'name' => 'vendor machine drop selected soda to user',
                'reference' => null,
                'content' => null,
                'must_complete' => 1,
                'must_accept' => 1,
                'complete_status' => config('constants.contract_obligation.complete_status.pending'),
                'accept_status' => config('constants.contract_obligation.accept_status.pending'),
                'type' => config('constants.contract_obligation.type.offer_service'),
                'in_time_contract_obligation_template' => json_encode([]),
                'status' => 1,
                'completed_at' => null,
                'failed_at' => null,
                'start_at' => null,
                'end_at' => null,
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s')
            ],
            [
                'id' => 3,
                'user_id' => 2,
                'contract_id' => 1,
                'contract_template_obligation_id' => 3,
                'contract_entity_id' => 2,
                'name' => 'user pickup the soda',
                'reference' => null,
                'content' => null,
                'must_complete' => 1,
                'must_accept' => 1,
                'complete_status' => config('constants.contract_obligation.complete_status.pending'),
                'accept_status' => config('constants.contract_obligation.accept_status.pending'),
                'type' => config('constants.contract_obligation.type.offer_service'),
                'in_time_contract_obligation_template' => json_encode([]),
                'status' => 1,
                'completed_at' => Carbon::now(),
                'failed_at' => null,
                'start_at' => null,
                'end_at' => null,
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s')
            ]
        ]);
    }
}