Other

Vouchers

Communication protocol for vouchers.

Utilized REST methods, contract: Comarch.B2.DataService.Contracts.dll

VoucherEntity[] GetInternalVouchers(string numer)

The method should return the current list of vouchers that match an indicated number (usually it will be one voucher).

VoucherResult UpdateVouchers(VoucherEntity[] vouchers);

The method should add/activate/deactivate/update particular vouchers passed as parameters.

The specific action performed for the vouchers depends on data contained in the VoucherEntity entity. Key data sent by POS include:

VoucherEntity
Id : intVoucher Id (0 if it should be created)
TypeId : VoucherKindEnumVoucher type
(Unknown, InternalSold, InternalReleased, External, GiftCard)
SortId : intVoucher sort
CurrencyId : intVoucher currency
IsActive : boolVoucher status
True - own voucher (sold, issued, card) to be used (deactivated) or whose Amount state is to be updated (applicable to cards)
Number : stringVoucher number
Amount : decimalVoucher value

Expected actions, depending on the configuration of VoucherEntity parameters sent to the voucher service (DataService) using the UpdateVouchers method, include:

IdSortIdIsActiveAction
-External-Application of an external voucher
Saved in the database as used and inactive, with its value defined in Amount, currency in CurrencyId, and number in Number
0InternalReleased-Generation of an issued own voucher
Saved in the database as active and unused voucher, with its value defined in Amount, currency in CurrencyId, and number in Number
>0InternalReleased
InternalSold
GiftCard
trueApplication of a voucher or update of a gift card’s value
>0InternalReleasedfalseActivation of an existing internally-issued voucher

Bool IsExternalVoucherExists(string numer, int sortId)

The method should verify if an external voucher with the indicated number and sort already exists in the database.

Czy ten artykuł był pomocny?