/*
 * 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.BankCardController;
import com.arrebol.taxiservicios.model.catalog.BankCard;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.view.ViewScoped;
import javax.inject.Named;

/**
 *
 * @author oscarvargas
 */

@Named("bankCardService")
@ViewScoped
public class BankCardService extends TaxiGenericBean implements Serializable {

    public List<BankCard> fillDatatable() {

        return bankCardCtrl.fillDatatable(getLoggedUser().getLocation());
    }

    public void saveService(BankCard bankCard) {

        bankCardCtrl.save(bankCard, getLoggedUser().getId());
    }

    public void deleteService(BankCard bankCard) {

        bankCardCtrl.delete(bankCard, getLoggedUser().getId());
    }

    private static final long serialVersionUID = 7670976225629181515L;

    private BankCardController bankCardCtrl;

    @PostConstruct
    public void init() {
        bankCardCtrl = new BankCardController();
    }

}
