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.
Files changed (90) hide show
  1. package/package.json +9 -12
  2. package/src/models/Checklist/index.ts +2 -0
  3. package/src/models/Company/index.ts +4 -0
  4. package/build/index.d.ts +0 -28
  5. package/build/index.d.ts.map +0 -1
  6. package/build/index.js +0 -27
  7. package/build/models/Agency/index.d.ts +0 -26
  8. package/build/models/Agency/index.d.ts.map +0 -1
  9. package/build/models/Agency/index.js +0 -61
  10. package/build/models/ApplicationRecord/index.d.ts +0 -7
  11. package/build/models/ApplicationRecord/index.d.ts.map +0 -1
  12. package/build/models/ApplicationRecord/index.js +0 -18
  13. package/build/models/AreaItem/index.d.ts +0 -51
  14. package/build/models/AreaItem/index.d.ts.map +0 -1
  15. package/build/models/AreaItem/index.js +0 -101
  16. package/build/models/Assignation/index.d.ts +0 -17
  17. package/build/models/Assignation/index.d.ts.map +0 -1
  18. package/build/models/Assignation/index.js +0 -24
  19. package/build/models/Author/index.d.ts +0 -8
  20. package/build/models/Author/index.d.ts.map +0 -1
  21. package/build/models/Author/index.js +0 -22
  22. package/build/models/Checklist/index.d.ts +0 -41
  23. package/build/models/Checklist/index.d.ts.map +0 -1
  24. package/build/models/Checklist/index.js +0 -79
  25. package/build/models/Checkpoint/index.d.ts +0 -45
  26. package/build/models/Checkpoint/index.d.ts.map +0 -1
  27. package/build/models/Checkpoint/index.js +0 -85
  28. package/build/models/Company/index.d.ts +0 -22
  29. package/build/models/Company/index.d.ts.map +0 -1
  30. package/build/models/Company/index.js +0 -33
  31. package/build/models/Export/index.d.ts +0 -22
  32. package/build/models/Export/index.d.ts.map +0 -1
  33. package/build/models/Export/index.js +0 -34
  34. package/build/models/Family/index.d.ts +0 -20
  35. package/build/models/Family/index.d.ts.map +0 -1
  36. package/build/models/Family/index.js +0 -55
  37. package/build/models/IssueReport/index.d.ts +0 -135
  38. package/build/models/IssueReport/index.d.ts.map +0 -1
  39. package/build/models/IssueReport/index.js +0 -193
  40. package/build/models/Location/index.d.ts +0 -24
  41. package/build/models/Location/index.d.ts.map +0 -1
  42. package/build/models/Location/index.js +0 -33
  43. package/build/models/Origin/index.d.ts +0 -23
  44. package/build/models/Origin/index.d.ts.map +0 -1
  45. package/build/models/Origin/index.js +0 -58
  46. package/build/models/Place/index.d.ts +0 -49
  47. package/build/models/Place/index.d.ts.map +0 -1
  48. package/build/models/Place/index.js +0 -89
  49. package/build/models/Provider/index.d.ts +0 -22
  50. package/build/models/Provider/index.d.ts.map +0 -1
  51. package/build/models/Provider/index.js +0 -58
  52. package/build/models/Reason/index.d.ts +0 -24
  53. package/build/models/Reason/index.d.ts.map +0 -1
  54. package/build/models/Reason/index.js +0 -58
  55. package/build/models/Residence/index.d.ts +0 -30
  56. package/build/models/Residence/index.d.ts.map +0 -1
  57. package/build/models/Residence/index.js +0 -64
  58. package/build/models/Sector/index.d.ts +0 -33
  59. package/build/models/Sector/index.d.ts.map +0 -1
  60. package/build/models/Sector/index.js +0 -72
  61. package/build/models/Spot/index.d.ts +0 -28
  62. package/build/models/Spot/index.d.ts.map +0 -1
  63. package/build/models/Spot/index.js +0 -61
  64. package/build/models/UnseenIssue/index.d.ts +0 -14
  65. package/build/models/UnseenIssue/index.d.ts.map +0 -1
  66. package/build/models/UnseenIssue/index.js +0 -21
  67. package/build/models/User/index.d.ts +0 -53
  68. package/build/models/User/index.d.ts.map +0 -1
  69. package/build/models/User/index.js +0 -116
  70. package/build/models/VisitProp/index.d.ts +0 -31
  71. package/build/models/VisitProp/index.d.ts.map +0 -1
  72. package/build/models/VisitProp/index.js +0 -42
  73. package/build/models/VisitReport/index.d.ts +0 -95
  74. package/build/models/VisitReport/index.d.ts.map +0 -1
  75. package/build/models/VisitReport/index.js +0 -110
  76. package/build/models/VisitSchedule/index.d.ts +0 -42
  77. package/build/models/VisitSchedule/index.d.ts.map +0 -1
  78. package/build/models/VisitSchedule/index.js +0 -82
  79. package/build/models/category/index.d.ts +0 -34
  80. package/build/models/category/index.d.ts.map +0 -1
  81. package/build/models/category/index.js +0 -70
  82. package/build/models/interfaces.d.ts +0 -8
  83. package/build/models/interfaces.d.ts.map +0 -1
  84. package/build/models/interfaces.js +0 -1
  85. package/build/models/types.d.ts +0 -7
  86. package/build/models/types.d.ts.map +0 -1
  87. package/build/models/types.js +0 -9
  88. package/build/utils/arrayDiffBy.d.ts +0 -7
  89. package/build/utils/arrayDiffBy.d.ts.map +0 -1
  90. package/build/utils/arrayDiffBy.js +0 -9
@@ -1,193 +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 * 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 };
@@ -1,24 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,33 +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
- 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 };
@@ -1,23 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,58 +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, 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 };
@@ -1,49 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,89 +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 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 };
@@ -1,22 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,58 +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 } 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 };
@@ -1,24 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,58 +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 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 };