@velaro/cli 1.4.188 → 1.4.189
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/velaro.js +2 -0
- package/lib/commands/workforce.js +21 -0
- package/package.json +1 -1
package/bin/velaro.js
CHANGED
|
@@ -120,6 +120,7 @@ import { applePayCommand } from '../lib/commands/apple-pay.js';
|
|
|
120
120
|
import { siteBuilderCommand } from '../lib/commands/site-builder.js';
|
|
121
121
|
import { paymentRecoveryCommand } from '../lib/commands/payment-recovery.js';
|
|
122
122
|
import { recruitingCommand } from '../lib/commands/recruiting.js';
|
|
123
|
+
import { workforceCommand } from '../lib/commands/workforce.js';
|
|
123
124
|
import { surveyCommand } from '../lib/commands/survey.js';
|
|
124
125
|
import { bundleCommand } from '../lib/commands/bundle.js';
|
|
125
126
|
import { chatWindowCommand } from '../lib/commands/chat-window.js';
|
|
@@ -286,6 +287,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
|
|
|
286
287
|
.command(siteBuilderCommand)
|
|
287
288
|
.command(paymentRecoveryCommand)
|
|
288
289
|
.command(recruitingCommand)
|
|
290
|
+
.command(workforceCommand)
|
|
289
291
|
.command(surveyCommand)
|
|
290
292
|
.command(bundleCommand)
|
|
291
293
|
.command(chatWindowCommand)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { messagingGet } from '../api.js';
|
|
2
|
+
import { runCommand } from '../run.js';
|
|
3
|
+
|
|
4
|
+
// -- velaro workforce ----------------------------------------------------------
|
|
5
|
+
// Read-only view of each work schedule's Workforce Management settings.
|
|
6
|
+
// Backend: velaro-messaging GET WorkSchedules (siteId from the vmsg-siteId header, never an arg).
|
|
7
|
+
// Writes are UI-only (Settings > Schedules): the WorkSchedules save replaces the whole set.
|
|
8
|
+
export const workforceCommand = {
|
|
9
|
+
command: 'workforce',
|
|
10
|
+
describe: 'Show Workforce Management settings (break allowance, enforce availability, after-hours action) per schedule',
|
|
11
|
+
builder: (y) => y.option('json', { type: 'boolean', default: false, describe: 'Raw JSON output' }),
|
|
12
|
+
handler: runCommand(async (argv) => {
|
|
13
|
+
const rows = await messagingGet('/WorkSchedules');
|
|
14
|
+
const list = Array.isArray(rows) ? rows : (rows?.schedules ?? []);
|
|
15
|
+
if (argv.json) { console.log(JSON.stringify(list, null, 2)); return; }
|
|
16
|
+
if (list.length === 0) { console.log('No work schedules configured.'); return; }
|
|
17
|
+
for (const x of list) {
|
|
18
|
+
console.log(`[${x.id}] ${x.name}: break ${x.dailyBreakAllowanceMinutes ?? 0}m, enforce availability ${x.enforceAvailability ? 'on' : 'off'}, after hours ${x.afterHoursAction ?? 'None'}`);
|
|
19
|
+
}
|
|
20
|
+
}),
|
|
21
|
+
};
|
package/package.json
CHANGED