<?php

namespace Modules\Customer\Http\Controllers;

use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Modules\Customer\Http\Requests\AddCustomerCustomer;
use Modules\Customer\Services\CustomerService;
use Modules\Customer\Services\NewCustomerService;

class CustomerController extends Controller
{
   protected  $service;
   protected  $newCustomerService;

   public function __construct(CustomerService $customerService ,NewCustomerService $newCustomerService)
   {
       $this->service=$customerService;
       $this->newCustomerService=$newCustomerService;
       $this->middleware('auth:sanctum')->except([]);
   }

    public function customersList()
    {
        return $this->service->list();
   }
   public function newCustomersList()
    {
        return $this->newCustomerService->list();
   }
   public function chequeCustomersList()
    {
        return $this->service->chequeCustomers();
   }

    public function  deleteCustomer($id)
    {
        return $this->service->delete($id);
   }
   public function  deleteNewCustomer($id)
    {
        return $this->newCustomerService->delete($id);
   }
   public function  showCustomer($id)
    {
        return $this->service->show($id);
   }

   public function  showNewCustomer($id)
    {
        return $this->newCustomerService->show($id);
   }
   public function  addCustomer(AddCustomerCustomer $request)
    {
        return $this->service->add($request);
   }
   public function  addNewCustomer(Request $request)
    {
        return $this->newCustomerService->add($request);
   }
}
