sowell-models 1.12.0 → 1.14.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sowell-models",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "description": "SoWell models",
5
5
  "type": "module",
6
6
  "engines": {
@@ -16,7 +16,8 @@ export interface ICheckpoint extends IModel {
16
16
  descriptionImgs?: string[]
17
17
  checklist?: IChecklist
18
18
  categoryId?: number
19
- category?: number | ICategory
19
+ category?: ICategory
20
+ defaultReasonId?: number
20
21
  visitProps?: IVisitProp[]
21
22
  locationId?: number
22
23
  location?: ILocation
@@ -52,6 +53,7 @@ export class SPCheckpointItem extends ApplicationRecord implements ICheckpoint {
52
53
  @Attr() description!: string
53
54
  @Attr() descriptionImgs!: string[]
54
55
  @Attr() categoryId!: number
56
+ @Attr() defaultReasonId!: number
55
57
  @Attr() locationId!: number
56
58
  @Attr() coefficient!: number
57
59
  @Attr() order!: number
@@ -7,6 +7,7 @@ import { CollectionFindOptions, IClearable } from '../interfaces';
7
7
  import { SPCategoryItem } from '../category';
8
8
 
9
9
  export interface IReason extends IModel {
10
+ id?: string;
10
11
  _id?: string;
11
12
  name: string;
12
13
  iconUrl?: string;
@@ -12,6 +12,7 @@ import { ISpot, SPSpotItem } from "../Spot"
12
12
  export interface IVisitSchedule extends IModel {
13
13
  _id?: string
14
14
  dueAt: Date
15
+ lastDoneAt?: Date
15
16
  checklistId?: string
16
17
  residence?: IResidence
17
18
  residenceId?: string
@@ -37,7 +38,7 @@ export class VisitSchedulesCollection
37
38
  async find(
38
39
  selector?: Record<string, any> | Partial<IVisitSchedule> | undefined,
39
40
  opts?: CollectionFindOptions
40
- ) {
41
+ ): Promise<IVisitSchedule[]> {
41
42
  const result = await super.find(selector, opts)
42
43
  return orderBy(result, ["dueAt"], ["asc"])
43
44
  }
@@ -50,6 +51,7 @@ export class SPVisitSchedule
50
51
  {
51
52
  static jsonapiType = "visit_schedules"
52
53
  @Attr() dueAt!: Date
54
+ @Attr() lastDoneAt?: Date
53
55
  @Attr() checklistId!: string
54
56
  @Attr() residenceId!: string
55
57
  @Attr() placeId!: string