Package rs.etf.sab.operations
Interface TransactionOperations
-
public interface TransactionOperations
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.math.BigDecimal
getAmmountThatBuyerPayedForOrder(int orderId)
Gets sum that buyer payed for an orderjava.math.BigDecimal
getAmmountThatShopRecievedForOrder(int shopId, int orderId)
Gets sum that shop recieved for an orderjava.math.BigDecimal
getBuyerTransactionsAmmount(int buyerId)
Gets sum of all transactions amounts for buyerjava.math.BigDecimal
getShopTransactionsAmmount(int shopId)
Gets sum of all transactions amounts for shopjava.math.BigDecimal
getSystemProfit()
Gets system profit.java.util.Calendar
getTimeOfExecution(int transactionId)
get transaction's execution time.java.math.BigDecimal
getTransactionAmount(int transactionId)
Gets transaction's amount.int
getTransactionForBuyersOrder(int orderId)
Gets transaction that buyer made for paying an order.int
getTransactionForShopAndOrder(int orderId, int shopId)
Gets transaction for recieved order that system made to shop.java.util.List<java.lang.Integer>
getTransationsForBuyer(int buyerId)
Gets all transactions for buyerjava.util.List<java.lang.Integer>
getTransationsForShop(int shopId)
Gets all transactions for shop
-
-
-
Method Detail
-
getBuyerTransactionsAmmount
java.math.BigDecimal getBuyerTransactionsAmmount(int buyerId)
Gets sum of all transactions amounts for buyer- Parameters:
buyerId
- buyer's id- Returns:
- sum of all transactions, 0 if there are not transactions, -1 if failure
-
getShopTransactionsAmmount
java.math.BigDecimal getShopTransactionsAmmount(int shopId)
Gets sum of all transactions amounts for shop- Parameters:
shopId
- shop's id- Returns:
- sum of all transactions, 0 if there are not transactions, -1 if failure
-
getTransationsForBuyer
java.util.List<java.lang.Integer> getTransationsForBuyer(int buyerId)
Gets all transactions for buyer- Parameters:
buyerId
- buyer id- Returns:
- list of transations ids, null if failure
-
getTransactionForBuyersOrder
int getTransactionForBuyersOrder(int orderId)
Gets transaction that buyer made for paying an order.- Parameters:
orderId
- order's id- Returns:
- transaction's id, -1 if failure
-
getTransactionForShopAndOrder
int getTransactionForShopAndOrder(int orderId, int shopId)
Gets transaction for recieved order that system made to shop.- Parameters:
orderId
- order's idshopId
- shop's id- Returns:
- transaction's id, -1 if failure
-
getTransationsForShop
java.util.List<java.lang.Integer> getTransationsForShop(int shopId)
Gets all transactions for shop- Parameters:
shopId
- buyer id- Returns:
- list of transations ids, null if failure
-
getTimeOfExecution
java.util.Calendar getTimeOfExecution(int transactionId)
get transaction's execution time. Execution time must be equal to order's recieve time.- Parameters:
transactionId
- transaction's id- Returns:
- time of execution, null if payment is not done or if failure
-
getAmmountThatBuyerPayedForOrder
java.math.BigDecimal getAmmountThatBuyerPayedForOrder(int orderId)
Gets sum that buyer payed for an order- Parameters:
orderId
- order's id- Returns:
- ammount buyer payed for an order
-
getAmmountThatShopRecievedForOrder
java.math.BigDecimal getAmmountThatShopRecievedForOrder(int shopId, int orderId)
Gets sum that shop recieved for an order- Parameters:
shopId
- shop's idorderId
- order's id- Returns:
- ammount shop recieved for an order
-
getTransactionAmount
java.math.BigDecimal getTransactionAmount(int transactionId)
Gets transaction's amount.- Parameters:
transactionId
- transaction's id- Returns:
- ammount that is transferd via transaction
-
getSystemProfit
java.math.BigDecimal getSystemProfit()
Gets system profit. System profit calculation is based only on arrived orders.- Returns:
- system profit.
-
-