package fr.eni.enchere.bll;

import fr.eni.enchere.bo.Bank;
import fr.eni.enchere.dal.BankRepository;
import org.springframework.stereotype.Service;

@Service
public class BankServiceImpl implements BankService {

    private BankRepository bankRepository;

    public BankServiceImpl(BankRepository bankRepository) {
        this.bankRepository = bankRepository;
    }

    @Override
    public Bank isValideCart(String cartNumber, String cartExpired, int cartCVV) {
        return bankRepository.verifCart(cartNumber, cartExpired, cartCVV);
    }

    @Override
    public void setCredit(Bank bank, float ammount) {
        bankRepository.editAmmountCart(bank, ammount);
    }
}
