sowell-models 1.19.0 → 1.21.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 +9 -12
- package/src/models/Checklist/index.ts +2 -0
- package/src/models/Company/index.ts +4 -0
- package/build/index.d.ts +0 -28
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -27
- package/build/models/Agency/index.d.ts +0 -26
- package/build/models/Agency/index.d.ts.map +0 -1
- package/build/models/Agency/index.js +0 -61
- package/build/models/ApplicationRecord/index.d.ts +0 -7
- package/build/models/ApplicationRecord/index.d.ts.map +0 -1
- package/build/models/ApplicationRecord/index.js +0 -18
- package/build/models/AreaItem/index.d.ts +0 -51
- package/build/models/AreaItem/index.d.ts.map +0 -1
- package/build/models/AreaItem/index.js +0 -101
- package/build/models/Assignation/index.d.ts +0 -17
- package/build/models/Assignation/index.d.ts.map +0 -1
- package/build/models/Assignation/index.js +0 -24
- package/build/models/Author/index.d.ts +0 -8
- package/build/models/Author/index.d.ts.map +0 -1
- package/build/models/Author/index.js +0 -22
- package/build/models/Checklist/index.d.ts +0 -41
- package/build/models/Checklist/index.d.ts.map +0 -1
- package/build/models/Checklist/index.js +0 -79
- package/build/models/Checkpoint/index.d.ts +0 -45
- package/build/models/Checkpoint/index.d.ts.map +0 -1
- package/build/models/Checkpoint/index.js +0 -85
- package/build/models/Company/index.d.ts +0 -22
- package/build/models/Company/index.d.ts.map +0 -1
- package/build/models/Company/index.js +0 -33
- package/build/models/Export/index.d.ts +0 -22
- package/build/models/Export/index.d.ts.map +0 -1
- package/build/models/Export/index.js +0 -34
- package/build/models/Family/index.d.ts +0 -20
- package/build/models/Family/index.d.ts.map +0 -1
- package/build/models/Family/index.js +0 -55
- package/build/models/IssueReport/index.d.ts +0 -135
- package/build/models/IssueReport/index.d.ts.map +0 -1
- package/build/models/IssueReport/index.js +0 -193
- package/build/models/Location/index.d.ts +0 -24
- package/build/models/Location/index.d.ts.map +0 -1
- package/build/models/Location/index.js +0 -33
- package/build/models/Origin/index.d.ts +0 -23
- package/build/models/Origin/index.d.ts.map +0 -1
- package/build/models/Origin/index.js +0 -58
- package/build/models/Place/index.d.ts +0 -49
- package/build/models/Place/index.d.ts.map +0 -1
- package/build/models/Place/index.js +0 -89
- package/build/models/Provider/index.d.ts +0 -22
- package/build/models/Provider/index.d.ts.map +0 -1
- package/build/models/Provider/index.js +0 -58
- package/build/models/Reason/index.d.ts +0 -24
- package/build/models/Reason/index.d.ts.map +0 -1
- package/build/models/Reason/index.js +0 -58
- package/build/models/Residence/index.d.ts +0 -30
- package/build/models/Residence/index.d.ts.map +0 -1
- package/build/models/Residence/index.js +0 -64
- package/build/models/Sector/index.d.ts +0 -33
- package/build/models/Sector/index.d.ts.map +0 -1
- package/build/models/Sector/index.js +0 -72
- package/build/models/Spot/index.d.ts +0 -28
- package/build/models/Spot/index.d.ts.map +0 -1
- package/build/models/Spot/index.js +0 -61
- package/build/models/UnseenIssue/index.d.ts +0 -14
- package/build/models/UnseenIssue/index.d.ts.map +0 -1
- package/build/models/UnseenIssue/index.js +0 -21
- package/build/models/User/index.d.ts +0 -53
- package/build/models/User/index.d.ts.map +0 -1
- package/build/models/User/index.js +0 -116
- package/build/models/VisitProp/index.d.ts +0 -31
- package/build/models/VisitProp/index.d.ts.map +0 -1
- package/build/models/VisitProp/index.js +0 -42
- package/build/models/VisitReport/index.d.ts +0 -95
- package/build/models/VisitReport/index.d.ts.map +0 -1
- package/build/models/VisitReport/index.js +0 -110
- package/build/models/VisitSchedule/index.d.ts +0 -42
- package/build/models/VisitSchedule/index.d.ts.map +0 -1
- package/build/models/VisitSchedule/index.js +0 -82
- package/build/models/category/index.d.ts +0 -34
- package/build/models/category/index.d.ts.map +0 -1
- package/build/models/category/index.js +0 -70
- package/build/models/interfaces.d.ts +0 -8
- package/build/models/interfaces.d.ts.map +0 -1
- package/build/models/interfaces.js +0 -1
- package/build/models/types.d.ts +0 -7
- package/build/models/types.d.ts.map +0 -1
- package/build/models/types.js +0 -9
- package/build/utils/arrayDiffBy.d.ts +0 -7
- package/build/utils/arrayDiffBy.d.ts.map +0 -1
- package/build/utils/arrayDiffBy.js +0 -9
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { IModel } from "pouchorm";
|
|
2
|
-
import { IUser, SPUserItem } from "../User";
|
|
3
|
-
import { IIssueReport, SPIssueReportItem } from "../IssueReport";
|
|
4
|
-
import { ApplicationRecord } from "../ApplicationRecord";
|
|
5
|
-
import { IVisitSchedule, SPVisitSchedule } from "../VisitSchedule";
|
|
6
|
-
import { IChecklist, SPChecklistItem } from "../Checklist";
|
|
7
|
-
import { IPlace, SPPlaceItem } from "../Place";
|
|
8
|
-
import { IResidence, SPResidenceItem } from "../Residence";
|
|
9
|
-
import { ISpot, SPSpotItem } from "../Spot";
|
|
10
|
-
export declare enum CheckpointStatus {
|
|
11
|
-
NONE = "NONE",
|
|
12
|
-
OK = "OK",
|
|
13
|
-
KO = "KO",
|
|
14
|
-
MISSING = "MISSING",
|
|
15
|
-
PENDING = "PENDING"
|
|
16
|
-
}
|
|
17
|
-
export interface VisitReportPayload {
|
|
18
|
-
visitSchedule?: string;
|
|
19
|
-
checkpoints: CheckpointProps[];
|
|
20
|
-
residence?: string;
|
|
21
|
-
place?: string;
|
|
22
|
-
spot?: string;
|
|
23
|
-
checklist?: string;
|
|
24
|
-
isContradictory?: boolean;
|
|
25
|
-
assistedBy?: {
|
|
26
|
-
id: string;
|
|
27
|
-
fullName: string;
|
|
28
|
-
};
|
|
29
|
-
comment?: string;
|
|
30
|
-
isMissingProvider?: boolean;
|
|
31
|
-
validate?: (payload: VisitReportPayload) => string;
|
|
32
|
-
agent?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface CheckpointProps {
|
|
35
|
-
_id?: string;
|
|
36
|
-
id?: string;
|
|
37
|
-
label?: string;
|
|
38
|
-
status: CheckpointStatus;
|
|
39
|
-
issueReportId?: string;
|
|
40
|
-
issue?: {
|
|
41
|
-
description: string;
|
|
42
|
-
priority: string;
|
|
43
|
-
imgs?: {
|
|
44
|
-
base64: string[];
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
category?: number;
|
|
48
|
-
comment?: string;
|
|
49
|
-
coefficient?: number;
|
|
50
|
-
}
|
|
51
|
-
export interface IVisitReport extends IModel {
|
|
52
|
-
id?: string;
|
|
53
|
-
createdAt?: Date;
|
|
54
|
-
checkpoints: CheckpointProps[];
|
|
55
|
-
visitSchedule?: IVisitSchedule;
|
|
56
|
-
checklist?: IChecklist;
|
|
57
|
-
residence?: IResidence;
|
|
58
|
-
place?: IPlace;
|
|
59
|
-
spot?: ISpot;
|
|
60
|
-
author?: IUser;
|
|
61
|
-
issueReports?: IIssueReport[];
|
|
62
|
-
isContradictory?: boolean;
|
|
63
|
-
assistedBy?: {
|
|
64
|
-
id: string;
|
|
65
|
-
full_name: string;
|
|
66
|
-
};
|
|
67
|
-
score?: number;
|
|
68
|
-
isMissingProvider?: boolean;
|
|
69
|
-
agent?: string;
|
|
70
|
-
validate?: (payload: VisitReportPayload) => string;
|
|
71
|
-
}
|
|
72
|
-
export declare class SPVisitReport extends ApplicationRecord implements IVisitReport {
|
|
73
|
-
static jsonapiType: string;
|
|
74
|
-
checkpoints: CheckpointProps[];
|
|
75
|
-
createdAt: Date;
|
|
76
|
-
score: number;
|
|
77
|
-
isContradictory: boolean;
|
|
78
|
-
assistedBy: {
|
|
79
|
-
id: string;
|
|
80
|
-
full_name: string;
|
|
81
|
-
};
|
|
82
|
-
comment: string;
|
|
83
|
-
imgs: string[];
|
|
84
|
-
isMissingProvider: boolean;
|
|
85
|
-
agent: string;
|
|
86
|
-
author: SPUserItem;
|
|
87
|
-
visitSchedule: SPVisitSchedule;
|
|
88
|
-
checklist: SPChecklistItem;
|
|
89
|
-
residence: SPResidenceItem;
|
|
90
|
-
place: SPPlaceItem;
|
|
91
|
-
spot: SPSpotItem;
|
|
92
|
-
issueReports: SPIssueReportItem[];
|
|
93
|
-
static validate(payload: VisitReportPayload): Promise<string>;
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/VisitReport/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAElE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAE3C,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,EAAE,OAAO;IACT,EAAE,OAAO;IACT,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,eAAe,EAAE,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,UAAU,CAAC,EAAE;QACX,EAAE,EAAE,MAAM,CAAA;QACV,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,OAAO,CAAC,EAAE,MAAM,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AO,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,MAAM,CAAA;CACnD;AAED,qBACa,aAAc,SAAQ,iBAAkB,YAAW,YAAY;IAC1E,MAAM,CAAC,WAAW,SAAkB;IAC5B,WAAW,EAAG,eAAe,EAAE,CAAA;IAC/B,SAAS,EAAG,IAAI,CAAA;IAChB,KAAK,EAAG,MAAM,CAAA;IACd,eAAe,EAAG,OAAO,CAAA;IACzB,UAAU,EAAG;QACnB,EAAE,EAAE,MAAM,CAAA;QACV,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;IACO,OAAO,EAAG,MAAM,CAAA;IAChB,IAAI,EAAG,MAAM,EAAE,CAAA;IACf,iBAAiB,EAAG,OAAO,CAAA;IAC3B,KAAK,EAAG,MAAM,CAAA;IACT,MAAM,EAAG,UAAU,CAAA;IACnB,aAAa,EAAG,eAAe,CAAA;IAC/B,SAAS,EAAG,eAAe,CAAA;IAC3B,SAAS,EAAG,eAAe,CAAA;IAC3B,KAAK,EAAG,WAAW,CAAA;IACnB,IAAI,EAAG,UAAU,CAAA;IACnB,YAAY,EAAG,iBAAiB,EAAE,CAAA;WAEhC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;CA8BpE"}
|
|
@@ -1,110 +0,0 @@
|
|
|
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 { ApplicationRecord } from "../ApplicationRecord";
|
|
18
|
-
import * as yup from "yup";
|
|
19
|
-
export var CheckpointStatus;
|
|
20
|
-
(function (CheckpointStatus) {
|
|
21
|
-
CheckpointStatus["NONE"] = "NONE";
|
|
22
|
-
CheckpointStatus["OK"] = "OK";
|
|
23
|
-
CheckpointStatus["KO"] = "KO";
|
|
24
|
-
CheckpointStatus["MISSING"] = "MISSING";
|
|
25
|
-
CheckpointStatus["PENDING"] = "PENDING";
|
|
26
|
-
})(CheckpointStatus || (CheckpointStatus = {}));
|
|
27
|
-
let SPVisitReport = class SPVisitReport extends ApplicationRecord {
|
|
28
|
-
static validate(payload) {
|
|
29
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const schema = yup
|
|
31
|
-
.object()
|
|
32
|
-
.required()
|
|
33
|
-
.shape({
|
|
34
|
-
checkpoints: yup.array().of(yup.object().shape({
|
|
35
|
-
id: yup.string().required(),
|
|
36
|
-
status: yup.string().required()
|
|
37
|
-
})),
|
|
38
|
-
visitSchedule: yup.string(),
|
|
39
|
-
checklist: yup.string(),
|
|
40
|
-
residence: yup.string(),
|
|
41
|
-
place: yup.string(),
|
|
42
|
-
spot: yup.string(),
|
|
43
|
-
comment: yup.string()
|
|
44
|
-
});
|
|
45
|
-
const isValid = yield schema.isValid(payload);
|
|
46
|
-
if (!isValid) {
|
|
47
|
-
try {
|
|
48
|
-
yield schema.validate(payload);
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
return error.message;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return "VALID";
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
SPVisitReport.jsonapiType = "visit_reports";
|
|
59
|
-
__decorate([
|
|
60
|
-
Attr()
|
|
61
|
-
], SPVisitReport.prototype, "checkpoints", void 0);
|
|
62
|
-
__decorate([
|
|
63
|
-
Attr()
|
|
64
|
-
], SPVisitReport.prototype, "createdAt", void 0);
|
|
65
|
-
__decorate([
|
|
66
|
-
Attr()
|
|
67
|
-
], SPVisitReport.prototype, "score", void 0);
|
|
68
|
-
__decorate([
|
|
69
|
-
Attr()
|
|
70
|
-
], SPVisitReport.prototype, "isContradictory", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
Attr()
|
|
73
|
-
], SPVisitReport.prototype, "assistedBy", void 0);
|
|
74
|
-
__decorate([
|
|
75
|
-
Attr()
|
|
76
|
-
], SPVisitReport.prototype, "comment", void 0);
|
|
77
|
-
__decorate([
|
|
78
|
-
Attr()
|
|
79
|
-
], SPVisitReport.prototype, "imgs", void 0);
|
|
80
|
-
__decorate([
|
|
81
|
-
Attr()
|
|
82
|
-
], SPVisitReport.prototype, "isMissingProvider", void 0);
|
|
83
|
-
__decorate([
|
|
84
|
-
Attr()
|
|
85
|
-
], SPVisitReport.prototype, "agent", void 0);
|
|
86
|
-
__decorate([
|
|
87
|
-
BelongsTo()
|
|
88
|
-
], SPVisitReport.prototype, "author", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
BelongsTo()
|
|
91
|
-
], SPVisitReport.prototype, "visitSchedule", void 0);
|
|
92
|
-
__decorate([
|
|
93
|
-
BelongsTo()
|
|
94
|
-
], SPVisitReport.prototype, "checklist", void 0);
|
|
95
|
-
__decorate([
|
|
96
|
-
BelongsTo()
|
|
97
|
-
], SPVisitReport.prototype, "residence", void 0);
|
|
98
|
-
__decorate([
|
|
99
|
-
BelongsTo()
|
|
100
|
-
], SPVisitReport.prototype, "place", void 0);
|
|
101
|
-
__decorate([
|
|
102
|
-
BelongsTo()
|
|
103
|
-
], SPVisitReport.prototype, "spot", void 0);
|
|
104
|
-
__decorate([
|
|
105
|
-
HasMany()
|
|
106
|
-
], SPVisitReport.prototype, "issueReports", void 0);
|
|
107
|
-
SPVisitReport = __decorate([
|
|
108
|
-
Model()
|
|
109
|
-
], SPVisitReport);
|
|
110
|
-
export { SPVisitReport };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { IModel, PouchCollection } from "pouchorm";
|
|
2
|
-
import { ApplicationRecord } from "../ApplicationRecord";
|
|
3
|
-
import { IPlace, SPPlaceItem } from "../Place";
|
|
4
|
-
import { IChecklist, SPChecklistItem } from "../Checklist";
|
|
5
|
-
import { CollectionFindOptions, IClearable } from "../interfaces";
|
|
6
|
-
import { IResidence, SPResidenceItem } from "../Residence";
|
|
7
|
-
import { ISpot, SPSpotItem } from "../Spot";
|
|
8
|
-
export interface IVisitSchedule extends IModel {
|
|
9
|
-
_id?: string;
|
|
10
|
-
dueAt: Date;
|
|
11
|
-
lastDoneAt?: Date;
|
|
12
|
-
lateCount?: number;
|
|
13
|
-
checklistId?: string;
|
|
14
|
-
residence?: IResidence;
|
|
15
|
-
residenceId?: string;
|
|
16
|
-
place?: IPlace;
|
|
17
|
-
placeId?: string;
|
|
18
|
-
spot?: ISpot;
|
|
19
|
-
spotId?: string;
|
|
20
|
-
checklist?: IChecklist;
|
|
21
|
-
}
|
|
22
|
-
export declare class VisitSchedulesCollection extends PouchCollection<IVisitSchedule> implements IClearable {
|
|
23
|
-
beforeInit(): Promise<void>;
|
|
24
|
-
clear(): Promise<void>;
|
|
25
|
-
find(selector?: Record<string, any> | Partial<IVisitSchedule> | undefined, opts?: CollectionFindOptions): Promise<IVisitSchedule[]>;
|
|
26
|
-
}
|
|
27
|
-
export declare class SPVisitSchedule extends ApplicationRecord implements IVisitSchedule {
|
|
28
|
-
static jsonapiType: string;
|
|
29
|
-
dueAt: Date;
|
|
30
|
-
lastDoneAt?: Date;
|
|
31
|
-
lateCount?: number;
|
|
32
|
-
checklistId: string;
|
|
33
|
-
residenceId: string;
|
|
34
|
-
placeId: string;
|
|
35
|
-
spotId: string;
|
|
36
|
-
residence: SPResidenceItem;
|
|
37
|
-
place: SPPlaceItem;
|
|
38
|
-
spot: SPSpotItem;
|
|
39
|
-
checklist: SPChecklistItem;
|
|
40
|
-
get _id(): string | undefined;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/VisitSchedule/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAY,MAAM,UAAU,CAAA;AAG5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAE3C,MAAM,WAAW,cAAe,SAAQ,MAAM;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,IAAI,CAAA;IACX,UAAU,CAAC,EAAE,IAAI,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,UAAU,CAAA;CACvB;AAED,qBAAa,wBACX,SAAQ,eAAe,CAAC,cAAc,CACtC,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,cAAc,CAAC,GAAG,SAAS,EACpE,IAAI,CAAC,EAAE,qBAAqB,GAC3B,OAAO,CAAC,cAAc,EAAE,CAAC;CAI7B;AAED,qBACa,eACX,SAAQ,iBACR,YAAW,cAAc;IAEzB,MAAM,CAAC,WAAW,SAAoB;IAC9B,KAAK,EAAG,IAAI,CAAA;IACZ,UAAU,CAAC,EAAE,IAAI,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,EAAG,MAAM,CAAA;IACpB,WAAW,EAAG,MAAM,CAAA;IACpB,OAAO,EAAG,MAAM,CAAA;IAChB,MAAM,EAAG,MAAM,CAAA;IACV,SAAS,EAAG,eAAe,CAAA;IAC3B,KAAK,EAAG,WAAW,CAAA;IACnB,IAAI,EAAG,UAAU,CAAA;IACjB,SAAS,EAAG,eAAe,CAAA;IACxC,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;CACF"}
|
|
@@ -1,82 +0,0 @@
|
|
|
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 } from "spraypaint";
|
|
17
|
-
import { PouchCollection, PouchORM } from "pouchorm";
|
|
18
|
-
import { orderBy } from "lodash";
|
|
19
|
-
import { ApplicationRecord } from "../ApplicationRecord";
|
|
20
|
-
export class VisitSchedulesCollection 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("visit_schedules");
|
|
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, ["dueAt"], ["asc"]);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
let SPVisitSchedule = class SPVisitSchedule extends ApplicationRecord {
|
|
41
|
-
get _id() {
|
|
42
|
-
return this.id;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
SPVisitSchedule.jsonapiType = "visit_schedules";
|
|
46
|
-
__decorate([
|
|
47
|
-
Attr()
|
|
48
|
-
], SPVisitSchedule.prototype, "dueAt", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
Attr()
|
|
51
|
-
], SPVisitSchedule.prototype, "lastDoneAt", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
Attr()
|
|
54
|
-
], SPVisitSchedule.prototype, "lateCount", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
Attr()
|
|
57
|
-
], SPVisitSchedule.prototype, "checklistId", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
Attr()
|
|
60
|
-
], SPVisitSchedule.prototype, "residenceId", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
Attr()
|
|
63
|
-
], SPVisitSchedule.prototype, "placeId", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
Attr()
|
|
66
|
-
], SPVisitSchedule.prototype, "spotId", void 0);
|
|
67
|
-
__decorate([
|
|
68
|
-
BelongsTo()
|
|
69
|
-
], SPVisitSchedule.prototype, "residence", void 0);
|
|
70
|
-
__decorate([
|
|
71
|
-
BelongsTo()
|
|
72
|
-
], SPVisitSchedule.prototype, "place", void 0);
|
|
73
|
-
__decorate([
|
|
74
|
-
BelongsTo()
|
|
75
|
-
], SPVisitSchedule.prototype, "spot", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
BelongsTo()
|
|
78
|
-
], SPVisitSchedule.prototype, "checklist", void 0);
|
|
79
|
-
SPVisitSchedule = __decorate([
|
|
80
|
-
Model()
|
|
81
|
-
], SPVisitSchedule);
|
|
82
|
-
export { SPVisitSchedule };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { IModel, PouchCollection } from "pouchorm";
|
|
2
|
-
import { ApplicationRecord } from "../ApplicationRecord";
|
|
3
|
-
import { ICompany, SPCompany } from "../Company";
|
|
4
|
-
import { IArea, SPAreaItem } from "../AreaItem";
|
|
5
|
-
import { SPCheckpointItem } from "../Checkpoint";
|
|
6
|
-
import { CollectionFindOptions, IClearable } from "../interfaces";
|
|
7
|
-
import { IReason, SPReasonItem } from "../Reason";
|
|
8
|
-
export interface ICategory extends IModel {
|
|
9
|
-
_id?: string;
|
|
10
|
-
name: string;
|
|
11
|
-
order?: number;
|
|
12
|
-
iconUrl?: string;
|
|
13
|
-
company?: ICompany;
|
|
14
|
-
areaId?: string;
|
|
15
|
-
area?: IArea;
|
|
16
|
-
reasons?: IReason[];
|
|
17
|
-
}
|
|
18
|
-
export declare class CategoryCollection extends PouchCollection<ICategory> implements IClearable {
|
|
19
|
-
beforeInit(): Promise<void>;
|
|
20
|
-
clear(): Promise<void>;
|
|
21
|
-
find(selector?: Record<string, any> | Partial<ICategory> | undefined, opts?: CollectionFindOptions): Promise<ICategory[]>;
|
|
22
|
-
}
|
|
23
|
-
export declare class SPCategoryItem extends ApplicationRecord implements ICategory {
|
|
24
|
-
static jsonapiType: string;
|
|
25
|
-
name: string;
|
|
26
|
-
order: number;
|
|
27
|
-
iconUrl: string;
|
|
28
|
-
company: SPCompany;
|
|
29
|
-
area: SPAreaItem;
|
|
30
|
-
get _id(): string | undefined;
|
|
31
|
-
checkpoints: SPCheckpointItem[];
|
|
32
|
-
reasons: SPReasonItem[];
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/category/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAY,MAAM,UAAU,CAAA;AAG5D,OAAO,EAAE,iBAAiB,EAAE,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,MAAM,GAAG,SAAS,CAE5B;IACU,WAAW,EAAG,gBAAgB,EAAE,CAAA;IAChC,OAAO,EAAG,YAAY,EAAE,CAAA;CACpC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
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 CategoryCollection 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("categories");
|
|
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, ["order"], ["asc"]);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
let SPCategoryItem = class SPCategoryItem extends ApplicationRecord {
|
|
41
|
-
get _id() {
|
|
42
|
-
return this.id;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
SPCategoryItem.jsonapiType = "categories";
|
|
46
|
-
__decorate([
|
|
47
|
-
Attr()
|
|
48
|
-
], SPCategoryItem.prototype, "name", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
Attr()
|
|
51
|
-
], SPCategoryItem.prototype, "order", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
Attr()
|
|
54
|
-
], SPCategoryItem.prototype, "iconUrl", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
BelongsTo()
|
|
57
|
-
], SPCategoryItem.prototype, "company", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
BelongsTo()
|
|
60
|
-
], SPCategoryItem.prototype, "area", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
HasMany()
|
|
63
|
-
], SPCategoryItem.prototype, "checkpoints", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
HasMany()
|
|
66
|
-
], SPCategoryItem.prototype, "reasons", void 0);
|
|
67
|
-
SPCategoryItem = __decorate([
|
|
68
|
-
Model()
|
|
69
|
-
], SPCategoryItem);
|
|
70
|
-
export { SPCategoryItem };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/models/interfaces.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build/models/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/models/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,aAAa,EAAE,MAAM,QAAQ,CAAA;AAEpE,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,EAAG,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;;;;EAO3F"}
|
package/build/models/types.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { intersectionBy, differenceBy } from "lodash";
|
|
2
|
-
export default function arrayDiffBy(array1, array2, iteratee) {
|
|
3
|
-
const result = {
|
|
4
|
-
matched: intersectionBy(array1, array2, iteratee),
|
|
5
|
-
missingRight: differenceBy(array1, array2, iteratee),
|
|
6
|
-
missingLeft: differenceBy(array2, array1, iteratee)
|
|
7
|
-
};
|
|
8
|
-
return result;
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrayDiffBy.d.ts","sourceRoot":"","sources":["../../src/utils/arrayDiffBy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,aAAa,EAAE,MAAM,QAAQ,CAAA;AAEpE,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,EACnC,MAAM,EAAE,CAAC,EAAE,EACX,MAAM,EAAE,CAAC,EAAE,EACX,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;;;;EAQ3B"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { intersectionBy, differenceBy } from "lodash";
|
|
2
|
-
export default function arrayDiffBy(array1, array2, iteratee) {
|
|
3
|
-
const result = {
|
|
4
|
-
matched: intersectionBy(array1, array2, iteratee),
|
|
5
|
-
missingRight: differenceBy(array1, array2, iteratee),
|
|
6
|
-
missingLeft: differenceBy(array2, array1, iteratee)
|
|
7
|
-
};
|
|
8
|
-
return result;
|
|
9
|
-
}
|