fleetmap-reports 2.0.358 → 2.0.360

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.
Files changed (82) hide show
  1. package/package.json +1 -1
  2. package/src/partnerReports/driverranking-report.js +39 -7
  3. package/src/util/utils.js +3 -0
  4. package/.claude/worktrees/eager-stonebraker-c08ac7/.eslintrc.js +0 -15
  5. package/.claude/worktrees/eager-stonebraker-c08ac7/lang/enGB.js +0 -309
  6. package/.claude/worktrees/eager-stonebraker-c08ac7/lang/esCL.js +0 -297
  7. package/.claude/worktrees/eager-stonebraker-c08ac7/lang/frFR.json +0 -324
  8. package/.claude/worktrees/eager-stonebraker-c08ac7/lang/index.js +0 -35
  9. package/.claude/worktrees/eager-stonebraker-c08ac7/lang/ptBR.js +0 -301
  10. package/.claude/worktrees/eager-stonebraker-c08ac7/lang/ptPT.js +0 -310
  11. package/.claude/worktrees/eager-stonebraker-c08ac7/package-lock.json +0 -11944
  12. package/.claude/worktrees/eager-stonebraker-c08ac7/package.json +0 -45
  13. package/.claude/worktrees/eager-stonebraker-c08ac7/src/activity-report.js +0 -822
  14. package/.claude/worktrees/eager-stonebraker-c08ac7/src/automaticReports.js +0 -34
  15. package/.claude/worktrees/eager-stonebraker-c08ac7/src/carbone/index.js +0 -13
  16. package/.claude/worktrees/eager-stonebraker-c08ac7/src/custom/vistawasteActivity-report.js +0 -544
  17. package/.claude/worktrees/eager-stonebraker-c08ac7/src/events-report.js +0 -360
  18. package/.claude/worktrees/eager-stonebraker-c08ac7/src/fuel-consumption-report.js +0 -296
  19. package/.claude/worktrees/eager-stonebraker-c08ac7/src/fuel-drop-report.js +0 -128
  20. package/.claude/worktrees/eager-stonebraker-c08ac7/src/here.js +0 -172
  21. package/.claude/worktrees/eager-stonebraker-c08ac7/src/idle-report.js +0 -403
  22. package/.claude/worktrees/eager-stonebraker-c08ac7/src/index.js +0 -244
  23. package/.claude/worktrees/eager-stonebraker-c08ac7/src/kms-report.js +0 -549
  24. package/.claude/worktrees/eager-stonebraker-c08ac7/src/location-report.js +0 -496
  25. package/.claude/worktrees/eager-stonebraker-c08ac7/src/machines-report.js +0 -278
  26. package/.claude/worktrees/eager-stonebraker-c08ac7/src/partnerReports/afriquia.js +0 -129
  27. package/.claude/worktrees/eager-stonebraker-c08ac7/src/partnerReports/dailyuse-report.js +0 -80
  28. package/.claude/worktrees/eager-stonebraker-c08ac7/src/partnerReports/delayedstart-report.js +0 -223
  29. package/.claude/worktrees/eager-stonebraker-c08ac7/src/partnerReports/driverranking-report.js +0 -328
  30. package/.claude/worktrees/eager-stonebraker-c08ac7/src/partnerReports/gpsjump-report.js +0 -61
  31. package/.claude/worktrees/eager-stonebraker-c08ac7/src/partnerReports/performance-report.js +0 -359
  32. package/.claude/worktrees/eager-stonebraker-c08ac7/src/refueling-report.js +0 -345
  33. package/.claude/worktrees/eager-stonebraker-c08ac7/src/reportStyle.js +0 -34
  34. package/.claude/worktrees/eager-stonebraker-c08ac7/src/sensor-report.js +0 -447
  35. package/.claude/worktrees/eager-stonebraker-c08ac7/src/speeding-report.js +0 -663
  36. package/.claude/worktrees/eager-stonebraker-c08ac7/src/stop-report.js +0 -242
  37. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/ActivityReportTemplate.mjml +0 -51
  38. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/EmptyReportTemplate.mjml +0 -25
  39. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/EventsReportTemplate.mjml +0 -75
  40. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/FuelDropReportTemplate.mjml +0 -60
  41. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/IdleReportTemplate.mjml +0 -54
  42. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/KmsReportGroupByDayTemplate.mjml +0 -43
  43. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/KmsReportTemplate.mjml +0 -44
  44. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/LocationReportTemplate.mjml +0 -37
  45. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/RefuelingReportTemplate.mjml +0 -60
  46. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/SensorReportTemplate.mjml +0 -23
  47. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/SpeedingReportTemplate.mjml +0 -80
  48. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/TripReportTemplate.mjml +0 -97
  49. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/ZoneReportTemplate.mjml +0 -52
  50. package/.claude/worktrees/eager-stonebraker-c08ac7/src/templates/report.mjml +0 -96
  51. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/activity.test.js +0 -99
  52. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/carbone.test.js +0 -20
  53. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/events.test.js +0 -30
  54. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/fuel.test.js +0 -35
  55. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/idle.test.js +0 -16
  56. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/index.js +0 -24
  57. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/index.test.js +0 -203
  58. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/kms.test.js +0 -74
  59. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/performance.test.js +0 -36
  60. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/positions.test.js +0 -67
  61. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/speeding.test.js +0 -120
  62. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/translations.test.js +0 -21
  63. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/trips.test.js +0 -140
  64. package/.claude/worktrees/eager-stonebraker-c08ac7/src/tests/zones.test.js +0 -162
  65. package/.claude/worktrees/eager-stonebraker-c08ac7/src/trip-report.js +0 -641
  66. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/device.js +0 -13
  67. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/driver.js +0 -90
  68. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/fuel.js +0 -102
  69. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/geofence.js +0 -52
  70. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/odoo.js +0 -18
  71. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/parallel.js +0 -64
  72. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/pdfDocument.js +0 -140
  73. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/route.js +0 -78
  74. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/timetable.js +0 -30
  75. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/traccar.js +0 -213
  76. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/traccar.worker.js +0 -49
  77. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/trips.js +0 -270
  78. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/utils.js +0 -358
  79. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/worker.js +0 -14
  80. package/.claude/worktrees/eager-stonebraker-c08ac7/src/util/xpert.js +0 -58
  81. package/.claude/worktrees/eager-stonebraker-c08ac7/src/word/index.js +0 -95
  82. package/.claude/worktrees/eager-stonebraker-c08ac7/src/zone-report.js +0 -904
@@ -1,162 +0,0 @@
1
- const { getReports } = require('./index')
2
- const assert = require('assert')
3
- // eslint-disable-next-line no-undef
4
- describe('zones', function () {
5
- // eslint-disable-next-line no-undef
6
- it('works tripsBetweenZones', async () => {
7
- const report = await getReports()
8
- const userData = await report.getUserData()
9
- userData.tripsBetweenZones = true
10
- const result = await report.zoneReport(
11
- new Date(Date.UTC(2023, 6, 24, 0, 0, 0, 0)),
12
- new Date(Date.UTC(2023, 7, 25, 23, 59, 59, 0)),
13
- userData)
14
- console.log(await report.zoneReportToPDF(userData, result[0]))
15
- }, 4000000)
16
-
17
- // eslint-disable-next-line no-undef
18
- it('works with afriquia', async () => {
19
- const report = await getReports(process.env.USER_AFRIQUIA, process.env.PASS_AFRIQUIA)
20
- const userData = await report.getUserData()
21
- console.log(userData.devices.length)
22
- console.log(userData.geofences)
23
- const result = await report.zoneReport(
24
- new Date(Date.UTC(2023, 5, 11, 0, 0, 0, 0)),
25
- new Date(Date.UTC(2023, 5, 11, 23, 59, 59, 0)),
26
- userData)
27
- console.log('result', result)
28
- }, 4000000)
29
-
30
- it('trips between geofences', async () => {
31
- const report = await getReports(process.env.USER_MOVIFLOTTE, process.env.PASS_MOVIFLOTTE)
32
- const userData = await report.getUserData()
33
- userData.tripsBetweenZones = true
34
- const result = await report.zoneReport(
35
- new Date(Date.UTC(2024, 0, 8, 0, 0, 0, 0)),
36
- new Date(Date.UTC(2024, 0, 8, 23, 59, 59, 0)),
37
- userData)
38
- console.log('result', result)
39
- }, 4000000)
40
-
41
- // eslint-disable-next-line no-undef
42
- it('works with casais', async () => {
43
- const report = await getReports(process.env.USER_CASAIS, process.env.PASS_CASAIS)
44
- const userData = await report.getUserData()
45
- userData.devices = userData.devices.filter(d => d.name === 'G-1101-E Clio')
46
- userData.geofences = userData.geofences.filter(g => g.name === 'baliza 1 - raio verde ')
47
- const result = await report.zoneReport(
48
- new Date(Date.UTC(2023, 0, 1, 0, 0, 0, 0)),
49
- new Date(Date.UTC(2023, 0, 31, 23, 59, 59, 0)),
50
- userData)
51
- const first = result[0].devices[0].geofences[0]
52
- console.log(first)
53
- assert.equal(first.inTime.fixTime, '2023-01-03T21:23:24.000+00:00')
54
- assert.equal(first.outTime.fixTime, '2023-01-07T12:22:53.000+00:00')
55
- }, 4000000)
56
-
57
- // eslint-disable-next-line no-undef
58
- it('works with casais zones in columns', async () => {
59
- const report = await getReports()
60
- const userData = await report.getUserData()
61
- userData.zonesByColumn = true
62
- userData.devices = userData.devices.filter(d => d.id === 81201)
63
- userData.geofences = userData.geofences.filter(g => g.name === 'baliza 1 - raio verde ' ||
64
- g.name === 'baliza 2 - raio amarelo')
65
- userData.onlyWithKmsOut = false
66
- const result = await report.zoneReport(
67
- new Date(Date.UTC(2023, 7, 17, 0, 0, 0, 0)),
68
- new Date(Date.UTC(2023, 7, 20, 23, 59, 59, 0)),
69
- userData)
70
- const first = result[0].devices[0]
71
- console.log(first)
72
- assert.equal(first.days[0].distanceOut, 0)
73
- assert.equal(first.days[2].distanceOut, 0)
74
- }, 4000000)
75
-
76
- it('works with casais zones in columns 2', async () => {
77
- const report = await getReports()
78
- const userData = await report.getUserData()
79
- userData.zonesByColumn = true
80
- userData.devices = userData.devices.filter(d => d.id === 81201)
81
- userData.geofences = userData.geofences.filter(g => g.name === 'baliza 1 - raio verde ' ||
82
- g.name === 'baliza 2 - raio amarelo')
83
- userData.onlyWithKmsOut = false
84
- const result = await report.zoneReport(
85
- new Date(Date.UTC(2023, 7, 7, 0, 0, 0, 0)),
86
- new Date(Date.UTC(2023, 7, 7, 23, 59, 59, 0)),
87
- userData)
88
- const first = result[0].devices[0]
89
- console.log(first)
90
- assert.equal(first.days[0].distanceOut, 554.6037095121401)
91
- }, 4000000)
92
-
93
- it('works with casais zones in columns 3', async () => {
94
- const report = await getReports()
95
- const userData = await report.getUserData()
96
- userData.zonesByColumn = true
97
- userData.devices = userData.devices.filter(d => d.id === 81201)
98
- userData.geofences = userData.geofences.filter(g => g.name === 'baliza 1 - raio verde ' ||
99
- g.name === 'baliza 2 - raio amarelo')
100
- userData.onlyWithKmsOut = false
101
- const result = await report.zoneReport(
102
- new Date(Date.UTC(2023, 8, 1, 0, 0, 0, 0)),
103
- new Date(Date.UTC(2023, 8, 10, 23, 59, 59, 0)),
104
- userData)
105
- const first = result[0].devices[0]
106
- console.log(first)
107
- assert.equal(first.days[0].distanceOut, 294.0468270741282)
108
- assert.equal(first.days[1].distanceOut, 35.21209134706803)
109
- }, 4000000)
110
-
111
- it('works with casais zones in columns 4', async () => {
112
- const report = await getReports()
113
- const userData = await report.getUserData()
114
- userData.zonesByColumn = true
115
- userData.devices = userData.devices.filter(d => d.id === 81164)
116
- userData.geofences = userData.geofences.filter(g => g.name === 'baliza 1 - raio verde ' ||
117
- g.name === 'baliza 2 - raio amarelo')
118
- userData.onlyWithKmsOut = false
119
- const result = await report.zoneReport(
120
- new Date(Date.UTC(2023, 8, 10, 0, 0, 0, 0)),
121
- new Date(Date.UTC(2023, 8, 11, 23, 59, 59, 0)),
122
- userData)
123
- const first = result[0].devices[0]
124
- console.log(first)
125
- assert.equal(first.days[0].distanceOut, 0)
126
- assert.equal(first.days[1].distanceOut, 24)
127
- }, 4000000)
128
-
129
- it('works with casais zones in columns 5', async () => {
130
- const report = await getReports()
131
- const userData = await report.getUserData()
132
- userData.zonesByColumn = true
133
- userData.devices = userData.devices.filter(d => d.id === 81172)
134
- userData.geofences = userData.geofences.filter(g => g.name === 'baliza 1 - raio verde ' ||
135
- g.name === 'baliza 2 - raio amarelo')
136
- userData.onlyWithKmsOut = false
137
- const result = await report.zoneReport(
138
- new Date(Date.UTC(2023, 8, 3, 0, 0, 0, 0)),
139
- new Date(Date.UTC(2023, 8, 10, 23, 59, 59, 0)),
140
- userData)
141
- const first = result[0].devices[0]
142
- console.log(first)
143
- assert.equal(first.days[1].distanceOut, 298.9872662595749)
144
- }, 4000000)
145
-
146
- it('works with casais zones in columns 6', async () => {
147
- const report = await getReports()
148
- const userData = await report.getUserData()
149
- userData.zonesByColumn = true
150
- userData.devices = userData.devices.filter(d => d.id === 81166)
151
- userData.geofences = userData.geofences.filter(g => g.name === 'baliza 1 - raio verde ' ||
152
- g.name === 'baliza 2 - raio amarelo')
153
- userData.onlyWithKmsOut = false
154
- const result = await report.zoneReport(
155
- new Date(Date.UTC(2023, 9, 1, 0, 0, 0, 0)),
156
- new Date(Date.UTC(2023, 9, 27, 23, 59, 59, 0)),
157
- userData)
158
- const first = result[0].devices[0]
159
- console.log(first)
160
- assert.equal(first.days[6].distanceOut, 867.0554430738234)
161
- }, 4000000)
162
- })