@spytecgps/nova-orm 0.0.184 → 0.0.185

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 { TaskSchedule } from '../../entities';
2
- import { CreateTaskScheduleParams, GetTaskScheduleParams } from '../../types/tasks';
2
+ import { CreateTaskScheduleParams, GetTaskScheduleParams, UpdateTaskScheduleParams } from '../../types/tasks';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class TasksRepository extends BaseRepository {
5
5
  /**
@@ -31,4 +31,26 @@ export declare class TasksRepository extends BaseRepository {
31
31
  * @returns Promise<TaskSchedule> the task schedule
32
32
  */
33
33
  getTaskSchedule(params: GetTaskScheduleParams): Promise<TaskSchedule>;
34
+ /**
35
+ * Update an existing task schedule
36
+ * @param params params containing information to update task schedule
37
+ * params.filters.id: the ID, required
38
+ * params.values.clientId: the client ID, optional
39
+ * params.values.title: the title, optional
40
+ * params.values.description: the description, optional
41
+ * params.values.repeats: whether the task repeats, optional
42
+ * params.values.dueDate: the due date, required if repeats is false
43
+ * params.values.dueOdometer: the due odometer, required if repeats is false
44
+ * params.values.dueActiveHours: the due active hours, required if repeats is false
45
+ * params.values.intervalDays: the interval days, required if repeats is true
46
+ * params.values.intervalOdometer: the interval odometer, required if repeats is true
47
+ * params.values.intervalActiveHours: the interval active hours, required if repeats is true
48
+ * params.values.intervalStartDate: the interval start date
49
+ * params.values.intervalStartingOdometer: the interval starting odometer
50
+ * params.values.intervalStartingActiveHours: the interval starting active hours
51
+ * params.values.notes: the notes, optional
52
+ * params.values.modifiedBy: the modified by, required
53
+ * @returns Promise<boolean> whether the task schedule was updated
54
+ */
55
+ updateTaskSchedule(params: UpdateTaskScheduleParams): Promise<boolean>;
34
56
  }
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { Logger } from '../../types/logger';
3
+ import { UpdateTaskScheduleParams } from '../../types/tasks';
4
+ export declare const updateTaskSchedule: (novaDataSource: NovaDataSource, params: UpdateTaskScheduleParams, logger: Logger) => Promise<boolean>;
@@ -21,3 +21,25 @@ export interface GetTaskScheduleParams {
21
21
  id: number;
22
22
  };
23
23
  }
24
+ export interface UpdateTaskScheduleParams {
25
+ filters: {
26
+ id: number;
27
+ };
28
+ values: {
29
+ clientId?: number;
30
+ title?: string;
31
+ description?: string;
32
+ repeats?: boolean;
33
+ dueDate?: Date;
34
+ dueOdometer?: number;
35
+ dueActiveHours?: number;
36
+ intervalDays?: number;
37
+ intervalStartDate?: Date;
38
+ intervalOdometer?: number;
39
+ intervalStartingOdometer?: number;
40
+ intervalActiveHours?: number;
41
+ intervalStartingActiveHours?: number;
42
+ notes?: string;
43
+ modifiedBy: string;
44
+ };
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.184",
3
+ "version": "0.0.185",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",