package com.ecep.contract.controller.vendor;

import com.ecep.contract.controller.tab.TabSkin;
import com.ecep.contract.controller.table.AbstEntityTableTabSkin;
import com.ecep.contract.model.IdentityEntity;
import com.ecep.contract.service.CompanyService;
import com.ecep.contract.service.VendorService;
import com.ecep.contract.util.ParamUtils;
import com.ecep.contract.vm.CompanyVendorViewModel;
import com.ecep.contract.vm.IdentityViewModel;
import com.ecep.contract.vo.VendorVo;

public abstract class AbstVendorTableTabSkin<T extends IdentityEntity, TV extends IdentityViewModel<T>>
        extends AbstEntityTableTabSkin<VendorWindowController, VendorVo, CompanyVendorViewModel, T, TV>
        implements TabSkin {
    public AbstVendorTableTabSkin(VendorWindowController controller) {
        super(controller);
    }

    public CompanyService getCompanyService() {
        return controller.getCompanyService();
    }

    public VendorService getCompanyVendorService() {
       return getCachedBean(VendorService.class);
    }

    @Override
    public ParamUtils.Builder getSpecification(VendorVo parent) {
        ParamUtils.Builder params = getSpecification();
        params.equals("vendor", parent.getId());
        return params;
    }
}
