pancake-client-sdk
Version:
Official TypeScript SDK for Pancake POS API
98 lines • 2.79 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StaffResource = void 0;
const base_1 = require("./base");
class StaffResource extends base_1.BaseResource {
/**
* Get list of staff members
*/
async list(params) {
return this.client.get(this.getShopPath('/staff'), params);
}
/**
* Get staff member by ID
*/
async getById(staffId) {
return this.client.get(this.getShopPath(`/staff/${staffId}`));
}
/**
* Create new staff member
*/
async create(data) {
return this.client.post(this.getShopPath('/staff'), data);
}
/**
* Update staff member
*/
async update(staffId, data) {
return this.client.put(this.getShopPath(`/staff/${staffId}`), data);
}
/**
* Get list of staff roles
*/
async listRoles() {
return this.client.get(this.getShopPath('/staff-roles'));
}
/**
* Create new role
*/
async createRole(data) {
return this.client.post(this.getShopPath('/staff-roles'), data);
}
/**
* Update role
*/
async updateRole(roleId, data) {
return this.client.put(this.getShopPath(`/staff-roles/${roleId}`), data);
}
/**
* Delete role
*/
async deleteRole(roleId) {
return this.client.delete(this.getShopPath(`/staff-roles/${roleId}`));
}
/**
* Get list of available permissions
*/
async listPermissions() {
return this.client.get('/permissions');
}
/**
* Get staff activity logs
*/
async getActivityLogs(params) {
return this.client.get(this.getShopPath('/staff-activity-logs'), params);
}
/**
* Get staff member activity logs
*/
async getStaffActivityLogs(staffId, params) {
return this.client.get(this.getShopPath(`/staff/${staffId}/activity-logs`), params);
}
/**
* Get staff performance reports
*/
async getPerformanceReports(params) {
return this.client.get(this.getShopPath('/staff-performance'), params);
}
/**
* Get individual staff performance report
*/
async getStaffPerformance(staffId, params) {
return this.client.get(this.getShopPath(`/staff/${staffId}/performance`), params);
}
/**
* Reset staff password
*/
async resetPassword(staffId, newPassword) {
return this.client.post(this.getShopPath(`/staff/${staffId}/reset-password`), { password: newPassword });
}
/**
* Enable/disable staff member
*/
async setActive(staffId, isActive) {
return this.client.put(this.getShopPath(`/staff/${staffId}/set-active`), { is_active: isActive });
}
}
exports.StaffResource = StaffResource;
//# sourceMappingURL=staff.js.map