<?php

namespace App\Http\Controllers\User\Api;

use Auth;
use Illuminate\Http\Request;

use App\Http\Modules\User\ContractObligationModule;

use App\Http\Controllers\User\BaseController;

class ContractObligationController extends BaseController
{
    public function __construct()
    {
        parent::__construct();
    }

    public function list(Request $request)
    {
    	$contract = ContractObligationModule::list($request);
    	return $contract;
    }

    public function show(Request $request, $hash_id)
    {
        $contract = ContractObligationModule::show($request, $hash_id);
        return $contract;
    }

    public function store(Request $request)
    {
        $contract = ContractObligationModule::store($request);
        return $contract;
    }

    public function assignContractEntity(Request $request, $hash_id)
    {
        $contract = ContractObligationModule::assignContractEntity($request, $hash_id);
        return $contract;
    }

    public function updateComplete(Request $request, $hash_id)
    {
        $contract = ContractObligationModule::updateComplete($request, $hash_id);
        return $contract;
    }

    public function updateAccept(Request $request, $hash_id)
    {
        $contract = ContractObligationModule::updateAccept($request, $hash_id);
        return $contract;
    }

    public function delete(Request $request, $hash_id)
    {
        $contract = ContractObligationModule::delete($request, $hash_id);
        return $contract;
    }

    public function validCheck(Request $request, $hash_id = '')
    {
        $method = empty($hash_id) ? 'POST' :'PUT';
        $valid = ContractObligationModule::validCheck($request, $hash_id, $method);
        return $valid;
    }
}
