package application;

/**
 * Apply transaction fee to all auction items
 * Created by hvu on 7/14/16.
 */
public class TransactionFeeProcessor extends AuctionClosingProcessor{
    private static final double TRANSACTION_FEE_PERCENTAGE = .02;

    public TransactionFeeProcessor(Auction auction, AuctionClosingProcessor nextProcessor){
        super(auction, nextProcessor);
    }

    public void process(){
        double transactionFee = auction.getHighestBid() * TRANSACTION_FEE_PERCENTAGE;
        auction.updateClosingBid(-transactionFee);
    }
}
