pancake-client-sdk
Version:
Official TypeScript SDK for Pancake POS API
86 lines • 2.29 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PromotionResource = void 0;
const base_1 = require("./base");
class PromotionResource extends base_1.BaseResource {
/**
* Get list of promotions
*/
async list(params) {
return this.client.get(this.getShopPath('/promotions'), params);
}
/**
* Get promotion by ID
*/
async getById(promotionId) {
return this.client.get(this.getShopPath(`/promotions/${promotionId}`));
}
/**
* Create new promotion
*/
async create(data) {
return this.client.post(this.getShopPath('/promotions'), data);
}
/**
* Update promotion
*/
async update(promotionId, data) {
return this.client.put(this.getShopPath(`/promotions/${promotionId}`), data);
}
/**
* Get list of vouchers
*/
async listVouchers(params) {
return this.client.get(this.getShopPath('/vouchers'), params);
}
/**
* Get voucher by ID
*/
async getVoucherById(voucherId) {
return this.client.get(this.getShopPath(`/vouchers/${voucherId}`));
}
/**
* Create new voucher
*/
async createVoucher(data) {
return this.client.post(this.getShopPath('/vouchers'), data);
}
/**
* Create multiple vouchers
*/
async createBulkVouchers(data) {
return this.client.post(this.getShopPath('/vouchers/bulk'), data);
}
/**
* Get list of combo products
*/
async listCombos() {
return this.client.get(this.getShopPath('/combos'));
}
/**
* Get combo by ID
*/
async getComboById(comboId) {
return this.client.get(this.getShopPath(`/combos/${comboId}`));
}
/**
* Create new combo
*/
async createCombo(data) {
return this.client.post(this.getShopPath('/combos'), data);
}
/**
* Update combo
*/
async updateCombo(comboId, data) {
return this.client.put(this.getShopPath(`/combos/${comboId}`), data);
}
/**
* Delete combo
*/
async deleteCombo(comboId) {
return this.client.delete(this.getShopPath(`/combos/${comboId}`));
}
}
exports.PromotionResource = PromotionResource;
//# sourceMappingURL=promotion.js.map