@spytecgps/nova-orm 0.0.198 → 0.0.200

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,5 @@
1
+ import { BillingKlarnaOrder } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { BillingSubscriptionParams } from '../../types/billing';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const getBillingKlarnaOrderByImei: (novaDataSource: NovaDataSource, params: BillingSubscriptionParams, logger: Logger) => Promise<BillingKlarnaOrder>;
@@ -0,0 +1,5 @@
1
+ import { BillingSubscriptionBraintree } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { BillingSubscriptionParams } from '../../types/billing';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const getBillingSubscriptionsBraintreeByImei: (novaDataSource: NovaDataSource, params: BillingSubscriptionParams, logger: Logger) => Promise<BillingSubscriptionBraintree>;
@@ -1,5 +1,5 @@
1
1
  import { Billing, BillingCustomerBraintree, BillingDeviceHistory, BillingHubspotPaymentLog, BillingKlarnaCustomer, BillingKlarnaOrder, BillingStatusHistoryBraintree, BillingSubscriptionBraintree, Magento2Plan, User } from '../../entities';
2
- import { BillingSubscriptionChurnStatus, CanceledImeiResult, CreateBillingDeviceHistoryParams, CreateBillingHubspotPaymentLogParams, CreateBillingParams, CreateBillingStatusHistoryBraintreeParams, GetBillingCustomerBraintreeByIdParams, GetBillingsParams, GetBillingSubscriptionsBraintreeParams, GetCanceledImeisParams, GetChurnStatusByClientIdParams, GetClientIdFromBraintreeCustomerParams, GetMagentoPlanParams, GetUserByBraintreeCustomerIdParams, UpdateBillingCustomerBraintreeParams, UpdateBillingParams, UpsertBillingCustomerBraintreeParams, UpsertBillingKlarnaCustomerParams, UpsertBillingKlarnaOrderParams, UpsertBillingSubscriptionBraintreeParams } from '../../types/billing';
2
+ import { BillingSubscriptionChurnStatus, BillingSubscriptionParams, CanceledImeiResult, CreateBillingDeviceHistoryParams, CreateBillingHubspotPaymentLogParams, CreateBillingParams, CreateBillingStatusHistoryBraintreeParams, GetBillingCustomerBraintreeByIdParams, GetBillingsParams, GetBillingSubscriptionsBraintreeParams, GetCanceledImeisParams, GetChurnStatusByClientIdParams, GetClientIdFromBraintreeCustomerParams, GetMagentoPlanParams, GetUserByBraintreeCustomerIdParams, UpdateBillingCustomerBraintreeParams, UpdateBillingParams, UpsertBillingCustomerBraintreeParams, UpsertBillingKlarnaCustomerParams, UpsertBillingKlarnaOrderParams, UpsertBillingSubscriptionBraintreeParams } from '../../types/billing';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class BillingRepository extends BaseRepository {
5
5
  /**
@@ -190,4 +190,18 @@ export declare class BillingRepository extends BaseRepository {
190
190
  * @returns The upserted billing klarna order information
191
191
  */
192
192
  upsertBillingKlarnaOrder(params: UpsertBillingKlarnaOrderParams): Promise<BillingKlarnaOrder>;
193
+ /**
194
+ * Get billing subscription braintree by imei
195
+ * @param {BillingSubscriptionParams} params
196
+ * - imei: The imei of the device
197
+ * @returns {Promise<BillingSubscriptionBraintree>} The billing subscription braintree information
198
+ */
199
+ getBillingSubscriptionsBraintreeByImei(params: BillingSubscriptionParams): Promise<BillingSubscriptionBraintree>;
200
+ /**
201
+ * Get billing klarna order by imei
202
+ * @param {BillingSubscriptionParams} params
203
+ * - imei: The imei of the device
204
+ * @returns {Promise<BillingSubscriptionBraintree>} The billing klarna order information
205
+ */
206
+ getBillingKlarnaOrderByImei(params: BillingSubscriptionParams): Promise<BillingKlarnaOrder>;
193
207
  }
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { Logger } from '../../types/logger';
3
+ import { CompleteTaskParams } from '../../types/tasks';
4
+ export declare const completeTask: (novaDataSource: NovaDataSource, params: CompleteTaskParams, logger: Logger) => Promise<boolean>;
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { Logger } from '../../types/logger';
3
+ import { DeleteTaskParams } from '../../types/tasks';
4
+ export declare const deleteTask: (novaDataSource: NovaDataSource, params: DeleteTaskParams, logger: Logger) => Promise<boolean>;
@@ -1,5 +1,5 @@
1
1
  import { DeviceTask, Task, TaskSchedule } from '../../entities';
2
- import { AddTaskScheduleDevicesParams, CreateTaskParams, CreateTaskScheduleParams, DeleteTaskScheduleDevicesParams, DeleteTaskScheduleParams, GetDeviceTasksParams, GetTaskScheduleParams, GetTaskSchedulesParams, GetTasksParams, SetTaskScheduleDevicesParams, UpdateTaskParams, UpdateTaskScheduleParams } from '../../types/tasks';
2
+ import { AddTaskScheduleDevicesParams, CompleteTaskParams, CreateTaskParams, CreateTaskScheduleParams, DeleteTaskParams, DeleteTaskScheduleDevicesParams, DeleteTaskScheduleParams, GetDeviceTasksParams, GetTaskScheduleParams, GetTaskSchedulesParams, GetTasksParams, SetTaskScheduleDevicesParams, UpdateTaskParams, UpdateTaskScheduleParams } from '../../types/tasks';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class TasksRepository extends BaseRepository {
5
5
  /**
@@ -206,4 +206,23 @@ export declare class TasksRepository extends BaseRepository {
206
206
  * @returns Promise<boolean> whether the task was updated
207
207
  */
208
208
  updateTask(params: UpdateTaskParams): Promise<boolean>;
209
+ /**
210
+ * Complete a task
211
+ * @param params params containing information to complete task
212
+ * params.id: the ID, required
213
+ * params.completedBy: the completed by, required
214
+ * params.completionNotes: the completion notes, optional
215
+ * params.completionOdometer: the completion odometer, optional
216
+ * params.completionActiveHours: the completion active hours, optional
217
+ * @returns Promise<boolean> whether the task was completed
218
+ */
219
+ completeTask(params: CompleteTaskParams): Promise<boolean>;
220
+ /**
221
+ * Delete an existing task
222
+ * @param params params containing information to delete task
223
+ * params.id: the ID, required
224
+ * params.deletedBy: the user performing the delete action, required
225
+ * @returns Promise<boolean> whether the task was deleted
226
+ */
227
+ deleteTask(params: DeleteTaskParams): Promise<boolean>;
209
228
  }
@@ -103,6 +103,9 @@ export interface GetBillingSubscriptionsBraintreeParams {
103
103
  clientId?: number;
104
104
  };
105
105
  }
106
+ export interface BillingSubscriptionParams {
107
+ imei: string;
108
+ }
106
109
  export interface GetChurnStatusByClientIdParams {
107
110
  filters: {
108
111
  clientId: number;
@@ -154,3 +154,14 @@ export interface UpdateTaskParams {
154
154
  queuedAt?: Date;
155
155
  };
156
156
  }
157
+ export interface CompleteTaskParams {
158
+ id: number;
159
+ completedBy: string;
160
+ completionNotes?: string;
161
+ completionOdometer?: number;
162
+ completionActiveHours?: number;
163
+ }
164
+ export interface DeleteTaskParams {
165
+ id: number;
166
+ deletedBy: string;
167
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.198",
3
+ "version": "0.0.200",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",