package com.ecep.contract.controller.vendor;

import java.util.Map;

import com.ecep.contract.controller.tab.TabSkin;
import com.ecep.contract.controller.table.AbstEntityTableTabSkin;
import com.ecep.contract.model.CompanyVendor;
import com.ecep.contract.model.IdentityEntity;
import com.ecep.contract.service.CompanyService;
import com.ecep.contract.service.CompanyVendorService;
import com.ecep.contract.vm.CompanyVendorViewModel;
import com.ecep.contract.vm.IdentityViewModel;

public abstract class AbstCompanyVendorTableTabSkin<T extends IdentityEntity, TV extends IdentityViewModel<T>>
        extends AbstEntityTableTabSkin<CompanyVendorWindowController, CompanyVendor, CompanyVendorViewModel, T, TV>
        implements TabSkin {
    public AbstCompanyVendorTableTabSkin(CompanyVendorWindowController controller) {
        super(controller);
    }

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

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

    @Override
    public Map<String, Object> getSpecification(CompanyVendor parent) {
        Map<String,Object> params = getSpecification();
        params.put("vendor", parent.getId());
        return params;
    }
}
