<?php

namespace Database\Seeders\CourierDeliverService;

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

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

    // user made payment to seller
    // seller requst J&T deliver service
    // J&T provide service to seller
    // seller pack up the parcel and wait J&T pick up
    // J&T picke up seller parcel
    // J&T deliver parcel to user
    // user recieve parcel

    public function run()
    {
        DB::table('contract_obligations')->insert([
            [
                'id' => 101,
                'user_id' => 4,
                'contract_id' => 101,
                'contract_template_obligation_id' => 101,
                'contract_entity_id' => 101,
                'name' => 'user made payment to seller',
                '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' => 102,
                'user_id' => 4,
                'contract_id' => 101,
                'contract_template_obligation_id' => 102,
                'contract_entity_id' => 102,
                'name' => 'seller requst J&T deliver service',
                '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' => 103,
                'user_id' => 4,
                'contract_id' => 101,
                'contract_template_obligation_id' => 103,
                'contract_entity_id' => 103,
                'name' => 'J&T provide service to seller',
                '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' => 104,
                'user_id' => 4,
                'contract_id' => 101,
                'contract_template_obligation_id' => 104,
                'contract_entity_id' => 102,
                'name' => 'seller pack up the parcel and wait J&T pick up',
                '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' => 105,
                'user_id' => 4,
                'contract_id' => 101,
                'contract_template_obligation_id' => 105,
                'contract_entity_id' => 103,
                'name' => 'J&T picke up seller parcel',
                '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' => 106,
                'user_id' => 4,
                'contract_id' => 101,
                'contract_template_obligation_id' => 106,
                'contract_entity_id' => 103,
                'name' => 'J&T deliver parcel 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.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' => 107,
                'user_id' => 4,
                'contract_id' => 101,
                'contract_template_obligation_id' => 107,
                'contract_entity_id' => 101,
                'name' => 'user recieve parcel',
                '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')
            ],
        ]);
    }
}