UNPKG

pancake-client-sdk

Version:
92 lines 2.84 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FinanceResource = void 0; const base_1 = require("./base"); class FinanceResource extends base_1.BaseResource { /** * Get list of financial transactions */ async listTransactions(params) { return this.client.get(this.getShopPath('/financial-transactions'), params); } /** * Get transaction by ID */ async getTransactionById(transactionId) { return this.client.get(this.getShopPath(`/financial-transactions/${transactionId}`)); } /** * Create new transaction */ async createTransaction(data) { return this.client.post(this.getShopPath('/financial-transactions'), data); } /** * Update transaction */ async updateTransaction(transactionId, data) { return this.client.put(this.getShopPath(`/financial-transactions/${transactionId}`), data); } /** * Delete transaction */ async deleteTransaction(transactionId) { return this.client.delete(this.getShopPath(`/financial-transactions/${transactionId}`)); } /** * Get list of transaction categories */ async listCategories(type) { return this.client.get(this.getShopPath('/financial-categories'), { type }); } /** * Create new category */ async createCategory(data) { return this.client.post(this.getShopPath('/financial-categories'), data); } /** * Update category */ async updateCategory(categoryId, data) { return this.client.put(this.getShopPath(`/financial-categories/${categoryId}`), data); } /** * Delete category */ async deleteCategory(categoryId) { return this.client.delete(this.getShopPath(`/financial-categories/${categoryId}`)); } /** * Create advertising expense */ async createAdvertisingExpense(data) { return this.client.post(this.getShopPath('/advertising-expenses'), data); } /** * List advertising expenses */ async listAdvertisingExpenses(params) { return this.client.get(this.getShopPath('/advertising-expenses'), params); } /** * Get financial report */ async getFinancialReport(params) { return this.client.get(this.getShopPath('/financial-reports'), params); } /** * Get daily summary report */ async getDailySummary(params) { return this.client.get(this.getShopPath('/financial-reports/daily-summary'), params); } /** * Get category breakdown report */ async getCategoryBreakdown(params) { return this.client.get(this.getShopPath('/financial-reports/category-breakdown'), params); } } exports.FinanceResource = FinanceResource; //# sourceMappingURL=finance.js.map