from pypos.core.base_controller import BaseController
from pypos.modules.customer.services.customer_service import CustomerService

class CustomerController(BaseController):
    def __init__(self):
        super().__init__()
        self.service = CustomerService()

    def get_customers(self, search_term=None):
        return self.service.get_customers(search_term)

    def count_customers(self, search_term=None):
        return self.service.count_customers(search_term)

    def get_customers_paged(self, search_term=None, limit=100, offset=0):
        return self.service.get_customers_paged(search_term, limit=limit, offset=offset)

    def add_customer(self, nama, alamat, telepon):
        return self.service.add_customer(nama, alamat, telepon)

    def update_customer(self, customer_id, nama, alamat, telepon):
        return self.service.update_customer(customer_id, nama, alamat, telepon)

    def delete_customer(self, customer_id):
        return self.service.delete_customer(customer_id)

    def get_customer_by_id(self, customer_id):
        return self.service.get_customer_by_id(customer_id)

    def load_all_customers(self):
        return self.service.load_all_customers()
