fleetmap-reports 1.0.853 → 1.0.856
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/package.json +1 -1
- package/src/events-report.js +3 -1
- package/src/tests/events.test.js +6 -4
package/package.json
CHANGED
package/src/events-report.js
CHANGED
|
@@ -249,6 +249,7 @@ function exportSpeedingReportToExcel (userData, reportData) {
|
|
|
249
249
|
{ label: translations.report.eventType, value: 'eventType' },
|
|
250
250
|
{ label: translations.report.date, value: 'fixTime' },
|
|
251
251
|
{ label: translations.report.address, value: 'address' },
|
|
252
|
+
{ label: translations.report.zone, value: 'geofenceName' },
|
|
252
253
|
{ label: translations.report.driver, value: 'driver' },
|
|
253
254
|
{ label: translations.report.info, value: 'info' },
|
|
254
255
|
{ label: 'Latitude', value: 'latitude' },
|
|
@@ -262,7 +263,8 @@ function exportSpeedingReportToExcel (userData, reportData) {
|
|
|
262
263
|
name: d.device.name,
|
|
263
264
|
eventType: getEventType(a, translations, d.device),
|
|
264
265
|
fixTime: getAlertDate(userData.user, a),
|
|
265
|
-
address: a.
|
|
266
|
+
address: a.position && a.position.address,
|
|
267
|
+
geofenceName: a.geofenceName,
|
|
266
268
|
info: getAlertInfo(userData.drivers, a, d.device, translations),
|
|
267
269
|
driver: a.driver,
|
|
268
270
|
latitude: a.position && a.position.latitude,
|
package/src/tests/events.test.js
CHANGED
|
@@ -5,12 +5,14 @@ describe('events', function () {
|
|
|
5
5
|
it('works with many devices', async () => {
|
|
6
6
|
const report = await getReports(process.env.USER_NOGARTEL, process.env.PASS_NOGARTEL)
|
|
7
7
|
const userData = await report.getUserData()
|
|
8
|
-
|
|
8
|
+
userData.devices = userData.devices.filter(d => d.name.startsWith('BBU-4428'))
|
|
9
|
+
userData.eventTypes = ['alarm_sensor']
|
|
10
|
+
console.log('devices.length', userData.devices.length)
|
|
9
11
|
const result = await report.eventsReport(
|
|
10
|
-
new Date(Date.UTC(2023,
|
|
11
|
-
new Date(Date.UTC(2023,
|
|
12
|
+
new Date(Date.UTC(2023, 8, 29, 0, 0, 0, 0)),
|
|
13
|
+
new Date(Date.UTC(2023, 8, 29, 23, 59, 59, 0)),
|
|
12
14
|
userData)
|
|
13
|
-
console.log('result', result)
|
|
15
|
+
console.log('result', result[0].devices[0].alerts)
|
|
14
16
|
}, 4000000)
|
|
15
17
|
|
|
16
18
|
// eslint-disable-next-line no-undef
|