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,30 +0,0 @@
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
@@ -1 +0,0 @@
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,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? 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 };
@@ -1,33 +0,0 @@
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
@@ -1 +0,0 @@
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,OA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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 };
@@ -1,28 +0,0 @@
1
- import { SPAreaItem, IArea } from "../AreaItem/index";
2
- import { PouchCollection } from "pouchorm";
3
- import { IModel } from "pouchorm";
4
- import { IPlace, SPPlaceItem } from "../Place";
5
- import { ICompany, SPCompany } from "../Company";
6
- import { CollectionFindOptions, IClearable } from "../interfaces";
7
- import { ApplicationRecord } from "../ApplicationRecord";
8
- export interface ISpot extends IModel {
9
- name: string;
10
- placeId?: string;
11
- place?: IPlace;
12
- area?: IArea;
13
- company?: ICompany;
14
- }
15
- export declare class SpotCollection extends PouchCollection<ISpot> implements IClearable {
16
- beforeInit(): Promise<void>;
17
- clear(): Promise<void>;
18
- find(selector?: Record<string, any> | Partial<ISpot> | undefined, opts?: CollectionFindOptions): Promise<ISpot[]>;
19
- }
20
- export declare class SPSpotItem extends ApplicationRecord implements ISpot {
21
- static jsonapiType: string;
22
- name: string;
23
- place: SPPlaceItem;
24
- area: SPAreaItem;
25
- company: SPCompany;
26
- get _id(): string | undefined;
27
- }
28
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Spot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGrD,OAAO,EAAE,eAAe,EAAY,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,WAAW,KAAM,SAAQ,MAAM;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,OAAO,CAAC,EAAE,QAAQ,CAAA;CACnB;AAED,qBAAa,cACX,SAAQ,eAAe,CAAC,KAAK,CAC7B,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,KAAK,CAAC,GAAG,SAAS,EAC3D,IAAI,CAAC,EAAE,qBAAqB;CAK/B;AAED,qBACa,UAAW,SAAQ,iBAAkB,YAAW,KAAK;IAChE,MAAM,CAAC,WAAW,SAAU;IACpB,IAAI,EAAG,MAAM,CAAA;IACR,KAAK,EAAG,WAAW,CAAA;IACnB,IAAI,EAAG,UAAU,CAAA;IACjB,OAAO,EAAG,SAAS,CAAA;IAChC,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;CACF"}
@@ -1,61 +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 { orderBy } from "lodash";
18
- import { PouchCollection, PouchORM } from "pouchorm";
19
- import { ApplicationRecord } from "../ApplicationRecord";
20
- export class SpotCollection 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("spots");
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 SPSpotItem = class SPSpotItem extends ApplicationRecord {
41
- get _id() {
42
- return this.id;
43
- }
44
- };
45
- SPSpotItem.jsonapiType = "spots";
46
- __decorate([
47
- Attr()
48
- ], SPSpotItem.prototype, "name", void 0);
49
- __decorate([
50
- BelongsTo()
51
- ], SPSpotItem.prototype, "place", void 0);
52
- __decorate([
53
- BelongsTo()
54
- ], SPSpotItem.prototype, "area", void 0);
55
- __decorate([
56
- BelongsTo()
57
- ], SPSpotItem.prototype, "company", void 0);
58
- SPSpotItem = __decorate([
59
- Model()
60
- ], SPSpotItem);
61
- export { SPSpotItem };
@@ -1,14 +0,0 @@
1
- import { ApplicationRecord } from "../ApplicationRecord";
2
- import { IUser, SPUserItem } from "../User";
3
- import { IIssueReport, SPIssueReportItem } from "../IssueReport";
4
- import { IModel } from "pouchorm";
5
- export interface IUnseenIssue extends IModel {
6
- user?: IUser;
7
- issueReport?: IIssueReport;
8
- }
9
- export declare class SPUnseenIssue extends ApplicationRecord implements IUnseenIssue {
10
- static jsonapiType: string;
11
- user: SPUserItem;
12
- issueReport: SPIssueReportItem;
13
- }
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/UnseenIssue/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,MAAM,WAAW,YAAa,SAAQ,MAAM;IAC1C,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,WAAW,CAAC,EAAE,YAAY,CAAA;CAC3B;AAED,qBACa,aAAc,SAAQ,iBAAkB,YAAW,YAAY;IAC1E,MAAM,CAAC,WAAW,SAAkB;IACvB,IAAI,EAAG,UAAU,CAAA;IACjB,WAAW,EAAG,iBAAiB,CAAA;CAC7C"}
@@ -1,21 +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 { BelongsTo, Model } from "spraypaint";
8
- import { ApplicationRecord } from "../ApplicationRecord";
9
- let SPUnseenIssue = class SPUnseenIssue extends ApplicationRecord {
10
- };
11
- SPUnseenIssue.jsonapiType = "unseen_issues";
12
- __decorate([
13
- BelongsTo()
14
- ], SPUnseenIssue.prototype, "user", void 0);
15
- __decorate([
16
- BelongsTo()
17
- ], SPUnseenIssue.prototype, "issueReport", void 0);
18
- SPUnseenIssue = __decorate([
19
- Model()
20
- ], SPUnseenIssue);
21
- export { SPUnseenIssue };
@@ -1,53 +0,0 @@
1
- import { ICompany, SPCompany } from "../Company";
2
- import { ApplicationRecord } from "../ApplicationRecord";
3
- import { IModel, PouchCollection } from "pouchorm";
4
- import { IAssignation, SPAssignation } from "../Assignation";
5
- import { SPUnseenIssue } from "../UnseenIssue";
6
- export type PhoneNumber = {
7
- msisdn: string;
8
- };
9
- export interface IUser extends IModel {
10
- id?: string;
11
- fname?: string;
12
- lname?: string;
13
- fullName?: string;
14
- email?: string;
15
- code?: string;
16
- company?: ICompany;
17
- img?: string;
18
- password?: string;
19
- assignationsCount?: number | null;
20
- status?: string;
21
- recipients?: PhoneNumber[];
22
- assignations?: IAssignation[];
23
- canUpdateIssueReports?: boolean;
24
- emailNotificationsActivated?: boolean;
25
- }
26
- export declare class UserCollection extends PouchCollection<IUser> {
27
- beforeInit(): Promise<void>;
28
- clear(): Promise<void>;
29
- bulkUpsertIfNotExists(items: IUser[]): Promise<IUser[]>;
30
- }
31
- export declare class AssigneeCollection extends PouchCollection<IUser> {
32
- beforeInit(): Promise<void>;
33
- clear(): Promise<void>;
34
- bulkUpsertIfNotExists(items: IUser[]): Promise<IUser[]>;
35
- }
36
- export declare class SPUserItem extends ApplicationRecord implements IUser {
37
- static jsonapiType: string;
38
- fname: string;
39
- lname: string;
40
- email: string;
41
- fullName: string;
42
- password: string;
43
- status: string;
44
- code: string;
45
- recipients?: PhoneNumber[];
46
- assignationsCount: number | null;
47
- canUpdateIssueReports: boolean;
48
- emailNotificationsActivated: boolean;
49
- company: SPCompany;
50
- assignations: SPAssignation[];
51
- unseenIssues: SPUnseenIssue[];
52
- }
53
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/User/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,eAAe,EAAY,MAAM,UAAU,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE9C,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,WAAW,KAAM,SAAQ,MAAM;IACnC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,QAAQ,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,WAAW,EAAE,CAAA;IAC1B,YAAY,CAAC,EAAE,YAAY,EAAE,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,2BAA2B,CAAC,EAAE,OAAO,CAAA;CACtC;AAED,qBAAa,cAAe,SAAQ,eAAe,CAAC,KAAK,CAAC;IAClD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;CAM9D;AAED,qBAAa,kBAAmB,SAAQ,eAAe,CAAC,KAAK,CAAC;IACtD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;CAM9D;AAGD,qBACa,UAAW,SAAQ,iBAAkB,YAAW,KAAK;IAChE,MAAM,CAAC,WAAW,SAAU;IACpB,KAAK,EAAG,MAAM,CAAA;IACd,KAAK,EAAG,MAAM,CAAA;IACd,KAAK,EAAG,MAAM,CAAA;IACd,QAAQ,EAAG,MAAM,CAAA;IACjB,QAAQ,EAAG,MAAM,CAAA;IACjB,MAAM,EAAG,MAAM,CAAA;IACf,IAAI,EAAG,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,WAAW,EAAE,CAAA;IAC1B,iBAAiB,EAAG,MAAM,GAAG,IAAI,CAAA;IACjC,qBAAqB,EAAG,OAAO,CAAA;IAC/B,2BAA2B,EAAG,OAAO,CAAA;IAChC,OAAO,EAAG,SAAS,CAAA;IACrB,YAAY,EAAG,aAAa,EAAE,CAAA;IAC9B,YAAY,EAAG,aAAa,EAAE,CAAA;CAC1C"}
@@ -1,116 +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 { Attr, BelongsTo, HasMany, Model } from "spraypaint";
17
- import { ApplicationRecord } from "../ApplicationRecord";
18
- import { PouchCollection, PouchORM } from "pouchorm";
19
- import arrayDiffBy from "../../utils/arrayDiffBy";
20
- export class UserCollection extends PouchCollection {
21
- beforeInit() {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- yield this.addIndex(["id"]);
24
- });
25
- }
26
- clear() {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- yield PouchORM.clearDatabase("users");
29
- });
30
- }
31
- bulkUpsertIfNotExists(items) {
32
- const _super = Object.create(null, {
33
- find: { get: () => super.find },
34
- bulkUpsert: { get: () => super.bulkUpsert }
35
- });
36
- return __awaiter(this, void 0, void 0, function* () {
37
- const existingItems = yield _super.find.call(this, {});
38
- const diff = arrayDiffBy(existingItems, items, "id");
39
- const upsertedIssueReport = yield _super.bulkUpsert.call(this, diff.missingLeft);
40
- return upsertedIssueReport;
41
- });
42
- }
43
- }
44
- export class AssigneeCollection extends PouchCollection {
45
- beforeInit() {
46
- return __awaiter(this, void 0, void 0, function* () {
47
- yield this.addIndex(["id"]);
48
- });
49
- }
50
- clear() {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- yield PouchORM.clearDatabase("assignees");
53
- });
54
- }
55
- bulkUpsertIfNotExists(items) {
56
- const _super = Object.create(null, {
57
- find: { get: () => super.find },
58
- bulkUpsert: { get: () => super.bulkUpsert }
59
- });
60
- return __awaiter(this, void 0, void 0, function* () {
61
- const existingItems = yield _super.find.call(this, {});
62
- const diff = arrayDiffBy(existingItems, items, "id");
63
- const upsertedIssueReport = yield _super.bulkUpsert.call(this, diff.missingLeft);
64
- return upsertedIssueReport;
65
- });
66
- }
67
- }
68
- let SPUserItem = class SPUserItem extends ApplicationRecord {
69
- };
70
- SPUserItem.jsonapiType = "users";
71
- __decorate([
72
- Attr()
73
- ], SPUserItem.prototype, "fname", void 0);
74
- __decorate([
75
- Attr()
76
- ], SPUserItem.prototype, "lname", void 0);
77
- __decorate([
78
- Attr()
79
- ], SPUserItem.prototype, "email", void 0);
80
- __decorate([
81
- Attr()
82
- ], SPUserItem.prototype, "fullName", void 0);
83
- __decorate([
84
- Attr()
85
- ], SPUserItem.prototype, "password", void 0);
86
- __decorate([
87
- Attr()
88
- ], SPUserItem.prototype, "status", void 0);
89
- __decorate([
90
- Attr()
91
- ], SPUserItem.prototype, "code", void 0);
92
- __decorate([
93
- Attr()
94
- ], SPUserItem.prototype, "recipients", void 0);
95
- __decorate([
96
- Attr()
97
- ], SPUserItem.prototype, "assignationsCount", void 0);
98
- __decorate([
99
- Attr()
100
- ], SPUserItem.prototype, "canUpdateIssueReports", void 0);
101
- __decorate([
102
- Attr()
103
- ], SPUserItem.prototype, "emailNotificationsActivated", void 0);
104
- __decorate([
105
- BelongsTo()
106
- ], SPUserItem.prototype, "company", void 0);
107
- __decorate([
108
- HasMany()
109
- ], SPUserItem.prototype, "assignations", void 0);
110
- __decorate([
111
- HasMany()
112
- ], SPUserItem.prototype, "unseenIssues", void 0);
113
- SPUserItem = __decorate([
114
- Model()
115
- ], SPUserItem);
116
- export { SPUserItem };
@@ -1,31 +0,0 @@
1
- import { IModel } from "pouchorm";
2
- import { ApplicationRecord } from "../ApplicationRecord";
3
- import { IPlace, SPPlaceItem } from "../Place";
4
- import { ICheckpoint, SPCheckpointItem } from "../Checkpoint";
5
- import { IResidence, SPResidenceItem } from "../Residence";
6
- import { ISpot, SPSpotItem } from "../Spot";
7
- export interface IVisitProp extends IModel {
8
- _id?: string;
9
- status?: "pending" | "missing";
10
- place?: IPlace;
11
- placeId?: number;
12
- checkpoint?: ICheckpoint;
13
- checkpointId?: number;
14
- residence?: IResidence;
15
- residenceId?: number;
16
- spot?: ISpot;
17
- spotId?: number;
18
- }
19
- export declare class SPVisitPropItem extends ApplicationRecord implements IVisitProp {
20
- static jsonapiType: string;
21
- status: "pending" | "missing";
22
- placeId: number;
23
- checkpointId: number;
24
- residenceId: number;
25
- spotId: number;
26
- place: SPPlaceItem;
27
- checkpoint: SPCheckpointItem;
28
- residence: SPResidenceItem;
29
- spot: SPSpotItem;
30
- }
31
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/VisitProp/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAE3C,MAAM,WAAW,UAAW,SAAQ,MAAM;IACxC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,WAAW,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,qBACa,eAAgB,SAAQ,iBAAkB,YAAW,UAAU;IAC1E,MAAM,CAAC,WAAW,SAAgB;IAC1B,MAAM,EAAG,SAAS,GAAG,SAAS,CAAA;IAC9B,OAAO,EAAG,MAAM,CAAA;IAChB,YAAY,EAAG,MAAM,CAAA;IACrB,WAAW,EAAG,MAAM,CAAA;IACpB,MAAM,EAAG,MAAM,CAAA;IACV,KAAK,EAAG,WAAW,CAAA;IACnB,UAAU,EAAG,gBAAgB,CAAA;IAC7B,SAAS,EAAG,eAAe,CAAA;IAC3B,IAAI,EAAG,UAAU,CAAA;CAC/B"}
@@ -1,42 +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 { Model, Attr, BelongsTo } from "spraypaint";
8
- import { ApplicationRecord } from "../ApplicationRecord";
9
- let SPVisitPropItem = class SPVisitPropItem extends ApplicationRecord {
10
- };
11
- SPVisitPropItem.jsonapiType = "visit_props";
12
- __decorate([
13
- Attr()
14
- ], SPVisitPropItem.prototype, "status", void 0);
15
- __decorate([
16
- Attr()
17
- ], SPVisitPropItem.prototype, "placeId", void 0);
18
- __decorate([
19
- Attr()
20
- ], SPVisitPropItem.prototype, "checkpointId", void 0);
21
- __decorate([
22
- Attr()
23
- ], SPVisitPropItem.prototype, "residenceId", void 0);
24
- __decorate([
25
- Attr()
26
- ], SPVisitPropItem.prototype, "spotId", void 0);
27
- __decorate([
28
- BelongsTo()
29
- ], SPVisitPropItem.prototype, "place", void 0);
30
- __decorate([
31
- BelongsTo()
32
- ], SPVisitPropItem.prototype, "checkpoint", void 0);
33
- __decorate([
34
- BelongsTo()
35
- ], SPVisitPropItem.prototype, "residence", void 0);
36
- __decorate([
37
- BelongsTo()
38
- ], SPVisitPropItem.prototype, "spot", void 0);
39
- SPVisitPropItem = __decorate([
40
- Model()
41
- ], SPVisitPropItem);
42
- export { SPVisitPropItem };