package com.ecep.contract.controller.table.cell;

import com.ecep.contract.SpringApp;
import com.ecep.contract.model.Invoice;
import com.ecep.contract.service.IEntityService;
import com.ecep.contract.service.InvoiceService;

public class InvoiceTableCell<V> extends AsyncUpdateTableCell<V, Invoice> {

    public InvoiceTableCell(InvoiceService invoiceService) {
        setService(invoiceService);
    }

    @Override
    protected IEntityService<Invoice> getServiceBean() {
        return SpringApp.getBean(InvoiceService.class);
    }

    @Override
    public String format(Invoice entity) {
        return entity.getCode();
    }
}
