public interface VoucherService extends Service
| Modifier and Type | Method and Description |
|---|---|
SerializableInputStream |
barcode(@NotNull VoucherBarcodeParams params)
Returns a barcode image of the token of the given voucher
|
VoucherPackWithIdsVO |
buy(@NotNull BuyVouchersDTO params)
Buys one or more vouchers
|
int |
cancel(@NotNull CancelVouchersDTO params)
Cancels one or more vouchers
|
void |
changeExpirationDate(@NotNull ChangeVoucherExpirationDateDTO params)
Changes the voucher expiration date according to the given information.
|
SerializableInputStream |
exportToCSV(@NotNull VoucherQuery params,
boolean markAsPrinted)
Returns a CSV version of all returned vouchers, optionally marking them as printed
|
VoucherPackWithIdsVO |
generate(@NotNull GenerateVouchersDTO params)
Generates vouchers
|
BuyVoucherData |
getBuyData(@NotNull BuyVoucherDataParams params)
Returns data used to buy a voucher
|
VoucherData |
getData(@NotNull java.lang.Long id)
Returns data about a specific voucher
|
GenerateVouchersData |
getGenerateData(@NotNull VoucherTypeVO voucherType)
Returns data which is needed for generating vouchers
|
RedeemVoucherData |
getRedeemData(@NotNull 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 a 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(@NotNull java.lang.String token)
Returns a voucher by token
|
SerializableInputStream |
print(@NotNull java.lang.Long id)
Returns a PDF-printable version of the voucher, and marks it as printed
|
SerializableInputStream |
printAll(@NotNull VoucherQuery query,
boolean markAsPrinted)
Returns a PDF-printable version of all returned vouchers, optionally marking them as printed
|
RedeemVoucherResult |
redeem(@NotNull RedeemVoucherDTO params)
Redeems a voucher, returning the generated voucher id
|
Page<VoucherVO> |
search(@NotNull VoucherQuery params)
Searches for vouchers according to the given filters
|
VouchersResultsWithSummaryVO |
searchWithSummary(@NotNull VoucherQuery params)
Searches for vouchers according to the given filters, also returning summaries per status
|
SerializableInputStream barcode(@NotNull @NotNull VoucherBarcodeParams params) throws FrameworkException
FrameworkExceptionVoucherPackWithIdsVO buy(@NotNull @NotNull 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(@NotNull
@NotNull CancelVouchersDTO params)
throws FrameworkException
FrameworkExceptionvoid changeExpirationDate(@NotNull
@NotNull ChangeVoucherExpirationDateDTO params)
throws FrameworkException
FrameworkExceptionSerializableInputStream exportToCSV(@NotNull @NotNull VoucherQuery params, boolean markAsPrinted) throws FrameworkException
FrameworkExceptionVoucherPackWithIdsVO generate(@NotNull @NotNull 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(@NotNull @NotNull BuyVoucherDataParams params) throws FrameworkException
FrameworkExceptionVoucherData getData(@NotNull @NotNull java.lang.Long id) throws FrameworkException
FrameworkExceptionGenerateVouchersData getGenerateData(@NotNull @NotNull VoucherTypeVO voucherType) throws FrameworkException
FrameworkExceptionRedeemVoucherData getRedeemData(@NotNull @NotNull 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(@NotNull @NotNull java.lang.String token) throws FrameworkException
FrameworkExceptionSerializableInputStream print(@NotNull @NotNull java.lang.Long id) throws FrameworkException
FrameworkExceptionSerializableInputStream printAll(@NotNull @NotNull VoucherQuery query, boolean markAsPrinted) throws FrameworkException
FrameworkExceptionRedeemVoucherResult redeem(@NotNull @NotNull 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(@NotNull @NotNull VoucherQuery params) throws FrameworkException
FrameworkExceptionVouchersResultsWithSummaryVO searchWithSummary(@NotNull @NotNull VoucherQuery params) throws FrameworkException
FrameworkException