sowell-models 1.30.0 → 1.31.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.30.0",
3
+ "version": "1.31.0",
4
4
  "description": "SoWell models",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -1,4 +1,4 @@
1
- import { Model, Attr, BelongsTo, HasMany } from "spraypaint"
1
+ import { Model, Attr, BelongsTo, HasMany, HasOne } from "spraypaint"
2
2
  import { IModel, PouchCollection, PouchORM } from "pouchorm"
3
3
  import { orderBy } from "lodash"
4
4
  import * as yup from "yup"
@@ -32,6 +32,7 @@ export interface IssueReportPayload {
32
32
  spot?: string
33
33
  areaNature?: "housing" | "other_spots" | "common_areas" | "zone"
34
34
  isTenantRequest?: boolean
35
+ tenantSpot?: string
35
36
  reason?: string
36
37
  origin?: string
37
38
  assignee?: string
@@ -89,6 +90,7 @@ export interface IIssueReport extends IModel {
89
90
  spot?: ISpot | ISpot[]
90
91
  imgs?: string[]
91
92
  isTenantRequest?: boolean
93
+ tenantSpot?: ISpot
92
94
  reason?: IReason
93
95
  origin?: IOrigin
94
96
  assignee?: IUser
@@ -161,6 +163,7 @@ export class SPIssueReportItem
161
163
  @BelongsTo() residence!: IResidence
162
164
  @BelongsTo() place!: SPPlaceItem
163
165
  @BelongsTo() spot!: SPSpotItem
166
+ @BelongsTo() tenantSpot?: SPSpotItem
164
167
  @BelongsTo() company!: SPCompany
165
168
  @BelongsTo() visitReport!: SPVisitReport
166
169
  @BelongsTo() checkpoint!: SPCheckpointItem
@@ -183,6 +186,7 @@ export class SPIssueReportItem
183
186
  priority: yup.number().required(),
184
187
  visitReport: yup.string(),
185
188
  isTenantRequest: yup.boolean(),
189
+ tenantSpot: yup.string().nullable().notRequired()
186
190
  })
187
191
 
188
192
  const isValid = await schema.isValid(payload)