@spytecgps/nova-orm 0.0.197 → 0.0.199

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>;
@@ -1,5 +1,5 @@
1
1
  import { DeviceTask, Task, TaskSchedule } from '../../entities';
2
- import { AddTaskScheduleDevicesParams, CreateTaskParams, CreateTaskScheduleParams, DeleteTaskScheduleDevicesParams, DeleteTaskScheduleParams, GetDeviceTasksParams, GetTaskScheduleParams, GetTaskSchedulesParams, GetTasksParams, SetTaskScheduleDevicesParams, UpdateTaskScheduleParams } from '../../types/tasks';
2
+ import { AddTaskScheduleDevicesParams, CompleteTaskParams, CreateTaskParams, CreateTaskScheduleParams, 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
  /**
@@ -189,4 +189,32 @@ export declare class TasksRepository extends BaseRepository {
189
189
  * @returns Promise<Task[]> the tasks corresponding to the filters
190
190
  */
191
191
  getTasks(params: GetTasksParams): Promise<Task[]>;
192
+ /**
193
+ * Update an existing task
194
+ * @param params params containing information to update task
195
+ * params.filters.id: the ID, required
196
+ * params.values.modifiedBy: the modified by, required
197
+ * One of dueDate, dueOdometer, or dueActiveHours is required:
198
+ * params.values.dueDate: the due date, optional
199
+ * params.values.dueOdometer: the due odometer, optional
200
+ * params.values.dueActiveHours: the due active hours, optional
201
+ * params.values.startDate: the starting date, optional
202
+ * params.values.startingOdometer: the starting odometer, optional
203
+ * params.values.startingActiveHours: the starting active hours, optional
204
+ * params.values.predictedDueDate: the predicted due date, optional
205
+ * params.values.queuedAt: the queued at, optional
206
+ * @returns Promise<boolean> whether the task was updated
207
+ */
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>;
192
220
  }
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { Logger } from '../../types/logger';
3
+ import { UpdateTaskParams } from '../../types/tasks';
4
+ export declare const updateTask: (novaDataSource: NovaDataSource, params: UpdateTaskParams, logger: Logger) => Promise<boolean>;
@@ -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;
@@ -138,3 +138,26 @@ export interface GetTasksFilters {
138
138
  export interface GetTasksParams {
139
139
  filters: GetTasksFilters;
140
140
  }
141
+ export interface UpdateTaskParams {
142
+ filters: {
143
+ id: number;
144
+ };
145
+ values: {
146
+ dueDate?: Date;
147
+ dueOdometer?: number;
148
+ dueActiveHours?: number;
149
+ modifiedBy: string;
150
+ startDate?: Date;
151
+ startingOdometer?: number;
152
+ startingActiveHours?: number;
153
+ predictedDueDate?: Date;
154
+ queuedAt?: Date;
155
+ };
156
+ }
157
+ export interface CompleteTaskParams {
158
+ id: number;
159
+ completedBy: string;
160
+ completionNotes?: string;
161
+ completionOdometer?: number;
162
+ completionActiveHours?: number;
163
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.197",
3
+ "version": "0.0.199",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",