fleetmap-reports 2.0.262 → 2.0.264
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
CHANGED
package/src/location-report.js
CHANGED
|
@@ -52,7 +52,7 @@ async function createLocationReportByDriver (from, to, userData, traccar) {
|
|
|
52
52
|
return { drivers: [] }
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
const sliced = automaticReports.sliceArray(devices,
|
|
55
|
+
const sliced = automaticReports.sliceArray(devices, 3)
|
|
56
56
|
const driversResult = []
|
|
57
57
|
|
|
58
58
|
for (const slice of sliced) {
|
|
@@ -185,6 +185,7 @@ async function processDrivers (from, to, userData, data, driversResult) {
|
|
|
185
185
|
to,
|
|
186
186
|
positions: route
|
|
187
187
|
}
|
|
188
|
+
console.log('pushing', route.length, 'for', d.name)
|
|
188
189
|
driversResult.push(driverData)
|
|
189
190
|
}
|
|
190
191
|
}
|
|
@@ -27,10 +27,11 @@ describe('test positions', function () {
|
|
|
27
27
|
try {
|
|
28
28
|
const userData = await report.getUserData()
|
|
29
29
|
userData.byDriver = true
|
|
30
|
+
userData.drivers = [userData.drivers.pop()]
|
|
30
31
|
const data = await report.locationReport(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
new Date(Date.UTC(2025, 0, 1, 0, 0, 0)),
|
|
33
|
+
new Date(Date.UTC(2025, 0, 31, 23, 59, 59, 0)),
|
|
34
|
+
userData)
|
|
34
35
|
assert.equal(data.length, 1)
|
|
35
36
|
const driver = data[0].drivers.find(d => d.driver.id === 14020)
|
|
36
37
|
console.log(driver.positions)
|
|
@@ -38,7 +39,7 @@ describe('test positions', function () {
|
|
|
38
39
|
} catch (e) {
|
|
39
40
|
console.error(e)
|
|
40
41
|
}
|
|
41
|
-
},
|
|
42
|
+
}, 2000000)
|
|
42
43
|
// eslint-disable-next-line no-undef
|
|
43
44
|
it('works with sensores', async () => {
|
|
44
45
|
const deviceId = 288082
|