@spytecgps/nova-orm 0.0.109 → 0.0.110

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.
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { BoundariesReportEntity, GetBoundariesReportParams } from '../../types/boundaries';
3
+ import { Logger } from '../../types/logger';
4
+ export declare const getBoundariesReport: (novaDataSource: NovaDataSource, params: GetBoundariesReportParams, logger: Logger) => Promise<BoundariesReportEntity[]>;
@@ -1,5 +1,5 @@
1
1
  import { Boundary } from '../../entities';
2
- import { CreateBoundaryParams, DeleteBoundaryParams, GetBoundariesByClientIdParams, GetBoundaryByIdParams, UpdateBoundaryParams } from '../../types/boundaries';
2
+ import { BoundariesReportEntity, CreateBoundaryParams, DeleteBoundaryParams, GetBoundariesByClientIdParams, GetBoundariesReportParams, GetBoundaryByIdParams, UpdateBoundaryParams } from '../../types/boundaries';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class BoundariesRepository extends BaseRepository {
5
5
  /**
@@ -64,4 +64,22 @@ export declare class BoundariesRepository extends BaseRepository {
64
64
  * - values.modifiedBy: The user id of the user that deleted the boundary
65
65
  */
66
66
  deleteBoundary(params: DeleteBoundaryParams): Promise<boolean>;
67
+ /**
68
+ * Get boundaries report
69
+ * @param {GetBoundariesReportParams} params containing information to get boundaries report
70
+ * - filters.userId: The user id
71
+ * - filters.boundaryId: The boundary id, optional
72
+ * - filters.boundaryName: The boundary name, optional
73
+ * - filters.imeis: The imeis, optional
74
+ * - filters.boundaryInStartDate: The boundary in start date, optional
75
+ * - filters.boundaryInEndDate: The boundary in end date, optional
76
+ * - filters.boundaryOutStartDate: The boundary out start date, optional
77
+ * - filters.boundaryOutEndDate: The boundary out end date, optional
78
+ * - pagingOptions.pageSize: The page size of the pagination, required
79
+ * - pagingOptions.pageIndex: The page index of the pagination, required
80
+ * - sortOptions.sortField: The field to sort the pagination, optional
81
+ * - sortOptions.sortOrder: The order to sort the pagination, optional
82
+ * @returns The boundaries report
83
+ */
84
+ getBoundariesReport(params: GetBoundariesReportParams): Promise<BoundariesReportEntity[]>;
67
85
  }
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ import { ReportPagination } from './common';
2
3
  export interface CreateAlertParams {
3
4
  id?: number;
4
5
  alertTypeId: number;
@@ -19,16 +20,6 @@ export interface CreateAlertParams {
19
20
  cellTowerRelevantAddress?: string;
20
21
  createdAt?: Date;
21
22
  }
22
- export interface ReportPagination {
23
- pagingOptions: {
24
- pageSize: number | 25;
25
- pageIndex: number | 0;
26
- };
27
- sortOptions?: {
28
- sortField: string;
29
- sortOrder: 'ASC' | 'DESC';
30
- };
31
- }
32
23
  export interface GetAlertReportByUserParams extends ReportPagination {
33
24
  filters: {
34
25
  userId: string;
@@ -43,6 +34,10 @@ export interface GetAlertReportByUserParams extends ReportPagination {
43
34
  createdFrom?: Date | null;
44
35
  createdTo?: Date | null;
45
36
  };
37
+ sortOptions?: {
38
+ sortField: string;
39
+ sortOrder: 'ASC' | 'DESC';
40
+ };
46
41
  }
47
42
  export interface GetAlertReportByClientParams extends ReportPagination {
48
43
  filters: {
@@ -52,6 +47,10 @@ export interface GetAlertReportByClientParams extends ReportPagination {
52
47
  sendTimeFrom?: Date | null;
53
48
  sendTimeTo?: Date | null;
54
49
  };
50
+ sortOptions?: {
51
+ sortField: string;
52
+ sortOrder: 'ASC' | 'DESC';
53
+ };
55
54
  }
56
55
  export interface AlertReport {
57
56
  id: number;
@@ -1,3 +1,4 @@
1
+ import { ReportPagination } from './common';
1
2
  import { BoundaryStatus } from './enums';
2
3
  export interface GetBoundariesByClientIdParams {
3
4
  filters: {
@@ -55,3 +56,38 @@ export interface DeleteBoundaryParams {
55
56
  modifiedBy: string;
56
57
  };
57
58
  }
59
+ export interface GetBoundariesReportParams extends ReportPagination {
60
+ filters: {
61
+ userId: string;
62
+ boundaryInStartDate?: Date;
63
+ boundaryInEndDate?: Date;
64
+ boundaryOutStartDate?: Date;
65
+ boundaryOutEndDate?: Date;
66
+ imeis?: string[];
67
+ boundaryId?: number;
68
+ boundaryName?: string;
69
+ minDuration?: number;
70
+ maxDuration?: number;
71
+ };
72
+ sortOptions?: {
73
+ sortField: 'inDateTime' | 'outDateTime' | 'inOutDuration' | 'name';
74
+ sortOrder: 'ASC' | 'DESC';
75
+ };
76
+ }
77
+ export interface BoundariesReportEntity {
78
+ deviceId: number;
79
+ imei: string;
80
+ deviceName?: string | null;
81
+ boundaryId: number;
82
+ boundaryName?: string | null;
83
+ inDate?: Date | null;
84
+ inLat?: number | null;
85
+ inLon?: number | null;
86
+ inAddress?: string | null;
87
+ outDate?: Date | null;
88
+ outLat?: number | null;
89
+ outLon?: number | null;
90
+ outAddress?: string | null;
91
+ inOutDuration?: number | null;
92
+ totalCount: number;
93
+ }
@@ -0,0 +1,6 @@
1
+ export interface ReportPagination {
2
+ pagingOptions: {
3
+ pageSize: number | 25;
4
+ pageIndex: number | 0;
5
+ };
6
+ }
@@ -1,3 +1,4 @@
1
+ import { ReportPagination } from './common';
1
2
  export interface CreatePositionParams {
2
3
  id?: number;
3
4
  imei: string;
@@ -21,7 +22,7 @@ export interface GetPositionsByImeiParams {
21
22
  imei: string;
22
23
  };
23
24
  }
24
- export interface GetPositionsReportByClientParams {
25
+ export interface GetPositionsReportByClientParams extends ReportPagination {
25
26
  filters: {
26
27
  clientId: number;
27
28
  imeis?: string[] | null;
@@ -32,10 +33,6 @@ export interface GetPositionsReportByClientParams {
32
33
  odometerMin?: number | null;
33
34
  odometerMax?: number | null;
34
35
  };
35
- pagingOptions: {
36
- pageSize: number | 25;
37
- pageIndex: number | 0;
38
- };
39
36
  sortOptions?: {
40
37
  sortField: string;
41
38
  sortOrder: 'ASC' | 'DESC';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.109",
3
+ "version": "0.0.110",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",