@spytecgps/nova-orm 0.0.123 → 0.0.124

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.
@@ -1,5 +1,5 @@
1
1
  import { Boundary } from '../../entities';
2
- import { BoundariesReportEntity, CreateBoundaryParams, DeleteBoundaryParams, GetBoundariesByClientIdParams, GetBoundariesReportParams, GetBoundaryByIdParams, UpdateBoundaryParams, UpsertBoundaryEventParams } from '../../types/boundaries';
2
+ import { BoundariesReportEntity, CreateBoundaryParams, DeleteBoundaryParams, GetBoundariesByClientIdParams, GetBoundariesReportParams, GetBoundaryByIdParams, ProcessBoundaryEventParams, UpdateBoundaryParams, UpsertBoundaryEventParams } from '../../types/boundaries';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class BoundariesRepository extends BaseRepository {
5
5
  /**
@@ -82,6 +82,20 @@ export declare class BoundariesRepository extends BaseRepository {
82
82
  * @returns The boundaries report
83
83
  */
84
84
  getBoundariesReport(params: GetBoundariesReportParams): Promise<BoundariesReportEntity[]>;
85
+ /**
86
+ * Process boundary event
87
+ * @param {ProcessBoundaryEventParams} params containing information to process boundary event
88
+ * - boundaryId: The boundary id
89
+ * - imei: The imei of the device
90
+ * - userId: The user id
91
+ * - sendTime: The event date
92
+ * - eventType: The event type (enter or exit)
93
+ * - lat: The latitude of the event
94
+ * - lon: The longitude of the event
95
+ * - address: The address of the event
96
+ * @returns true if the event was processed, false otherwise
97
+ */
98
+ processBoundaryEvent(params: ProcessBoundaryEventParams): Promise<boolean>;
85
99
  /**
86
100
  * Upsert boundary event
87
101
  * @param {UpsertBoundaryEventParams} params containing information to upsert boundary event
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { ProcessBoundaryEventParams } from '../../types/boundaries';
3
+ import { Logger } from '../../types/logger';
4
+ export declare const processBoundaryEvent: (novaDataSource: NovaDataSource, params: ProcessBoundaryEventParams, logger: Logger) => Promise<boolean>;
@@ -1,5 +1,5 @@
1
1
  import { ReportPagination } from './common';
2
- import { BoundaryStatus } from './enums';
2
+ import { BoundaryEventType, BoundaryStatus } from './enums';
3
3
  export interface GetBoundariesByClientIdParams {
4
4
  filters: {
5
5
  clientId: number;
@@ -91,6 +91,16 @@ export interface BoundariesReportEntity {
91
91
  inOutDuration?: number | null;
92
92
  totalCount: number;
93
93
  }
94
+ export interface ProcessBoundaryEventParams {
95
+ imei: string;
96
+ boundaryId: number;
97
+ userId: string;
98
+ sendTime: Date;
99
+ eventType: BoundaryEventType;
100
+ lat: number;
101
+ lon: number;
102
+ address: string;
103
+ }
94
104
  export interface UpsertBoundaryEventParams {
95
105
  id: number;
96
106
  deviceId: number;
@@ -56,3 +56,7 @@ export declare enum TripCompletionStatus {
56
56
  TempCurrent = 10,
57
57
  TempCompleted = 20
58
58
  }
59
+ export declare enum BoundaryEventType {
60
+ Enter = "boundaryEnter",
61
+ Exit = "boundaryExit"
62
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.123",
3
+ "version": "0.0.124",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",