Subversion Repositories SmartDukaan

Rev

Rev 2976 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package in.shop2020.payment.persistence;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import in.shop2020.payment.domain.Payment;
//import in.shop2020.payments.Payment;
import in.shop2020.payment.domain.PaymentAttribute;

public interface PaymentMapper {
        int insertPayment(Payment payment);
        
        void updatePayment(Payment payment);

        // TODO: All getPayment methods currently employ the simple N+1 strategy to
        // load the attributes. This is not desirable. Instead, more labour should
        // be spent into writing the long result maps which will use a single query.
        Payment getPayment(long id);
        
        List<Payment> getPaymentsForUser(@Param("userId") long userId,
                        @Param("fromTime") String fromTime, @Param("toTime") String toTime,
                        @Param("status") int status, @Param("gatewayId") long gatewayId);
        
        List<Payment> getPayments(@Param("fromTime") String fromTime, @Param("toTime") String toTime,
                        @Param("status") int status, @Param("gatewayId") long gatewayId);
        
        List<Payment> getPaymentForTxn(long merchantTxnId);
        
        Map<String, Float> getMinMaxPaymentAmount();
        
        List<PaymentAttribute> getAttributesForPayment(long id);
        
        void insertPaymentAttribute(@Param("paymentId") long paymentId,
                        @Param("name") String name, @Param("value") String value);
}