sowell-models 1.17.0 → 1.19.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/README.md +1 -1
- package/build/index.d.ts +28 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +27 -0
- package/build/models/Agency/index.d.ts +26 -0
- package/build/models/Agency/index.d.ts.map +1 -0
- package/build/models/Agency/index.js +61 -0
- package/build/models/ApplicationRecord/index.d.ts +7 -0
- package/build/models/ApplicationRecord/index.d.ts.map +1 -0
- package/build/models/ApplicationRecord/index.js +18 -0
- package/build/models/AreaItem/index.d.ts +51 -0
- package/build/models/AreaItem/index.d.ts.map +1 -0
- package/build/models/AreaItem/index.js +101 -0
- package/build/models/Assignation/index.d.ts +17 -0
- package/build/models/Assignation/index.d.ts.map +1 -0
- package/build/models/Assignation/index.js +24 -0
- package/build/models/Author/index.d.ts +8 -0
- package/build/models/Author/index.d.ts.map +1 -0
- package/build/models/Author/index.js +22 -0
- package/build/models/Checklist/index.d.ts +41 -0
- package/build/models/Checklist/index.d.ts.map +1 -0
- package/build/models/Checklist/index.js +79 -0
- package/build/models/Checkpoint/index.d.ts +45 -0
- package/build/models/Checkpoint/index.d.ts.map +1 -0
- package/build/models/Checkpoint/index.js +85 -0
- package/build/models/Company/index.d.ts +22 -0
- package/build/models/Company/index.d.ts.map +1 -0
- package/build/models/Company/index.js +33 -0
- package/build/models/Export/index.d.ts +22 -0
- package/build/models/Export/index.d.ts.map +1 -0
- package/build/models/Export/index.js +34 -0
- package/build/models/Family/index.d.ts +20 -0
- package/build/models/Family/index.d.ts.map +1 -0
- package/build/models/Family/index.js +55 -0
- package/build/models/IssueReport/index.d.ts +135 -0
- package/build/models/IssueReport/index.d.ts.map +1 -0
- package/build/models/IssueReport/index.js +193 -0
- package/build/models/Location/index.d.ts +24 -0
- package/build/models/Location/index.d.ts.map +1 -0
- package/build/models/Location/index.js +33 -0
- package/build/models/Origin/index.d.ts +23 -0
- package/build/models/Origin/index.d.ts.map +1 -0
- package/build/models/Origin/index.js +58 -0
- package/build/models/Place/index.d.ts +49 -0
- package/build/models/Place/index.d.ts.map +1 -0
- package/build/models/Place/index.js +89 -0
- package/build/models/Provider/index.d.ts +22 -0
- package/build/models/Provider/index.d.ts.map +1 -0
- package/build/models/Provider/index.js +58 -0
- package/build/models/Reason/index.d.ts +24 -0
- package/build/models/Reason/index.d.ts.map +1 -0
- package/build/models/Reason/index.js +58 -0
- package/build/models/Residence/index.d.ts +30 -0
- package/build/models/Residence/index.d.ts.map +1 -0
- package/build/models/Residence/index.js +64 -0
- package/build/models/Sector/index.d.ts +33 -0
- package/build/models/Sector/index.d.ts.map +1 -0
- package/build/models/Sector/index.js +72 -0
- package/build/models/Spot/index.d.ts +28 -0
- package/build/models/Spot/index.d.ts.map +1 -0
- package/build/models/Spot/index.js +61 -0
- package/build/models/UnseenIssue/index.d.ts +14 -0
- package/build/models/UnseenIssue/index.d.ts.map +1 -0
- package/build/models/UnseenIssue/index.js +21 -0
- package/build/models/User/index.d.ts +53 -0
- package/build/models/User/index.d.ts.map +1 -0
- package/build/models/User/index.js +116 -0
- package/build/models/VisitProp/index.d.ts +31 -0
- package/build/models/VisitProp/index.d.ts.map +1 -0
- package/build/models/VisitProp/index.js +42 -0
- package/build/models/VisitReport/index.d.ts +95 -0
- package/build/models/VisitReport/index.d.ts.map +1 -0
- package/build/models/VisitReport/index.js +110 -0
- package/build/models/VisitSchedule/index.d.ts +42 -0
- package/build/models/VisitSchedule/index.d.ts.map +1 -0
- package/build/models/VisitSchedule/index.js +82 -0
- package/build/models/category/index.d.ts +34 -0
- package/build/models/category/index.d.ts.map +1 -0
- package/build/models/category/index.js +70 -0
- package/build/models/interfaces.d.ts +8 -0
- package/build/models/interfaces.d.ts.map +1 -0
- package/build/models/interfaces.js +1 -0
- package/build/models/types.d.ts +7 -0
- package/build/models/types.d.ts.map +1 -0
- package/build/models/types.js +9 -0
- package/build/utils/arrayDiffBy.d.ts +7 -0
- package/build/utils/arrayDiffBy.d.ts.map +1 -0
- package/build/utils/arrayDiffBy.js +9 -0
- package/package.json +24 -2
- package/src/index.ts +1 -0
- package/src/models/Reason/index.ts +2 -0
- package/src/models/category/index.ts +4 -2
- package/.editorconfig +0 -15
- package/.github/workflows/publish.yml +0 -24
- package/.github/workflows/remove-stale-branches.yml +0 -19
- package/.prettierrc +0 -6
- package/eslint.config.mjs +0 -43
- package/index.ts +0 -1
- package/tsconfig.json +0 -13
- package/tsconfig.release.json +0 -9
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import { Model, Attr, BelongsTo, HasMany } from "spraypaint";
|
|
17
|
+
import { PouchCollection, PouchORM } from "pouchorm";
|
|
18
|
+
import { orderBy } from "lodash";
|
|
19
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
20
|
+
export class CheckpointCollection extends PouchCollection {
|
|
21
|
+
beforeInit() {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
clear() {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
yield PouchORM.clearDatabase("checkpoints");
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
find(selector, opts) {
|
|
31
|
+
const _super = Object.create(null, {
|
|
32
|
+
find: { get: () => super.find }
|
|
33
|
+
});
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const result = yield _super.find.call(this, selector, opts);
|
|
36
|
+
return orderBy(result, ["question"], ["asc"]);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
let SPCheckpointItem = class SPCheckpointItem extends ApplicationRecord {
|
|
41
|
+
};
|
|
42
|
+
SPCheckpointItem.jsonapiType = "checkpoints";
|
|
43
|
+
__decorate([
|
|
44
|
+
Attr()
|
|
45
|
+
], SPCheckpointItem.prototype, "question", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
Attr()
|
|
48
|
+
], SPCheckpointItem.prototype, "description", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
Attr()
|
|
51
|
+
], SPCheckpointItem.prototype, "descriptionImgs", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
Attr()
|
|
54
|
+
], SPCheckpointItem.prototype, "categoryId", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
Attr()
|
|
57
|
+
], SPCheckpointItem.prototype, "defaultReasonId", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
Attr()
|
|
60
|
+
], SPCheckpointItem.prototype, "locationId", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
Attr()
|
|
63
|
+
], SPCheckpointItem.prototype, "coefficient", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
Attr()
|
|
66
|
+
], SPCheckpointItem.prototype, "order", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
Attr()
|
|
69
|
+
], SPCheckpointItem.prototype, "disallowExclusion", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
BelongsTo()
|
|
72
|
+
], SPCheckpointItem.prototype, "category", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
BelongsTo()
|
|
75
|
+
], SPCheckpointItem.prototype, "checklist", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
BelongsTo()
|
|
78
|
+
], SPCheckpointItem.prototype, "location", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
HasMany()
|
|
81
|
+
], SPCheckpointItem.prototype, "visitProps", void 0);
|
|
82
|
+
SPCheckpointItem = __decorate([
|
|
83
|
+
Model()
|
|
84
|
+
], SPCheckpointItem);
|
|
85
|
+
export { SPCheckpointItem };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IModel } from "pouchorm";
|
|
2
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
3
|
+
import { SPAreaItem } from "../AreaItem";
|
|
4
|
+
import { SPAgencyItem } from "../Agency";
|
|
5
|
+
import { SPResidenceItem } from "../Residence";
|
|
6
|
+
import { SPPlaceItem } from "../Place";
|
|
7
|
+
export interface ICompany extends IModel {
|
|
8
|
+
id?: string;
|
|
9
|
+
_id?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
config?: Record<string, any>;
|
|
12
|
+
}
|
|
13
|
+
export declare class SPCompany extends ApplicationRecord implements ICompany {
|
|
14
|
+
static jsonapiType: string;
|
|
15
|
+
name: string;
|
|
16
|
+
config: Record<string, any>;
|
|
17
|
+
spAreaItems: SPAreaItem[];
|
|
18
|
+
spAgencyItems: SPAgencyItem[];
|
|
19
|
+
spResidenceItems: SPResidenceItem[];
|
|
20
|
+
spPlaceItems: SPPlaceItem[];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Company/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEtC,MAAM,WAAW,QAAS,SAAQ,MAAM;IACtC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC7B;AAED,qBACa,SAAU,SAAQ,iBAAkB,YAAW,QAAQ;IAClE,MAAM,CAAC,WAAW,SAAc;IACxB,IAAI,EAAG,MAAM,CAAA;IACb,MAAM,EAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAClB,WAAW,EAAG,UAAU,EAAE,CAAA;IACvB,aAAa,EAAG,YAAY,EAAE,CAAA;IAC5B,gBAAgB,EAAG,eAAe,EAAE,CAAA;IACxC,YAAY,EAAG,WAAW,EAAE,CAAA;CAChD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Model, Attr, HasMany } from "spraypaint";
|
|
8
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
9
|
+
let SPCompany = class SPCompany extends ApplicationRecord {
|
|
10
|
+
};
|
|
11
|
+
SPCompany.jsonapiType = "companies";
|
|
12
|
+
__decorate([
|
|
13
|
+
Attr()
|
|
14
|
+
], SPCompany.prototype, "name", void 0);
|
|
15
|
+
__decorate([
|
|
16
|
+
Attr()
|
|
17
|
+
], SPCompany.prototype, "config", void 0);
|
|
18
|
+
__decorate([
|
|
19
|
+
HasMany("areas")
|
|
20
|
+
], SPCompany.prototype, "spAreaItems", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
HasMany("agencies")
|
|
23
|
+
], SPCompany.prototype, "spAgencyItems", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
HasMany("residences")
|
|
26
|
+
], SPCompany.prototype, "spResidenceItems", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
HasMany("places")
|
|
29
|
+
], SPCompany.prototype, "spPlaceItems", void 0);
|
|
30
|
+
SPCompany = __decorate([
|
|
31
|
+
Model()
|
|
32
|
+
], SPCompany);
|
|
33
|
+
export { SPCompany };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
2
|
+
export declare enum ExportStatus {
|
|
3
|
+
ONGOING = "ongoing",
|
|
4
|
+
PENDING = "pending",
|
|
5
|
+
DONE = "done",
|
|
6
|
+
FAILED = "failed"
|
|
7
|
+
}
|
|
8
|
+
export interface IExport {
|
|
9
|
+
id?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
status?: ExportStatus;
|
|
12
|
+
params?: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class SPExport extends ApplicationRecord implements IExport {
|
|
16
|
+
static jsonapiType: string;
|
|
17
|
+
name: string;
|
|
18
|
+
status: ExportStatus;
|
|
19
|
+
url: string;
|
|
20
|
+
params: string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Export/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,qBACa,QAAS,SAAQ,iBAAkB,YAAW,OAAO;IAChE,MAAM,CAAC,WAAW,SAAY;IACtB,IAAI,EAAG,MAAM,CAAA;IACb,MAAM,EAAG,YAAY,CAAA;IACrB,GAAG,EAAG,MAAM,CAAA;IACZ,MAAM,EAAG,MAAM,CAAA;CACxB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Model, Attr } from "spraypaint";
|
|
8
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
9
|
+
export var ExportStatus;
|
|
10
|
+
(function (ExportStatus) {
|
|
11
|
+
ExportStatus["ONGOING"] = "ongoing";
|
|
12
|
+
ExportStatus["PENDING"] = "pending";
|
|
13
|
+
ExportStatus["DONE"] = "done";
|
|
14
|
+
ExportStatus["FAILED"] = "failed";
|
|
15
|
+
})(ExportStatus || (ExportStatus = {}));
|
|
16
|
+
let SPExport = class SPExport extends ApplicationRecord {
|
|
17
|
+
};
|
|
18
|
+
SPExport.jsonapiType = "exports";
|
|
19
|
+
__decorate([
|
|
20
|
+
Attr()
|
|
21
|
+
], SPExport.prototype, "name", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
Attr()
|
|
24
|
+
], SPExport.prototype, "status", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
Attr()
|
|
27
|
+
], SPExport.prototype, "url", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
Attr()
|
|
30
|
+
], SPExport.prototype, "params", void 0);
|
|
31
|
+
SPExport = __decorate([
|
|
32
|
+
Model()
|
|
33
|
+
], SPExport);
|
|
34
|
+
export { SPExport };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
2
|
+
import { PouchCollection } from "pouchorm";
|
|
3
|
+
import { CollectionFindOptions, IClearable } from "../interfaces";
|
|
4
|
+
export interface IFamily {
|
|
5
|
+
_id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
iconUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class SPFamily extends ApplicationRecord implements IFamily {
|
|
10
|
+
static jsonapiType: string;
|
|
11
|
+
name: string;
|
|
12
|
+
iconUrl: string;
|
|
13
|
+
get _id(): string | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare class FamilyCollection extends PouchCollection<IFamily> implements IClearable {
|
|
16
|
+
beforeInit(): Promise<void>;
|
|
17
|
+
clear(): Promise<void>;
|
|
18
|
+
find(selector?: Record<string, any> | Partial<IFamily> | undefined, opts?: CollectionFindOptions): Promise<IFamily[]>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Family/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAY,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAGjE,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AACD,qBACa,QAAS,SAAQ,iBAAkB,YAAW,OAAO;IAChE,MAAM,CAAC,WAAW,SAAa;IACvB,IAAI,EAAG,MAAM,CAAA;IACb,OAAO,EAAG,MAAM,CAAA;IACxB,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;CACF;AAED,qBAAa,gBACX,SAAQ,eAAe,CAAC,OAAO,CAC/B,YAAW,UAAU;IAEf,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,IAAI,CACR,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,EAC7D,IAAI,CAAC,EAAE,qBAAqB;CAK/B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import { Model, Attr } from "spraypaint";
|
|
17
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
18
|
+
import { PouchCollection, PouchORM } from "pouchorm";
|
|
19
|
+
import { orderBy } from "lodash";
|
|
20
|
+
let SPFamily = class SPFamily extends ApplicationRecord {
|
|
21
|
+
get _id() {
|
|
22
|
+
return this.id;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
SPFamily.jsonapiType = "families";
|
|
26
|
+
__decorate([
|
|
27
|
+
Attr()
|
|
28
|
+
], SPFamily.prototype, "name", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
Attr()
|
|
31
|
+
], SPFamily.prototype, "iconUrl", void 0);
|
|
32
|
+
SPFamily = __decorate([
|
|
33
|
+
Model()
|
|
34
|
+
], SPFamily);
|
|
35
|
+
export { SPFamily };
|
|
36
|
+
export class FamilyCollection extends PouchCollection {
|
|
37
|
+
beforeInit() {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
clear() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
yield PouchORM.clearDatabase("places");
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
find(selector, opts) {
|
|
47
|
+
const _super = Object.create(null, {
|
|
48
|
+
find: { get: () => super.find }
|
|
49
|
+
});
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
const result = yield _super.find.call(this, selector, opts);
|
|
52
|
+
return orderBy(result, ["name"], ["asc"]);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { IModel, PouchCollection } from "pouchorm";
|
|
2
|
+
import { ICompany, SPCompany } from "../Company";
|
|
3
|
+
import { ICategory, SPCategoryItem } from "../category";
|
|
4
|
+
import { IPlace, SPPlaceItem } from "../Place";
|
|
5
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
6
|
+
import { IUser, SPUserItem } from "../User";
|
|
7
|
+
import { ICheckpoint, SPCheckpointItem } from "../Checkpoint";
|
|
8
|
+
import { SPVisitReport } from "../VisitReport";
|
|
9
|
+
import { IResidence } from "../Residence";
|
|
10
|
+
import { IArea } from "../AreaItem";
|
|
11
|
+
import { CollectionFindOptions, IClearable } from "../interfaces";
|
|
12
|
+
import { ISpot, SPSpotItem } from "./../Spot";
|
|
13
|
+
import { IReason, SPReasonItem } from "../Reason";
|
|
14
|
+
import { IOrigin, SPOriginItem } from "../Origin";
|
|
15
|
+
import { SPUnseenIssue } from "../UnseenIssue";
|
|
16
|
+
import { SPAssignee } from "../Author";
|
|
17
|
+
export interface IssueReportPayload {
|
|
18
|
+
category?: string;
|
|
19
|
+
agency?: string;
|
|
20
|
+
residence?: string;
|
|
21
|
+
place?: string;
|
|
22
|
+
checkpoint?: string;
|
|
23
|
+
description: string;
|
|
24
|
+
priority: number;
|
|
25
|
+
visitReport?: string;
|
|
26
|
+
imgs?: File[];
|
|
27
|
+
spot?: string;
|
|
28
|
+
areaNature?: "housing" | "other_spots" | "common_areas" | "zone";
|
|
29
|
+
isTenantRequest?: boolean;
|
|
30
|
+
reason?: string;
|
|
31
|
+
origin?: string;
|
|
32
|
+
assignee?: string;
|
|
33
|
+
}
|
|
34
|
+
export type Tab = "mySector" | "others";
|
|
35
|
+
export interface TalkPayload {
|
|
36
|
+
id: string;
|
|
37
|
+
issueReportId: string;
|
|
38
|
+
message: string;
|
|
39
|
+
tab: Tab;
|
|
40
|
+
}
|
|
41
|
+
export interface ITalk {
|
|
42
|
+
id: string;
|
|
43
|
+
author: {
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
47
|
+
message: string;
|
|
48
|
+
files: string[];
|
|
49
|
+
created_at?: Date;
|
|
50
|
+
}
|
|
51
|
+
export type ActivityName = "assignation" | "status" | "email_sent" | "erp";
|
|
52
|
+
export interface IActivity extends IModel {
|
|
53
|
+
_id?: string;
|
|
54
|
+
name: ActivityName;
|
|
55
|
+
createdAt: Date;
|
|
56
|
+
metadata?: Record<string, any>;
|
|
57
|
+
authorId?: string;
|
|
58
|
+
author?: IUser;
|
|
59
|
+
issueReportId?: string;
|
|
60
|
+
issueReport?: IIssueReport;
|
|
61
|
+
}
|
|
62
|
+
export interface IIssueReport extends IModel {
|
|
63
|
+
_id?: string;
|
|
64
|
+
remoteId?: string;
|
|
65
|
+
priority: string;
|
|
66
|
+
message: string;
|
|
67
|
+
status: string;
|
|
68
|
+
checkpointId?: number;
|
|
69
|
+
createdAt?: Date;
|
|
70
|
+
updatedAt?: Date;
|
|
71
|
+
place?: IPlace;
|
|
72
|
+
category?: ICategory;
|
|
73
|
+
checkpoint?: ICheckpoint;
|
|
74
|
+
author?: IUser;
|
|
75
|
+
company?: ICompany;
|
|
76
|
+
residence?: IResidence;
|
|
77
|
+
area?: IArea;
|
|
78
|
+
talks?: ITalk[];
|
|
79
|
+
activities?: IActivity[];
|
|
80
|
+
spot?: ISpot | ISpot[];
|
|
81
|
+
imgs?: string[];
|
|
82
|
+
isTenantRequest?: boolean;
|
|
83
|
+
reason?: IReason;
|
|
84
|
+
origin?: IOrigin;
|
|
85
|
+
assignee?: IUser;
|
|
86
|
+
seen?: boolean;
|
|
87
|
+
validate?: () => string;
|
|
88
|
+
}
|
|
89
|
+
export declare class IssueCollection extends PouchCollection<IIssueReport> implements IClearable {
|
|
90
|
+
beforeInit(): Promise<void>;
|
|
91
|
+
clear(): Promise<void>;
|
|
92
|
+
find(selector?: Record<string, any> | Partial<IIssueReport> | undefined, opts?: CollectionFindOptions): Promise<IIssueReport[]>;
|
|
93
|
+
bulkUpsertIfNotExists(items: IIssueReport[]): Promise<IIssueReport[]>;
|
|
94
|
+
}
|
|
95
|
+
export declare class SPActivity extends ApplicationRecord implements IActivity {
|
|
96
|
+
static jsonapiType: string;
|
|
97
|
+
name: ActivityName;
|
|
98
|
+
createdAt: Date;
|
|
99
|
+
metadata: Record<string, any>;
|
|
100
|
+
issueReport: SPIssueReportItem;
|
|
101
|
+
author: SPUserItem;
|
|
102
|
+
}
|
|
103
|
+
export declare class SPIssueReportItem extends ApplicationRecord implements Partial<IIssueReport> {
|
|
104
|
+
static jsonapiType: string;
|
|
105
|
+
isTenantRequest: boolean;
|
|
106
|
+
message: string;
|
|
107
|
+
talks: ITalk[];
|
|
108
|
+
imgs: string[];
|
|
109
|
+
priority: string;
|
|
110
|
+
status: string;
|
|
111
|
+
checkpointId: number;
|
|
112
|
+
createdAt: Date;
|
|
113
|
+
updatedAt: Date;
|
|
114
|
+
pendingIimestamp: Date;
|
|
115
|
+
ongoingTimestamp: Date;
|
|
116
|
+
doneTimestamp: Date;
|
|
117
|
+
canceledTimestamp: Date;
|
|
118
|
+
rejectedTimestamp: Date;
|
|
119
|
+
seen: boolean;
|
|
120
|
+
author: SPUserItem;
|
|
121
|
+
category: SPCategoryItem;
|
|
122
|
+
residence: IResidence;
|
|
123
|
+
place: SPPlaceItem;
|
|
124
|
+
spot: SPSpotItem;
|
|
125
|
+
company: SPCompany;
|
|
126
|
+
visitReport: SPVisitReport;
|
|
127
|
+
checkpoint: SPCheckpointItem;
|
|
128
|
+
reason: SPReasonItem;
|
|
129
|
+
origin?: SPOriginItem | undefined;
|
|
130
|
+
assignee?: SPAssignee;
|
|
131
|
+
unseenIssues: SPUnseenIssue[];
|
|
132
|
+
activities: SPActivity[];
|
|
133
|
+
static validate(payload: IssueReportPayload): Promise<string>;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/IssueReport/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAY,MAAM,UAAU,CAAA;AAI5D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE7C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,EAAE,OAAO,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,CAAA;IACvB,aAAa,EAAG,IAAI,CAAA;IACpB,iBAAiB,EAAG,IAAI,CAAA;IACxB,iBAAiB,EAAG,IAAI,CAAA;IACxB,IAAI,EAAG,OAAO,CAAA;IACT,MAAM,EAAG,UAAU,CAAA;IACnB,QAAQ,EAAG,cAAc,CAAA;IACzB,SAAS,EAAG,UAAU,CAAA;IACtB,KAAK,EAAG,WAAW,CAAA;IACnB,IAAI,EAAG,UAAU,CAAA;IACjB,OAAO,EAAG,SAAS,CAAA;IACnB,WAAW,EAAG,aAAa,CAAA;IAC3B,UAAU,EAAG,gBAAgB,CAAA;IAC7B,MAAM,EAAG,YAAY,CAAA;IACrB,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACjC,QAAQ,CAAC,EAAE,UAAU,CAAA;IACvB,YAAY,EAAG,aAAa,EAAE,CAAA;IAC9B,UAAU,EAAG,UAAU,EAAE,CAAA;WAEvB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;CAyBpE"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import { Model, Attr, BelongsTo, HasMany } from "spraypaint";
|
|
17
|
+
import { PouchCollection, PouchORM } from "pouchorm";
|
|
18
|
+
import { orderBy } from "lodash";
|
|
19
|
+
import * as yup from "yup";
|
|
20
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
21
|
+
import arrayDiffBy from "../types";
|
|
22
|
+
export class IssueCollection extends PouchCollection {
|
|
23
|
+
beforeInit() {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
yield this.addIndex(["_id", "remoteId"]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
clear() {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
yield PouchORM.clearDatabase("issueReports");
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
find(selector, opts) {
|
|
34
|
+
const _super = Object.create(null, {
|
|
35
|
+
find: { get: () => super.find }
|
|
36
|
+
});
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const result = yield _super.find.call(this, selector, opts);
|
|
39
|
+
return orderBy(result, ["name"], ["asc"]);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
bulkUpsertIfNotExists(items) {
|
|
43
|
+
const _super = Object.create(null, {
|
|
44
|
+
find: { get: () => super.find },
|
|
45
|
+
bulkUpsert: { get: () => super.bulkUpsert }
|
|
46
|
+
});
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const existingItems = yield _super.find.call(this, {});
|
|
49
|
+
const diff = arrayDiffBy(existingItems, items, "remoteId");
|
|
50
|
+
const upsertedIssueReport = yield _super.bulkUpsert.call(this, diff.missingLeft);
|
|
51
|
+
return upsertedIssueReport;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
let SPActivity = class SPActivity extends ApplicationRecord {
|
|
56
|
+
};
|
|
57
|
+
SPActivity.jsonapiType = "activities";
|
|
58
|
+
__decorate([
|
|
59
|
+
Attr()
|
|
60
|
+
], SPActivity.prototype, "name", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
Attr({ persist: false })
|
|
63
|
+
], SPActivity.prototype, "createdAt", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
Attr()
|
|
66
|
+
], SPActivity.prototype, "metadata", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
BelongsTo()
|
|
69
|
+
], SPActivity.prototype, "issueReport", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
BelongsTo()
|
|
72
|
+
], SPActivity.prototype, "author", void 0);
|
|
73
|
+
SPActivity = __decorate([
|
|
74
|
+
Model()
|
|
75
|
+
], SPActivity);
|
|
76
|
+
export { SPActivity };
|
|
77
|
+
let SPIssueReportItem = class SPIssueReportItem extends ApplicationRecord {
|
|
78
|
+
static validate(payload) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
const schema = yup.object().required().shape({
|
|
81
|
+
category: yup.string(),
|
|
82
|
+
agency: yup.string(),
|
|
83
|
+
residence: yup.string().nullable().notRequired(),
|
|
84
|
+
place: yup.string().nullable().notRequired(),
|
|
85
|
+
spot: yup.string().nullable().notRequired(),
|
|
86
|
+
checkpoint: yup.string(),
|
|
87
|
+
description: yup.string().required(),
|
|
88
|
+
priority: yup.number().required(),
|
|
89
|
+
visitReport: yup.string(),
|
|
90
|
+
isTenantRequest: yup.boolean(),
|
|
91
|
+
});
|
|
92
|
+
const isValid = yield schema.isValid(payload);
|
|
93
|
+
if (!isValid) {
|
|
94
|
+
try {
|
|
95
|
+
yield schema.validate(payload);
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
return error.message;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return "VALID";
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
SPIssueReportItem.jsonapiType = "issue_reports";
|
|
106
|
+
__decorate([
|
|
107
|
+
Attr()
|
|
108
|
+
], SPIssueReportItem.prototype, "isTenantRequest", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
Attr()
|
|
111
|
+
], SPIssueReportItem.prototype, "message", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
Attr()
|
|
114
|
+
], SPIssueReportItem.prototype, "talks", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
Attr()
|
|
117
|
+
], SPIssueReportItem.prototype, "imgs", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
Attr()
|
|
120
|
+
], SPIssueReportItem.prototype, "priority", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
Attr()
|
|
123
|
+
], SPIssueReportItem.prototype, "status", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
Attr()
|
|
126
|
+
], SPIssueReportItem.prototype, "checkpointId", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
Attr({ persist: false })
|
|
129
|
+
], SPIssueReportItem.prototype, "createdAt", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
Attr({ persist: false })
|
|
132
|
+
], SPIssueReportItem.prototype, "updatedAt", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
Attr()
|
|
135
|
+
], SPIssueReportItem.prototype, "pendingIimestamp", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
Attr()
|
|
138
|
+
], SPIssueReportItem.prototype, "ongoingTimestamp", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
Attr()
|
|
141
|
+
], SPIssueReportItem.prototype, "doneTimestamp", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
Attr()
|
|
144
|
+
], SPIssueReportItem.prototype, "canceledTimestamp", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
Attr()
|
|
147
|
+
], SPIssueReportItem.prototype, "rejectedTimestamp", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
Attr()
|
|
150
|
+
], SPIssueReportItem.prototype, "seen", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
BelongsTo()
|
|
153
|
+
], SPIssueReportItem.prototype, "author", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
BelongsTo()
|
|
156
|
+
], SPIssueReportItem.prototype, "category", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
BelongsTo()
|
|
159
|
+
], SPIssueReportItem.prototype, "residence", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
BelongsTo()
|
|
162
|
+
], SPIssueReportItem.prototype, "place", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
BelongsTo()
|
|
165
|
+
], SPIssueReportItem.prototype, "spot", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
BelongsTo()
|
|
168
|
+
], SPIssueReportItem.prototype, "company", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
BelongsTo()
|
|
171
|
+
], SPIssueReportItem.prototype, "visitReport", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
BelongsTo()
|
|
174
|
+
], SPIssueReportItem.prototype, "checkpoint", void 0);
|
|
175
|
+
__decorate([
|
|
176
|
+
BelongsTo()
|
|
177
|
+
], SPIssueReportItem.prototype, "reason", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
BelongsTo()
|
|
180
|
+
], SPIssueReportItem.prototype, "origin", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
BelongsTo()
|
|
183
|
+
], SPIssueReportItem.prototype, "assignee", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
HasMany()
|
|
186
|
+
], SPIssueReportItem.prototype, "unseenIssues", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
HasMany()
|
|
189
|
+
], SPIssueReportItem.prototype, "activities", void 0);
|
|
190
|
+
SPIssueReportItem = __decorate([
|
|
191
|
+
Model()
|
|
192
|
+
], SPIssueReportItem);
|
|
193
|
+
export { SPIssueReportItem };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IModel } from "pouchorm";
|
|
2
|
+
import { IAreaType, SPAreaType } from "../AreaItem";
|
|
3
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
4
|
+
import { ICheckpoint, SPCheckpointItem } from "../Checkpoint";
|
|
5
|
+
export interface ILocation extends IModel {
|
|
6
|
+
_id?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
areaType?: IAreaType;
|
|
10
|
+
areaTypeId?: number;
|
|
11
|
+
checkpoints?: ICheckpoint[];
|
|
12
|
+
iconUrl?: string;
|
|
13
|
+
order?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare class SPLocationItem extends ApplicationRecord implements ILocation {
|
|
16
|
+
static jsonapiType: string;
|
|
17
|
+
name: string;
|
|
18
|
+
areaTypeId: number;
|
|
19
|
+
iconUrl: string;
|
|
20
|
+
order: number;
|
|
21
|
+
areaType: SPAreaType;
|
|
22
|
+
checkpoints?: SPCheckpointItem[] | undefined;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Location/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAE7D,MAAM,WAAW,SAAU,SAAQ,MAAM;IACvC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,qBACa,cAAe,SAAQ,iBAAkB,YAAW,SAAS;IACxE,MAAM,CAAC,WAAW,SAAc;IACxB,IAAI,EAAG,MAAM,CAAA;IACb,UAAU,EAAG,MAAM,CAAA;IACnB,OAAO,EAAG,MAAM,CAAA;IAChB,KAAK,EAAG,MAAM,CAAA;IACT,QAAQ,EAAG,UAAU,CAAA;IACvB,WAAW,CAAC,EAAE,gBAAgB,EAAE,GAAG,SAAS,CAAA;CACxD"}
|