/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.arrebol.taxiservicios.services.catalog;

import com.arrebol.taxiservicios.beans.TaxiGenericBean;
import com.arrebol.taxiservicios.controller.catalog.ColorController;
import com.arrebol.taxiservicios.model.catalog.Color;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.view.ViewScoped;
import javax.inject.Named;

/**
 *
 * @author oscarvargas
 */
@Named("colorService")
@ViewScoped
public class ColorService extends TaxiGenericBean implements Serializable {

    public List<Color> fillDatatableColor() {

        return colorCtrl.fillColorDatatable();
    }

    public void saveColorService(Color color) {

        colorCtrl.saveColor(color, getLoggedUser().getId());
    }

    public void deleteColorService(Color color) {

        colorCtrl.deleteColor(color);
    }

    private static final long serialVersionUID = 7670976225629181515L;

    private ColorController colorCtrl;

    @PostConstruct
    public void init() {
        colorCtrl = new ColorController();
    }

}
