public interface VoucherService extends Service
| Modifier and Type | Method and Description |
|---|---|
SerializableInputStream |
barcode(VoucherBarcodeParams params)
Returns a barcode image of the token of the given voucher
|
VoucherPackWithIdsVO |
buy(BuyVouchersDTO params)
Buys one or more vouchers
|
int |
cancel(CancelVouchersDTO params)
Cancels one or more vouchers
|
void |
changeExpirationDate(ChangeVoucherExpirationDateDTO params)
Changes the voucher expiration date according to the given information.
|
SerializableInputStream |
exportToCSV(VoucherQuery params,
boolean markAsPrinted)
Returns a CSV version of all returned vouchers, optionally marking them as printed
|
VoucherPackWithIdsVO |
generate(GenerateVouchersDTO params)
Generates vouchers
|
BuyVoucherData |
getBuyData(BuyVoucherDataParams params)
Returns data used to buy a voucher
|
VoucherData |
getData(java.lang.Long id)
Returns data about a specific voucher
|
GenerateVouchersData |
getGenerateData(VoucherTypeVO voucherType)
Returns data which is needed for generating vouchers
|
RedeemVoucherData |
getRedeemData(RedeemVoucherDataParams params)
Returns data used to redeem a voucher
|
InitialRedeemVoucherData |
getRedeemInitialData(UserLocatorVO user)
Returns data for starting a voucher redeeming
|
VouchersSearchData |
getSearchData(VoucherSearchContext context,
UserLocatorVO user)
Returns data for searching vouchers, either over an user or for a general search
|
java.util.List<VoucherTypeDetailedVO> |
listTypesForBuy(UserLocatorVO forUser)
Returns the voucher types the logged user can buy vouchers to the given user (defaults to the logged user
himself)
|
java.util.List<VoucherTypeDetailedVO> |
listTypesForGenerate()
Returns the voucher types the logged administrator can generate vouchers on
|
VoucherVO |
loadByToken(java.lang.String token)
Returns a voucher by token
|
SerializableInputStream |
print(java.lang.Long id)
Returns a PDF-printable version of the voucher, and marks it as printed
|
SerializableInputStream |
printAll(VoucherQuery query,
boolean markAsPrinted)
Returns a PDF-printable version of all returned vouchers, optionally marking them as printed
|
RedeemVoucherResult |
redeem(RedeemVoucherDTO params)
Redeems a voucher, returning the generated voucher id
|
Page<VoucherVO> |
search(VoucherQuery params)
Searches for vouchers according to the given filters
|
VouchersResultsWithSummaryVO |
searchWithSummary(VoucherQuery params)
Searches for vouchers according to the given filters, also returning summaries per status
|
SerializableInputStream barcode(VoucherBarcodeParams params) throws FrameworkException
FrameworkExceptionVoucherPackWithIdsVO buy(BuyVouchersDTO params) throws FrameworkException, VoucherBuyingException, MaxTotalOpenAmountException, TransferException
BuyingNotAllowedForUserException - When the user is not in a group allowed to buy this typeBuyingMaxOpenAmountException - When the max open amount for the given user is exceededMaxTotalOpenAmountException - When the total amount of all open vouchers of this type would be exceededTransferException - When there is an error on the paymentFrameworkExceptionVoucherBuyingExceptionint cancel(CancelVouchersDTO params) throws FrameworkException
FrameworkExceptionvoid changeExpirationDate(ChangeVoucherExpirationDateDTO params) throws FrameworkException
FrameworkExceptionSerializableInputStream exportToCSV(VoucherQuery params, boolean markAsPrinted) throws FrameworkException
FrameworkExceptionVoucherPackWithIdsVO generate(GenerateVouchersDTO params) throws FrameworkException, MaxTotalOpenAmountException, TransferException
MaxTotalOpenAmountException - When the total amount of all open vouchers of this type would be exceededTransferException - When there is an error on the paymentFrameworkExceptionBuyVoucherData getBuyData(BuyVoucherDataParams params) throws FrameworkException
FrameworkExceptionVoucherData getData(java.lang.Long id) throws FrameworkException
FrameworkExceptionGenerateVouchersData getGenerateData(VoucherTypeVO voucherType) throws FrameworkException
FrameworkExceptionRedeemVoucherData getRedeemData(RedeemVoucherDataParams params) throws FrameworkException, VoucherRedeemingException
FrameworkExceptionVoucherRedeemingExceptionredeem(RedeemVoucherDTO)InitialRedeemVoucherData getRedeemInitialData(UserLocatorVO user) throws FrameworkException
FrameworkExceptionVouchersSearchData getSearchData(VoucherSearchContext context, UserLocatorVO user) throws FrameworkException
FrameworkExceptionjava.util.List<VoucherTypeDetailedVO> listTypesForBuy(UserLocatorVO forUser) throws FrameworkException
FrameworkExceptionjava.util.List<VoucherTypeDetailedVO> listTypesForGenerate() throws FrameworkException
FrameworkExceptionVoucherVO loadByToken(java.lang.String token) throws FrameworkException
FrameworkExceptionSerializableInputStream print(java.lang.Long id) throws FrameworkException
FrameworkExceptionSerializableInputStream printAll(VoucherQuery query, boolean markAsPrinted) throws FrameworkException
FrameworkExceptionRedeemVoucherResult redeem(RedeemVoucherDTO params) throws FrameworkException, VoucherRedeemingException
RedeemingNotAllowedForVoucherException - When the voucher is no longer openRedeemingNotAllowedForUserException - When the given user cannot redeem this voucherRedeemingNotAllowedYetException - When attempting to redeem a voucher before the redeem start dateRedeemingNotAllowedTodayException - When attempting to redeem a voucher in a day it is not allowedFrameworkExceptionVoucherRedeemingExceptionPage<VoucherVO> search(VoucherQuery params) throws FrameworkException
FrameworkExceptionVouchersResultsWithSummaryVO searchWithSummary(VoucherQuery params) throws FrameworkException
FrameworkException