fleetmap-reports 1.0.700 → 1.0.701
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/tests/zones.test.js +14 -8
- package/src/util/utils.js +1 -1
- package/src/zone-report.js +1 -1
package/package.json
CHANGED
package/src/tests/zones.test.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const { getReports } = require('./index')
|
|
2
|
+
const assert = require('assert')
|
|
3
|
+
// eslint-disable-next-line no-undef
|
|
2
4
|
describe('zones', function () {
|
|
5
|
+
// eslint-disable-next-line no-undef
|
|
3
6
|
it('works with ellca', async () => {
|
|
4
7
|
const report = await getReports()
|
|
5
8
|
const userData = await report.getUserData()
|
|
@@ -16,16 +19,19 @@ describe('zones', function () {
|
|
|
16
19
|
console.log('result', result)
|
|
17
20
|
}, 4000000)
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
// eslint-disable-next-line no-undef
|
|
23
|
+
it('works with casais', async () => {
|
|
24
|
+
const report = await getReports('mario.andre.moreira@casais.gi', 'Casais.23')
|
|
21
25
|
const userData = await report.getUserData()
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
console.log(userData.geofences)
|
|
26
|
+
userData.devices = userData.devices.filter(d => d.name === 'G-1101-E Clio')
|
|
27
|
+
userData.geofences = userData.geofences.filter(g => g.name === 'baliza raio verde ')
|
|
25
28
|
const result = await report.zoneReport(
|
|
26
|
-
new Date(Date.UTC(2023,
|
|
27
|
-
new Date(Date.UTC(2023,
|
|
29
|
+
new Date(Date.UTC(2023, 0, 1, 0, 0, 0, 0)),
|
|
30
|
+
new Date(Date.UTC(2023, 0, 31, 23, 59, 59, 0)),
|
|
28
31
|
userData)
|
|
29
|
-
|
|
32
|
+
const first = result[0].devices[0].geofences[0]
|
|
33
|
+
console.log(first)
|
|
34
|
+
assert.equal(first.inTime.fixTime, '2023-01-03T21:23:24.000+0000')
|
|
35
|
+
assert.equal(first.outTime.fixTime, '2023-01-07T12:22:53.000+0000')
|
|
30
36
|
}, 4000000)
|
|
31
37
|
})
|
package/src/util/utils.js
CHANGED
package/src/zone-report.js
CHANGED
|
@@ -325,7 +325,7 @@ function getInAndOutEvents (devices, route, userData) {
|
|
|
325
325
|
if (!checkGeofenceIn(p, g)) {
|
|
326
326
|
deviceEvents.push(createEvent('geofenceExit', d.id, p, g))
|
|
327
327
|
} else {
|
|
328
|
-
|
|
328
|
+
p.inside[id] = true
|
|
329
329
|
}
|
|
330
330
|
} else {
|
|
331
331
|
if (checkGeofenceIn(p, g)) {
|