This commit is contained in:
seb
2026-10-10 18:17:14 +02:00
parent 004e0de869
commit a20668cd61
31 changed files with 572 additions and 76 deletions

View File

@@ -5,9 +5,11 @@ export const posterminal = {
* GET /api/posterminal → { posterminals: [{ id, name, token, pairingpin }] }
* List all terminals for the selected company.
*/
// #region GET /api/posterminal — list
list() {
return http('/api/posterminal');
},
// #endregion
/**
* PUT /api/posterminal
@@ -15,12 +17,14 @@ export const posterminal = {
* Creates a new terminal (auto-generates 6-digit pin).
* → 200 { posterminal: { id, name, token, pairingpin } }
*/
// #region PUT /api/posterminal — create
create({ name }) {
return http('/api/posterminal', {
method: 'PUT',
body: { name },
});
},
// #endregion
/**
* PATCH /api/posterminal/:id
@@ -28,64 +32,76 @@ export const posterminal = {
* Update posterminal configuration.
* → 200 { posterminal }
*/
// #region PATCH /api/posterminal/:id — update
update(terminalId, patch) {
return http(`/api/posterminal/${terminalId}`, {
method: 'PATCH',
body: patch,
});
},
// #endregion
/**
* DELETE /api/posterminal/:id → 204
* Deletes a terminal.
*/
// #region DELETE /api/posterminal/:id — delete
delete(terminalId) {
return http(`/api/posterminal/${terminalId}`, {
method: 'DELETE',
});
},
// #endregion
/**
* PUT /api/posterminal/:id/category/:categoryId
* Enable a category on a terminal.
* → 200 { id: number, categoryIds: number[] }
*/
// #region PUT /api/posterminal/:id/category/:categoryId — enableCategory
enableCategory(terminalId, categoryId) {
return http(`/api/posterminal/${terminalId}/category/${categoryId}`, {
method: 'PUT',
});
},
// #endregion
/**
* DELETE /api/posterminal/:id/category/:categoryId
* Disable a category on a terminal.
* → 200 { id: number, categoryIds: number[] }
*/
// #region DELETE /api/posterminal/:id/category/:categoryId — disableCategory
disableCategory(terminalId, categoryId) {
return http(`/api/posterminal/${terminalId}/category/${categoryId}`, {
method: 'DELETE',
});
},
// #endregion
/**
* PUT /api/posterminal/:id/all
* Enable all categories on a terminal.
* → 200 { id: number, categoryIds: number[] }
*/
// #region PUT /api/posterminal/:id/all — enableAllCategories
enableAllCategories(terminalId) {
return http(`/api/posterminal/${terminalId}/all`, {
method: 'PUT',
});
},
// #endregion
/**
* DELETE /api/posterminal/:id/all
* Disable all categories on a terminal.
* → 200 { id: number, categoryIds: number[] }
*/
// #region DELETE /api/posterminal/:id/all — disableAllCategories
disableAllCategories(terminalId) {
return http(`/api/posterminal/${terminalId}/all`, {
method: 'DELETE',
});
},
// #endregion
};