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,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 { Attr, BelongsTo, HasMany, Model } from "spraypaint";
|
|
8
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
9
|
+
let SPLocationItem = class SPLocationItem extends ApplicationRecord {
|
|
10
|
+
};
|
|
11
|
+
SPLocationItem.jsonapiType = "locations";
|
|
12
|
+
__decorate([
|
|
13
|
+
Attr()
|
|
14
|
+
], SPLocationItem.prototype, "name", void 0);
|
|
15
|
+
__decorate([
|
|
16
|
+
Attr()
|
|
17
|
+
], SPLocationItem.prototype, "areaTypeId", void 0);
|
|
18
|
+
__decorate([
|
|
19
|
+
Attr()
|
|
20
|
+
], SPLocationItem.prototype, "iconUrl", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
Attr()
|
|
23
|
+
], SPLocationItem.prototype, "order", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
BelongsTo()
|
|
26
|
+
], SPLocationItem.prototype, "areaType", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
HasMany()
|
|
29
|
+
], SPLocationItem.prototype, "checkpoints", void 0);
|
|
30
|
+
SPLocationItem = __decorate([
|
|
31
|
+
Model()
|
|
32
|
+
], SPLocationItem);
|
|
33
|
+
export { SPLocationItem };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
2
|
+
import { IModel, PouchCollection } from "pouchorm";
|
|
3
|
+
import { IIssueReport, SPIssueReportItem } from "../IssueReport";
|
|
4
|
+
import { CollectionFindOptions, IClearable } from "../interfaces";
|
|
5
|
+
export interface IOrigin extends IModel {
|
|
6
|
+
_id?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
iconUrl?: string;
|
|
9
|
+
issueReports?: IIssueReport[];
|
|
10
|
+
}
|
|
11
|
+
export declare class OriginCollection extends PouchCollection<IOrigin> implements IClearable {
|
|
12
|
+
beforeInit(): Promise<void>;
|
|
13
|
+
clear(): Promise<void>;
|
|
14
|
+
find(selector?: Record<string, any> | Partial<IOrigin> | undefined, opts?: CollectionFindOptions): Promise<IOrigin[]>;
|
|
15
|
+
}
|
|
16
|
+
export declare class SPOriginItem extends ApplicationRecord implements IOrigin {
|
|
17
|
+
static jsonapiType: string;
|
|
18
|
+
name: string;
|
|
19
|
+
iconUrl: string;
|
|
20
|
+
issueReports: SPIssueReportItem[];
|
|
21
|
+
get _id(): string | undefined;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Origin/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,eAAe,EAAY,MAAM,UAAU,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAGjE,MAAM,WAAW,OAAQ,SAAQ,MAAM;IACrC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,YAAY,EAAE,CAAA;CAC9B;AAED,qBAAa,gBACX,SAAQ,eAAe,CAAC,OAAO,CAC/B,YAAW,UAAU;IACf,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;AAED,qBACa,YAAa,SAAQ,iBAAkB,YAAW,OAAO;IACpE,MAAM,CAAC,WAAW,SAAY;IACtB,IAAI,EAAG,MAAM,CAAA;IACb,OAAO,EAAG,MAAM,CAAA;IACb,YAAY,EAAG,iBAAiB,EAAE,CAAA;IAC7C,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;CACF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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, HasMany } from "spraypaint";
|
|
17
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
18
|
+
import { PouchCollection, PouchORM } from "pouchorm";
|
|
19
|
+
import { orderBy } from "lodash";
|
|
20
|
+
export class OriginCollection 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("origins");
|
|
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, ["name"], ["asc"]);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
let SPOriginItem = class SPOriginItem extends ApplicationRecord {
|
|
41
|
+
get _id() {
|
|
42
|
+
return this.id;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
SPOriginItem.jsonapiType = "origins";
|
|
46
|
+
__decorate([
|
|
47
|
+
Attr()
|
|
48
|
+
], SPOriginItem.prototype, "name", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
Attr()
|
|
51
|
+
], SPOriginItem.prototype, "iconUrl", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
HasMany()
|
|
54
|
+
], SPOriginItem.prototype, "issueReports", void 0);
|
|
55
|
+
SPOriginItem = __decorate([
|
|
56
|
+
Model()
|
|
57
|
+
], SPOriginItem);
|
|
58
|
+
export { SPOriginItem };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { IModel, PouchCollection } from "pouchorm";
|
|
2
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
3
|
+
import { ICompany, SPCompany } from "../Company";
|
|
4
|
+
import { IResidence, SPResidenceItem } from "../Residence";
|
|
5
|
+
import { IVisitSchedule, SPVisitSchedule } from "../VisitSchedule";
|
|
6
|
+
import { CollectionFindOptions, IClearable } from "../interfaces";
|
|
7
|
+
import { ISpot, SPSpotItem } from "../Spot";
|
|
8
|
+
export interface IPlace extends IModel {
|
|
9
|
+
_id?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
zip?: string;
|
|
12
|
+
city?: string;
|
|
13
|
+
country?: string;
|
|
14
|
+
street_number?: string;
|
|
15
|
+
street_name?: string;
|
|
16
|
+
sectorIds?: string[];
|
|
17
|
+
residenceId?: string;
|
|
18
|
+
agencyId?: string;
|
|
19
|
+
visitScheduleIds?: string[];
|
|
20
|
+
updatedAt?: Date;
|
|
21
|
+
hasScheduledVisit?: boolean;
|
|
22
|
+
residence?: IResidence;
|
|
23
|
+
company?: ICompany;
|
|
24
|
+
spots?: ISpot[];
|
|
25
|
+
visitSchedules?: IVisitSchedule[];
|
|
26
|
+
}
|
|
27
|
+
export declare class PlaceCollection extends PouchCollection<IPlace> implements IClearable {
|
|
28
|
+
beforeInit(): Promise<void>;
|
|
29
|
+
clear(): Promise<void>;
|
|
30
|
+
find(selector?: Record<string, any> | Partial<IPlace> | undefined, opts?: CollectionFindOptions): Promise<IPlace[]>;
|
|
31
|
+
}
|
|
32
|
+
export declare class SPPlaceItem extends ApplicationRecord implements IPlace {
|
|
33
|
+
constructor(attrs?: Record<string, any>);
|
|
34
|
+
static jsonapiType: string;
|
|
35
|
+
name: string;
|
|
36
|
+
zip: string;
|
|
37
|
+
city: string;
|
|
38
|
+
country: string;
|
|
39
|
+
street_number: string;
|
|
40
|
+
street_name: string;
|
|
41
|
+
sectorIds: string[];
|
|
42
|
+
updatedAt: Date;
|
|
43
|
+
residence: SPResidenceItem;
|
|
44
|
+
company: SPCompany;
|
|
45
|
+
visitSchedules: SPVisitSchedule[];
|
|
46
|
+
spots: SPSpotItem[];
|
|
47
|
+
get _id(): string | undefined;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Place/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,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAE3C,MAAM,WAAW,MAAO,SAAQ,MAAM;IACpC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,SAAS,CAAC,EAAE,IAAI,CAAA;IAChB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,OAAO,CAAC,EAAE,QAAQ,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,EAAE,CAAA;IACf,cAAc,CAAC,EAAE,cAAc,EAAE,CAAA;CAClC;AAED,qBAAa,eACX,SAAQ,eAAe,CAAC,MAAM,CAC9B,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,MAAM,CAAC,GAAG,SAAS,EAC5D,IAAI,CAAC,EAAE,qBAAqB;CAK/B;AAED,qBACa,WAAY,SAAQ,iBAAkB,YAAW,MAAM;gBACtD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAIvC,MAAM,CAAC,WAAW,SAAW;IACrB,IAAI,EAAG,MAAM,CAAA;IACb,GAAG,EAAG,MAAM,CAAA;IACZ,IAAI,EAAG,MAAM,CAAA;IACb,OAAO,EAAG,MAAM,CAAA;IAChB,aAAa,EAAG,MAAM,CAAA;IACtB,WAAW,EAAG,MAAM,CAAA;IACpB,SAAS,EAAG,MAAM,EAAE,CAAA;IACF,SAAS,EAAG,IAAI,CAAA;IAC7B,SAAS,EAAG,eAAe,CAAA;IAC3B,OAAO,EAAG,SAAS,CAAA;IACrB,cAAc,EAAG,eAAe,EAAE,CAAA;IAClC,KAAK,EAAG,UAAU,EAAE,CAAA;IAC/B,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;CACF"}
|
|
@@ -0,0 +1,89 @@
|
|
|
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 PlaceCollection 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("places");
|
|
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, ["name"], ["asc"]);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
let SPPlaceItem = class SPPlaceItem extends ApplicationRecord {
|
|
41
|
+
constructor(attrs) {
|
|
42
|
+
super(attrs);
|
|
43
|
+
this.sectorIds = (attrs === null || attrs === void 0 ? void 0 : attrs.sectorIds) || [];
|
|
44
|
+
}
|
|
45
|
+
get _id() {
|
|
46
|
+
return this.id;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
SPPlaceItem.jsonapiType = "places";
|
|
50
|
+
__decorate([
|
|
51
|
+
Attr()
|
|
52
|
+
], SPPlaceItem.prototype, "name", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
Attr()
|
|
55
|
+
], SPPlaceItem.prototype, "zip", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Attr()
|
|
58
|
+
], SPPlaceItem.prototype, "city", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
Attr()
|
|
61
|
+
], SPPlaceItem.prototype, "country", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
Attr()
|
|
64
|
+
], SPPlaceItem.prototype, "street_number", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
Attr()
|
|
67
|
+
], SPPlaceItem.prototype, "street_name", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
Attr()
|
|
70
|
+
], SPPlaceItem.prototype, "sectorIds", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
Attr({ persist: false })
|
|
73
|
+
], SPPlaceItem.prototype, "updatedAt", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
BelongsTo()
|
|
76
|
+
], SPPlaceItem.prototype, "residence", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
BelongsTo()
|
|
79
|
+
], SPPlaceItem.prototype, "company", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
HasMany()
|
|
82
|
+
], SPPlaceItem.prototype, "visitSchedules", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
HasMany()
|
|
85
|
+
], SPPlaceItem.prototype, "spots", void 0);
|
|
86
|
+
SPPlaceItem = __decorate([
|
|
87
|
+
Model()
|
|
88
|
+
], SPPlaceItem);
|
|
89
|
+
export { SPPlaceItem };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PouchCollection } from "pouchorm";
|
|
2
|
+
import { CollectionFindOptions, IClearable } from "../interfaces";
|
|
3
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
4
|
+
export interface Provider {
|
|
5
|
+
_id?: string;
|
|
6
|
+
fname: string;
|
|
7
|
+
lname: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class ProviderCollection extends PouchCollection<Provider> implements IClearable {
|
|
11
|
+
beforeInit(): Promise<void>;
|
|
12
|
+
clear(): Promise<void>;
|
|
13
|
+
find(selector?: Record<string, any> | Partial<Provider> | undefined, opts?: CollectionFindOptions): Promise<Provider[]>;
|
|
14
|
+
}
|
|
15
|
+
export declare class SPProvider extends ApplicationRecord implements Provider {
|
|
16
|
+
static jsonapiType: string;
|
|
17
|
+
fname: string;
|
|
18
|
+
lname: string;
|
|
19
|
+
email: string;
|
|
20
|
+
get _id(): string | undefined;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Provider/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAY,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,WAAW,QAAQ;IACvB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,qBAAa,kBACX,SAAQ,eAAe,CAAC,QAAQ,CAChC,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,QAAQ,CAAC,GAAG,SAAS,EAC9D,IAAI,CAAC,EAAE,qBAAqB;CAK/B;AAED,qBACa,UAAW,SAAQ,iBAAkB,YAAW,QAAQ;IACnE,MAAM,CAAC,WAAW,SAAc;IACxB,KAAK,EAAG,MAAM,CAAA;IACd,KAAK,EAAG,MAAM,CAAA;IACd,KAAK,EAAG,MAAM,CAAA;IACtB,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;CACF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { orderBy } from "lodash";
|
|
18
|
+
import { PouchCollection, PouchORM } from "pouchorm";
|
|
19
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
20
|
+
export class ProviderCollection 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("providers");
|
|
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, ["fname"], ["asc"]);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
let SPProvider = class SPProvider extends ApplicationRecord {
|
|
41
|
+
get _id() {
|
|
42
|
+
return this.id;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
SPProvider.jsonapiType = "providers";
|
|
46
|
+
__decorate([
|
|
47
|
+
Attr()
|
|
48
|
+
], SPProvider.prototype, "fname", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
Attr()
|
|
51
|
+
], SPProvider.prototype, "lname", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
Attr()
|
|
54
|
+
], SPProvider.prototype, "email", void 0);
|
|
55
|
+
SPProvider = __decorate([
|
|
56
|
+
Model()
|
|
57
|
+
], SPProvider);
|
|
58
|
+
export { SPProvider };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IModel, PouchCollection } from 'pouchorm';
|
|
2
|
+
import { ApplicationRecord } from '../ApplicationRecord';
|
|
3
|
+
import { CollectionFindOptions, IClearable } from '../interfaces';
|
|
4
|
+
import { SPCategoryItem } from '../category';
|
|
5
|
+
export interface IReason extends IModel {
|
|
6
|
+
id?: string;
|
|
7
|
+
_id?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
order?: number;
|
|
10
|
+
iconUrl?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class ReasonCollection extends PouchCollection<IReason> implements IClearable {
|
|
13
|
+
beforeInit(): Promise<void>;
|
|
14
|
+
clear(): Promise<void>;
|
|
15
|
+
find(selector?: Record<string, any> | Partial<IReason> | undefined, opts?: CollectionFindOptions): Promise<IReason[]>;
|
|
16
|
+
}
|
|
17
|
+
export declare class SPReasonItem extends ApplicationRecord implements IReason {
|
|
18
|
+
static jsonapiType: string;
|
|
19
|
+
name: string;
|
|
20
|
+
order: number;
|
|
21
|
+
iconUrl?: string;
|
|
22
|
+
category: SPCategoryItem;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Reason/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAY,MAAM,UAAU,CAAC;AAG7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,OAAQ,SAAQ,MAAM;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;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,GAC3B,OAAO,CAAC,OAAO,EAAE,CAAC;CAItB;AAED,qBACa,YAAa,SAAQ,iBAAkB,YAAW,OAAO;IACpE,MAAM,CAAC,WAAW,SAAa;IACvB,IAAI,EAAG,MAAM,CAAC;IACd,KAAK,EAAG,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAG,cAAc,CAAC;CACxC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 ReasonCollection 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('reasons');
|
|
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, ['name'], ['asc']);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
let SPReasonItem = class SPReasonItem extends ApplicationRecord {
|
|
41
|
+
};
|
|
42
|
+
SPReasonItem.jsonapiType = 'reasons';
|
|
43
|
+
__decorate([
|
|
44
|
+
Attr()
|
|
45
|
+
], SPReasonItem.prototype, "name", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
Attr()
|
|
48
|
+
], SPReasonItem.prototype, "order", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
Attr()
|
|
51
|
+
], SPReasonItem.prototype, "iconUrl", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
BelongsTo()
|
|
54
|
+
], SPReasonItem.prototype, "category", void 0);
|
|
55
|
+
SPReasonItem = __decorate([
|
|
56
|
+
Model()
|
|
57
|
+
], SPReasonItem);
|
|
58
|
+
export { SPReasonItem };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IModel, PouchCollection } from "pouchorm";
|
|
2
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
3
|
+
import { IAgency, SPAgencyItem } from "../Agency";
|
|
4
|
+
import { ICompany, SPCompany } from "../Company";
|
|
5
|
+
import { SPPlaceItem, IPlace } from "../Place";
|
|
6
|
+
import { CollectionFindOptions, IClearable } from "../interfaces";
|
|
7
|
+
export interface IResidence extends IModel {
|
|
8
|
+
_id?: string;
|
|
9
|
+
name: string;
|
|
10
|
+
agencyId?: string;
|
|
11
|
+
agency?: IAgency;
|
|
12
|
+
hasScheduledVisit?: boolean;
|
|
13
|
+
places?: IPlace[];
|
|
14
|
+
company?: ICompany;
|
|
15
|
+
}
|
|
16
|
+
export declare class ResidenceCollection extends PouchCollection<IResidence> implements IClearable {
|
|
17
|
+
beforeInit(): Promise<void>;
|
|
18
|
+
clear(): Promise<void>;
|
|
19
|
+
find(selector?: Record<string, any> | Partial<IResidence> | undefined, opts?: CollectionFindOptions): Promise<IResidence[]>;
|
|
20
|
+
}
|
|
21
|
+
export declare class SPResidenceItem extends ApplicationRecord implements IResidence {
|
|
22
|
+
static jsonapiType: string;
|
|
23
|
+
name: string;
|
|
24
|
+
hasScheduledVisit: boolean;
|
|
25
|
+
agency: SPAgencyItem;
|
|
26
|
+
company: SPCompany;
|
|
27
|
+
places: SPPlaceItem[];
|
|
28
|
+
get _id(): string | undefined;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Residence/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,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAEjE,MAAM,WAAW,UAAW,SAAQ,MAAM;IACxC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAA;CACnB;AAED,qBAAa,mBACX,SAAQ,eAAe,CAAC,UAAU,CAClC,YAAW,UAAU;IAEf,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,SAAS,EAAE,IAAI,CAAC,EAAE,qBAAqB;CAI1G;AAED,qBACa,eAAgB,SAAQ,iBAAkB,YAAW,UAAU;IAC1E,MAAM,CAAC,WAAW,SAAe;IACzB,IAAI,EAAG,MAAM,CAAA;IACb,iBAAiB,EAAG,OAAO,CAAA;IACtB,MAAM,EAAG,YAAY,CAAA;IACrB,OAAO,EAAG,SAAS,CAAA;IACrB,MAAM,EAAG,WAAW,EAAE,CAAA;IACjC,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;CACF"}
|
|
@@ -0,0 +1,64 @@
|
|
|
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 ResidenceCollection 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("residences");
|
|
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, ["name"], ["asc"]);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
let SPResidenceItem = class SPResidenceItem extends ApplicationRecord {
|
|
41
|
+
get _id() {
|
|
42
|
+
return this.id;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
SPResidenceItem.jsonapiType = "residences";
|
|
46
|
+
__decorate([
|
|
47
|
+
Attr()
|
|
48
|
+
], SPResidenceItem.prototype, "name", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
Attr()
|
|
51
|
+
], SPResidenceItem.prototype, "hasScheduledVisit", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
BelongsTo()
|
|
54
|
+
], SPResidenceItem.prototype, "agency", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
BelongsTo()
|
|
57
|
+
], SPResidenceItem.prototype, "company", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
HasMany()
|
|
60
|
+
], SPResidenceItem.prototype, "places", void 0);
|
|
61
|
+
SPResidenceItem = __decorate([
|
|
62
|
+
Model()
|
|
63
|
+
], SPResidenceItem);
|
|
64
|
+
export { SPResidenceItem };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CollectionFindOptions, IClearable } from "../interfaces";
|
|
2
|
+
import { ICompany, SPCompany } from "../Company";
|
|
3
|
+
import { IModel, PouchCollection } from "pouchorm";
|
|
4
|
+
import { IAssignation, SPAssignation } from "../Assignation";
|
|
5
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
6
|
+
export interface ISector extends IModel {
|
|
7
|
+
id?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
code: string;
|
|
10
|
+
updatedAt?: Date;
|
|
11
|
+
company?: ICompany;
|
|
12
|
+
assignations?: IAssignation[];
|
|
13
|
+
reporterId?: string;
|
|
14
|
+
placesCount?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare class SectorCollection extends PouchCollection<ISector> implements IClearable {
|
|
17
|
+
beforeInit(): Promise<void>;
|
|
18
|
+
clear(): Promise<void>;
|
|
19
|
+
find(selector?: Record<string, any> | Partial<ISector> | undefined, opts?: CollectionFindOptions): Promise<ISector[]>;
|
|
20
|
+
}
|
|
21
|
+
export declare class SPSectorItem extends ApplicationRecord implements ISector {
|
|
22
|
+
constructor(attrs?: Record<string, any>);
|
|
23
|
+
static jsonapiType: string;
|
|
24
|
+
name: string;
|
|
25
|
+
code: string;
|
|
26
|
+
reporterId: string;
|
|
27
|
+
placesCount?: number | undefined;
|
|
28
|
+
updatedAt: Date;
|
|
29
|
+
company: SPCompany;
|
|
30
|
+
assignations: SPAssignation[];
|
|
31
|
+
get _id(): string | undefined;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Sector/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,eAAe,EAAY,MAAM,UAAU,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,WAAW,OAAQ,SAAQ,MAAM;IACrC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,IAAI,CAAA;IAChB,OAAO,CAAC,EAAE,QAAQ,CAAA;IAClB,YAAY,CAAC,EAAE,YAAY,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;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;CAI/B;AACD,qBACa,YAAa,SAAQ,iBAAkB,YAAW,OAAO;gBACxD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAIvC,MAAM,CAAC,WAAW,SAAY;IACtB,IAAI,EAAG,MAAM,CAAA;IACb,IAAI,EAAG,MAAM,CAAA;IACb,UAAU,EAAG,MAAM,CAAA;IACD,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,SAAS,EAAG,IAAI,CAAA;IAC7B,OAAO,EAAG,SAAS,CAAA;IACrB,YAAY,EAAG,aAAa,EAAE,CAAA;IACzC,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;CACF"}
|
|
@@ -0,0 +1,72 @@
|
|
|
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 { Attr, BelongsTo, HasMany, Model } from "spraypaint";
|
|
17
|
+
import { PouchCollection, PouchORM } from "pouchorm";
|
|
18
|
+
import { ApplicationRecord } from "../ApplicationRecord";
|
|
19
|
+
export class SectorCollection extends PouchCollection {
|
|
20
|
+
beforeInit() {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
clear() {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
yield PouchORM.clearDatabase("sectors");
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
find(selector, opts) {
|
|
30
|
+
const _super = Object.create(null, {
|
|
31
|
+
find: { get: () => super.find }
|
|
32
|
+
});
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
return _super.find.call(this, selector, opts);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
let SPSectorItem = class SPSectorItem extends ApplicationRecord {
|
|
39
|
+
constructor(attrs) {
|
|
40
|
+
super(attrs);
|
|
41
|
+
this.placesCount = (attrs === null || attrs === void 0 ? void 0 : attrs.placesCount) || 0;
|
|
42
|
+
}
|
|
43
|
+
get _id() {
|
|
44
|
+
return this.id;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
SPSectorItem.jsonapiType = "sectors";
|
|
48
|
+
__decorate([
|
|
49
|
+
Attr()
|
|
50
|
+
], SPSectorItem.prototype, "name", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
Attr()
|
|
53
|
+
], SPSectorItem.prototype, "code", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
Attr()
|
|
56
|
+
], SPSectorItem.prototype, "reporterId", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
Attr({ persist: false })
|
|
59
|
+
], SPSectorItem.prototype, "placesCount", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
Attr({ persist: false })
|
|
62
|
+
], SPSectorItem.prototype, "updatedAt", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
BelongsTo()
|
|
65
|
+
], SPSectorItem.prototype, "company", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
HasMany()
|
|
68
|
+
], SPSectorItem.prototype, "assignations", void 0);
|
|
69
|
+
SPSectorItem = __decorate([
|
|
70
|
+
Model()
|
|
71
|
+
], SPSectorItem);
|
|
72
|
+
export { SPSectorItem };
|