/**
 * Code is auto-generated by Application Logic, DO NOT EDIT.
 * @version(2.0)
 */
const LCAPApplicationService = require('@sap/low-code-event-handler');
const customers_Logic = require('./code/customers-logic');
const customers_Redeem_Logic = require('./code/customers-redeem-logic');

class custloyal_abService extends LCAPApplicationService {
    async init() {

        this.on(['CREATE', 'UPDATE'], 'Customers', async (request, next) => {
            await customers_Logic(request);
            return next();
        });

        this.on('RedeemRewards', 'Customers', async (request, next) => {
            await customers_Redeem_Logic(request);
            return next();
        });

        this.on('READ', 'RewardType', async (request, next) => {
            next();
            const list = [
                { type: 'Voucher' },
                { type: 'Gift card' },
                { type: 'Product' }
            ]
            return list;
        });

        return super.init();
    }
}


module.exports = {
    custloyal_abService
};