@things-factory/dataset 6.0.79 → 6.0.81

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/dataset",
3
- "version": "6.0.79",
3
+ "version": "6.0.81",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -41,14 +41,14 @@
41
41
  "@things-factory/board-service": "^6.0.78",
42
42
  "@things-factory/env": "^6.0.78",
43
43
  "@things-factory/organization": "^6.0.78",
44
- "@things-factory/scheduler-client": "^6.0.78",
44
+ "@things-factory/scheduler-client": "^6.0.81",
45
45
  "@things-factory/shell": "^6.0.78",
46
46
  "@things-factory/work-shift": "^6.0.78",
47
- "@things-factory/worklist": "^6.0.78",
47
+ "@things-factory/worklist": "^6.0.81",
48
48
  "cron-parser": "^4.3.0",
49
49
  "moment-timezone": "^0.5.40",
50
50
  "simple-statistics": "^7.8.3",
51
51
  "statistics": "^3.3.0"
52
52
  },
53
- "gitHead": "a7638563e82d7daf5c105caf1ee62fc4ce6f98dc"
53
+ "gitHead": "184612c4610f1ab154bd26ff4a862ec3a6d852fb"
54
54
  }
@@ -203,14 +203,18 @@ export async function generateLatestDataSummaries(dataSetId: string, context: Re
203
203
  do {
204
204
  const samples = await getQueryBuilderFromListParams({
205
205
  repository: tx.getRepository(DataSample),
206
+ domain,
206
207
  params: {
207
208
  filters: [{ name: 'dataSetId', operator: 'eq', value: dataSetId }],
208
209
  pagination: { page, limit },
209
210
  sortings: [...buildKeySortingList(dataKeyItems), { name: 'collectedAt', desc: true }]
210
211
  },
211
- domain
212
+ alias: 'datasample'
212
213
  })
213
- .andWhere({ collectedAt: Between.call(range) })
214
+ // The 'Between' operator includes the 'to' time in the filtering, making it unsuitable for the desired use case.
215
+ // .andWhere({ collectedAt: Between.apply(null, range) })
216
+ .andWhere('datasample.collectedAt >= :from', { from: range[0] })
217
+ .andWhere('datasample.collectedAt < :to', { to: range[1] })
214
218
  .getMany()
215
219
 
216
220
  for (const sample of samples) {
@@ -316,11 +320,13 @@ export async function generateDataSummary(
316
320
  pagination: { page, limit },
317
321
  sortings: [...buildKeySortingList(dataKeyItems), { name: 'collectedAt', desc: true }]
318
322
  },
319
- domain
323
+ domain,
324
+ alias: 'datasample'
320
325
  })
321
- .andWhere({
322
- collectedAt: Between.apply(null, range)
323
- })
326
+ // The 'Between' operator includes the 'to' time in the filtering, making it unsuitable for the desired use case.
327
+ // .andWhere({ collectedAt: Between.apply(null, range) })
328
+ .andWhere('datasample.collectedAt >= :from', { from: range[0] })
329
+ .andWhere('datasample.collectedAt < :to', { to: range[1] })
324
330
  .getMany()
325
331
 
326
332
  for (const sample of samples) {