Fluent builder for allocating one or more vouchers of a given voucher type. If the voucher type auto-creates vouchers, a new voucher is created and allocated; otherwise it allocates from the pool of already-created, unallocated vouchers, either a single available one or a specific count via numberOfVouchers. Obtained from VoucherManager.newVoucherTypeBuilder(VoucherType) and completed with build().

Group: Builders


Methods

allocatedTo(Profile allocatedTo)

Returns: VoucherTypeAllocationBuilder

Sets the profile to whom the voucher(s) will be allocated.

ParameterDescription
allocatedTothe recipient profile

allocatedToId(String allocatedToId)

Returns: VoucherTypeAllocationBuilder

Sets the identifier of the profile to whom the voucher(s) will be allocated.

ParameterDescription
allocatedToIdthe recipient profile ID

notes(String notes)

Returns: VoucherTypeAllocationBuilder

Sets the notes associated with the voucher allocation.

ParameterDescription
notesthe allocation notes

redeemerOrg(Organisation redeemerOrg)

Returns: VoucherTypeAllocationBuilder

Sets the organisation that will be able to redeem the voucher type.

ParameterDescription
redeemerOrgthe redeeming organisation

numberOfVouchers(Integer numberOfVouchers)

Returns: VoucherTypeAllocationBuilder

Sets the number of vouchers to be allocated. If null, a single available pre-generated voucher will be allocated instead.

ParameterDescription
numberOfVouchersthe number of vouchers to allocate, or null to allocate one pre-generated voucher

allocatedByProfile(Profile allocatedByProfile)

Returns: VoucherTypeAllocationBuilder

Sets the profile of the user who is performing the voucher allocation.

ParameterDescription
allocatedByProfilethe allocating profile

allocatedDate(Date allocatedDate)

Returns: VoucherTypeAllocationBuilder

Sets the date when the voucher allocation was performed.

ParameterDescription
allocatedDatethe allocation date

build()

Returns: List<Voucher>

Executes the allocation request, creating and/or allocating vouchers of the builder's voucher type as configured.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.