sowell-models 1.19.0 → 1.20.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 (89) hide show
  1. package/package.json +9 -12
  2. package/src/models/Company/index.ts +4 -0
  3. package/build/index.d.ts +0 -28
  4. package/build/index.d.ts.map +0 -1
  5. package/build/index.js +0 -27
  6. package/build/models/Agency/index.d.ts +0 -26
  7. package/build/models/Agency/index.d.ts.map +0 -1
  8. package/build/models/Agency/index.js +0 -61
  9. package/build/models/ApplicationRecord/index.d.ts +0 -7
  10. package/build/models/ApplicationRecord/index.d.ts.map +0 -1
  11. package/build/models/ApplicationRecord/index.js +0 -18
  12. package/build/models/AreaItem/index.d.ts +0 -51
  13. package/build/models/AreaItem/index.d.ts.map +0 -1
  14. package/build/models/AreaItem/index.js +0 -101
  15. package/build/models/Assignation/index.d.ts +0 -17
  16. package/build/models/Assignation/index.d.ts.map +0 -1
  17. package/build/models/Assignation/index.js +0 -24
  18. package/build/models/Author/index.d.ts +0 -8
  19. package/build/models/Author/index.d.ts.map +0 -1
  20. package/build/models/Author/index.js +0 -22
  21. package/build/models/Checklist/index.d.ts +0 -41
  22. package/build/models/Checklist/index.d.ts.map +0 -1
  23. package/build/models/Checklist/index.js +0 -79
  24. package/build/models/Checkpoint/index.d.ts +0 -45
  25. package/build/models/Checkpoint/index.d.ts.map +0 -1
  26. package/build/models/Checkpoint/index.js +0 -85
  27. package/build/models/Company/index.d.ts +0 -22
  28. package/build/models/Company/index.d.ts.map +0 -1
  29. package/build/models/Company/index.js +0 -33
  30. package/build/models/Export/index.d.ts +0 -22
  31. package/build/models/Export/index.d.ts.map +0 -1
  32. package/build/models/Export/index.js +0 -34
  33. package/build/models/Family/index.d.ts +0 -20
  34. package/build/models/Family/index.d.ts.map +0 -1
  35. package/build/models/Family/index.js +0 -55
  36. package/build/models/IssueReport/index.d.ts +0 -135
  37. package/build/models/IssueReport/index.d.ts.map +0 -1
  38. package/build/models/IssueReport/index.js +0 -193
  39. package/build/models/Location/index.d.ts +0 -24
  40. package/build/models/Location/index.d.ts.map +0 -1
  41. package/build/models/Location/index.js +0 -33
  42. package/build/models/Origin/index.d.ts +0 -23
  43. package/build/models/Origin/index.d.ts.map +0 -1
  44. package/build/models/Origin/index.js +0 -58
  45. package/build/models/Place/index.d.ts +0 -49
  46. package/build/models/Place/index.d.ts.map +0 -1
  47. package/build/models/Place/index.js +0 -89
  48. package/build/models/Provider/index.d.ts +0 -22
  49. package/build/models/Provider/index.d.ts.map +0 -1
  50. package/build/models/Provider/index.js +0 -58
  51. package/build/models/Reason/index.d.ts +0 -24
  52. package/build/models/Reason/index.d.ts.map +0 -1
  53. package/build/models/Reason/index.js +0 -58
  54. package/build/models/Residence/index.d.ts +0 -30
  55. package/build/models/Residence/index.d.ts.map +0 -1
  56. package/build/models/Residence/index.js +0 -64
  57. package/build/models/Sector/index.d.ts +0 -33
  58. package/build/models/Sector/index.d.ts.map +0 -1
  59. package/build/models/Sector/index.js +0 -72
  60. package/build/models/Spot/index.d.ts +0 -28
  61. package/build/models/Spot/index.d.ts.map +0 -1
  62. package/build/models/Spot/index.js +0 -61
  63. package/build/models/UnseenIssue/index.d.ts +0 -14
  64. package/build/models/UnseenIssue/index.d.ts.map +0 -1
  65. package/build/models/UnseenIssue/index.js +0 -21
  66. package/build/models/User/index.d.ts +0 -53
  67. package/build/models/User/index.d.ts.map +0 -1
  68. package/build/models/User/index.js +0 -116
  69. package/build/models/VisitProp/index.d.ts +0 -31
  70. package/build/models/VisitProp/index.d.ts.map +0 -1
  71. package/build/models/VisitProp/index.js +0 -42
  72. package/build/models/VisitReport/index.d.ts +0 -95
  73. package/build/models/VisitReport/index.d.ts.map +0 -1
  74. package/build/models/VisitReport/index.js +0 -110
  75. package/build/models/VisitSchedule/index.d.ts +0 -42
  76. package/build/models/VisitSchedule/index.d.ts.map +0 -1
  77. package/build/models/VisitSchedule/index.js +0 -82
  78. package/build/models/category/index.d.ts +0 -34
  79. package/build/models/category/index.d.ts.map +0 -1
  80. package/build/models/category/index.js +0 -70
  81. package/build/models/interfaces.d.ts +0 -8
  82. package/build/models/interfaces.d.ts.map +0 -1
  83. package/build/models/interfaces.js +0 -1
  84. package/build/models/types.d.ts +0 -7
  85. package/build/models/types.d.ts.map +0 -1
  86. package/build/models/types.js +0 -9
  87. package/build/utils/arrayDiffBy.d.ts +0 -7
  88. package/build/utils/arrayDiffBy.d.ts.map +0 -1
  89. package/build/utils/arrayDiffBy.js +0 -9
@@ -1,45 +0,0 @@
1
- import { IModel, PouchCollection } from "pouchorm";
2
- import { ICategory, SPCategoryItem } from "../category";
3
- import { ApplicationRecord } from "../ApplicationRecord";
4
- import { IChecklist, SPChecklistItem } from "../Checklist";
5
- import { CollectionFindOptions, IClearable } from "../interfaces";
6
- import { IVisitProp, SPVisitPropItem } from "../VisitProp";
7
- import { ILocation, SPLocationItem } from "../Location";
8
- export interface ICheckpoint extends IModel {
9
- _id?: string;
10
- question?: string;
11
- description?: string;
12
- descriptionImgs?: string[];
13
- checklist?: IChecklist;
14
- categoryId?: number;
15
- category?: ICategory;
16
- defaultReasonId?: number;
17
- visitProps?: IVisitProp[];
18
- locationId?: number;
19
- location?: ILocation;
20
- coefficient?: number;
21
- order?: number;
22
- disallowExclusion?: boolean;
23
- }
24
- export declare class CheckpointCollection extends PouchCollection<ICheckpoint> implements IClearable {
25
- beforeInit(): Promise<void>;
26
- clear(): Promise<void>;
27
- find(selector?: Record<string, any> | Partial<ICheckpoint> | undefined, opts?: CollectionFindOptions): Promise<ICheckpoint[]>;
28
- }
29
- export declare class SPCheckpointItem extends ApplicationRecord implements ICheckpoint {
30
- static jsonapiType: string;
31
- question: string;
32
- description: string;
33
- descriptionImgs: string[];
34
- categoryId: number;
35
- defaultReasonId: number;
36
- locationId: number;
37
- coefficient: number;
38
- order: number;
39
- disallowExclusion: boolean;
40
- category: SPCategoryItem;
41
- checklist: SPChecklistItem;
42
- location?: SPLocationItem | undefined;
43
- visitProps?: SPVisitPropItem[] | undefined;
44
- }
45
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Checkpoint/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAY,MAAM,UAAU,CAAA;AAG5D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEvD,MAAM,WAAW,WAAY,SAAQ,MAAM;IACzC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE,UAAU,EAAE,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAED,qBAAa,oBACX,SAAQ,eAAe,CAAC,WAAW,CACnC,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,WAAW,CAAC,GAAG,SAAS,EACjE,IAAI,CAAC,EAAE,qBAAqB;CAK/B;AAED,qBACa,gBAAiB,SAAQ,iBAAkB,YAAW,WAAW;IAC5E,MAAM,CAAC,WAAW,SAAgB;IAC1B,QAAQ,EAAG,MAAM,CAAA;IACjB,WAAW,EAAG,MAAM,CAAA;IACpB,eAAe,EAAG,MAAM,EAAE,CAAA;IAC1B,UAAU,EAAG,MAAM,CAAA;IACnB,eAAe,EAAG,MAAM,CAAA;IACxB,UAAU,EAAG,MAAM,CAAA;IACnB,WAAW,EAAG,MAAM,CAAA;IACpB,KAAK,EAAG,MAAM,CAAA;IACd,iBAAiB,EAAG,OAAO,CAAA;IACtB,QAAQ,EAAG,cAAc,CAAA;IACzB,SAAS,EAAG,eAAe,CAAA;IAC3B,QAAQ,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;IACvC,UAAU,CAAC,EAAE,eAAe,EAAE,GAAG,SAAS,CAAA;CACtD"}
@@ -1,85 +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 CheckpointCollection extends PouchCollection {
21
- beforeInit() {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- });
24
- }
25
- clear() {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- yield PouchORM.clearDatabase("checkpoints");
28
- });
29
- }
30
- find(selector, opts) {
31
- const _super = Object.create(null, {
32
- find: { get: () => super.find }
33
- });
34
- return __awaiter(this, void 0, void 0, function* () {
35
- const result = yield _super.find.call(this, selector, opts);
36
- return orderBy(result, ["question"], ["asc"]);
37
- });
38
- }
39
- }
40
- let SPCheckpointItem = class SPCheckpointItem extends ApplicationRecord {
41
- };
42
- SPCheckpointItem.jsonapiType = "checkpoints";
43
- __decorate([
44
- Attr()
45
- ], SPCheckpointItem.prototype, "question", void 0);
46
- __decorate([
47
- Attr()
48
- ], SPCheckpointItem.prototype, "description", void 0);
49
- __decorate([
50
- Attr()
51
- ], SPCheckpointItem.prototype, "descriptionImgs", void 0);
52
- __decorate([
53
- Attr()
54
- ], SPCheckpointItem.prototype, "categoryId", void 0);
55
- __decorate([
56
- Attr()
57
- ], SPCheckpointItem.prototype, "defaultReasonId", void 0);
58
- __decorate([
59
- Attr()
60
- ], SPCheckpointItem.prototype, "locationId", void 0);
61
- __decorate([
62
- Attr()
63
- ], SPCheckpointItem.prototype, "coefficient", void 0);
64
- __decorate([
65
- Attr()
66
- ], SPCheckpointItem.prototype, "order", void 0);
67
- __decorate([
68
- Attr()
69
- ], SPCheckpointItem.prototype, "disallowExclusion", void 0);
70
- __decorate([
71
- BelongsTo()
72
- ], SPCheckpointItem.prototype, "category", void 0);
73
- __decorate([
74
- BelongsTo()
75
- ], SPCheckpointItem.prototype, "checklist", void 0);
76
- __decorate([
77
- BelongsTo()
78
- ], SPCheckpointItem.prototype, "location", void 0);
79
- __decorate([
80
- HasMany()
81
- ], SPCheckpointItem.prototype, "visitProps", void 0);
82
- SPCheckpointItem = __decorate([
83
- Model()
84
- ], SPCheckpointItem);
85
- export { SPCheckpointItem };
@@ -1,22 +0,0 @@
1
- import { IModel } from "pouchorm";
2
- import { ApplicationRecord } from "../ApplicationRecord";
3
- import { SPAreaItem } from "../AreaItem";
4
- import { SPAgencyItem } from "../Agency";
5
- import { SPResidenceItem } from "../Residence";
6
- import { SPPlaceItem } from "../Place";
7
- export interface ICompany extends IModel {
8
- id?: string;
9
- _id?: string;
10
- name?: string;
11
- config?: Record<string, any>;
12
- }
13
- export declare class SPCompany extends ApplicationRecord implements ICompany {
14
- static jsonapiType: string;
15
- name: string;
16
- config: Record<string, any>;
17
- spAreaItems: SPAreaItem[];
18
- spAgencyItems: SPAgencyItem[];
19
- spResidenceItems: SPResidenceItem[];
20
- spPlaceItems: SPPlaceItem[];
21
- }
22
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Company/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEtC,MAAM,WAAW,QAAS,SAAQ,MAAM;IACtC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC7B;AAED,qBACa,SAAU,SAAQ,iBAAkB,YAAW,QAAQ;IAClE,MAAM,CAAC,WAAW,SAAc;IACxB,IAAI,EAAG,MAAM,CAAA;IACb,MAAM,EAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAClB,WAAW,EAAG,UAAU,EAAE,CAAA;IACvB,aAAa,EAAG,YAAY,EAAE,CAAA;IAC5B,gBAAgB,EAAG,eAAe,EAAE,CAAA;IACxC,YAAY,EAAG,WAAW,EAAE,CAAA;CAChD"}
@@ -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 { Model, Attr, HasMany } from "spraypaint";
8
- import { ApplicationRecord } from "../ApplicationRecord";
9
- let SPCompany = class SPCompany extends ApplicationRecord {
10
- };
11
- SPCompany.jsonapiType = "companies";
12
- __decorate([
13
- Attr()
14
- ], SPCompany.prototype, "name", void 0);
15
- __decorate([
16
- Attr()
17
- ], SPCompany.prototype, "config", void 0);
18
- __decorate([
19
- HasMany("areas")
20
- ], SPCompany.prototype, "spAreaItems", void 0);
21
- __decorate([
22
- HasMany("agencies")
23
- ], SPCompany.prototype, "spAgencyItems", void 0);
24
- __decorate([
25
- HasMany("residences")
26
- ], SPCompany.prototype, "spResidenceItems", void 0);
27
- __decorate([
28
- HasMany("places")
29
- ], SPCompany.prototype, "spPlaceItems", void 0);
30
- SPCompany = __decorate([
31
- Model()
32
- ], SPCompany);
33
- export { SPCompany };
@@ -1,22 +0,0 @@
1
- import { ApplicationRecord } from "../ApplicationRecord";
2
- export declare enum ExportStatus {
3
- ONGOING = "ongoing",
4
- PENDING = "pending",
5
- DONE = "done",
6
- FAILED = "failed"
7
- }
8
- export interface IExport {
9
- id?: string;
10
- name?: string;
11
- status?: ExportStatus;
12
- params?: string;
13
- url?: string;
14
- }
15
- export declare class SPExport extends ApplicationRecord implements IExport {
16
- static jsonapiType: string;
17
- name: string;
18
- status: ExportStatus;
19
- url: string;
20
- params: string;
21
- }
22
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Export/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,qBACa,QAAS,SAAQ,iBAAkB,YAAW,OAAO;IAChE,MAAM,CAAC,WAAW,SAAY;IACtB,IAAI,EAAG,MAAM,CAAA;IACb,MAAM,EAAG,YAAY,CAAA;IACrB,GAAG,EAAG,MAAM,CAAA;IACZ,MAAM,EAAG,MAAM,CAAA;CACxB"}
@@ -1,34 +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 } from "spraypaint";
8
- import { ApplicationRecord } from "../ApplicationRecord";
9
- export var ExportStatus;
10
- (function (ExportStatus) {
11
- ExportStatus["ONGOING"] = "ongoing";
12
- ExportStatus["PENDING"] = "pending";
13
- ExportStatus["DONE"] = "done";
14
- ExportStatus["FAILED"] = "failed";
15
- })(ExportStatus || (ExportStatus = {}));
16
- let SPExport = class SPExport extends ApplicationRecord {
17
- };
18
- SPExport.jsonapiType = "exports";
19
- __decorate([
20
- Attr()
21
- ], SPExport.prototype, "name", void 0);
22
- __decorate([
23
- Attr()
24
- ], SPExport.prototype, "status", void 0);
25
- __decorate([
26
- Attr()
27
- ], SPExport.prototype, "url", void 0);
28
- __decorate([
29
- Attr()
30
- ], SPExport.prototype, "params", void 0);
31
- SPExport = __decorate([
32
- Model()
33
- ], SPExport);
34
- export { SPExport };
@@ -1,20 +0,0 @@
1
- import { ApplicationRecord } from "../ApplicationRecord";
2
- import { PouchCollection } from "pouchorm";
3
- import { CollectionFindOptions, IClearable } from "../interfaces";
4
- export interface IFamily {
5
- _id?: string;
6
- name?: string;
7
- iconUrl?: string;
8
- }
9
- export declare class SPFamily extends ApplicationRecord implements IFamily {
10
- static jsonapiType: string;
11
- name: string;
12
- iconUrl: string;
13
- get _id(): string | undefined;
14
- }
15
- export declare class FamilyCollection extends PouchCollection<IFamily> implements IClearable {
16
- beforeInit(): Promise<void>;
17
- clear(): Promise<void>;
18
- find(selector?: Record<string, any> | Partial<IFamily> | undefined, opts?: CollectionFindOptions): Promise<IFamily[]>;
19
- }
20
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/Family/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAY,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAGjE,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AACD,qBACa,QAAS,SAAQ,iBAAkB,YAAW,OAAO;IAChE,MAAM,CAAC,WAAW,SAAa;IACvB,IAAI,EAAG,MAAM,CAAA;IACb,OAAO,EAAG,MAAM,CAAA;IACxB,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;CACF;AAED,qBAAa,gBACX,SAAQ,eAAe,CAAC,OAAO,CAC/B,YAAW,UAAU;IAEf,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,IAAI,CACR,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,EAC7D,IAAI,CAAC,EAAE,qBAAqB;CAK/B"}
@@ -1,55 +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 { ApplicationRecord } from "../ApplicationRecord";
18
- import { PouchCollection, PouchORM } from "pouchorm";
19
- import { orderBy } from "lodash";
20
- let SPFamily = class SPFamily extends ApplicationRecord {
21
- get _id() {
22
- return this.id;
23
- }
24
- };
25
- SPFamily.jsonapiType = "families";
26
- __decorate([
27
- Attr()
28
- ], SPFamily.prototype, "name", void 0);
29
- __decorate([
30
- Attr()
31
- ], SPFamily.prototype, "iconUrl", void 0);
32
- SPFamily = __decorate([
33
- Model()
34
- ], SPFamily);
35
- export { SPFamily };
36
- export class FamilyCollection extends PouchCollection {
37
- beforeInit() {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- });
40
- }
41
- clear() {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- yield PouchORM.clearDatabase("places");
44
- });
45
- }
46
- find(selector, opts) {
47
- const _super = Object.create(null, {
48
- find: { get: () => super.find }
49
- });
50
- return __awaiter(this, void 0, void 0, function* () {
51
- const result = yield _super.find.call(this, selector, opts);
52
- return orderBy(result, ["name"], ["asc"]);
53
- });
54
- }
55
- }
@@ -1,135 +0,0 @@
1
- import { IModel, PouchCollection } from "pouchorm";
2
- import { ICompany, SPCompany } from "../Company";
3
- import { ICategory, SPCategoryItem } from "../category";
4
- import { IPlace, SPPlaceItem } from "../Place";
5
- import { ApplicationRecord } from "../ApplicationRecord";
6
- import { IUser, SPUserItem } from "../User";
7
- import { ICheckpoint, SPCheckpointItem } from "../Checkpoint";
8
- import { SPVisitReport } from "../VisitReport";
9
- import { IResidence } from "../Residence";
10
- import { IArea } from "../AreaItem";
11
- import { CollectionFindOptions, IClearable } from "../interfaces";
12
- import { ISpot, SPSpotItem } from "./../Spot";
13
- import { IReason, SPReasonItem } from "../Reason";
14
- import { IOrigin, SPOriginItem } from "../Origin";
15
- import { SPUnseenIssue } from "../UnseenIssue";
16
- import { SPAssignee } from "../Author";
17
- export interface IssueReportPayload {
18
- category?: string;
19
- agency?: string;
20
- residence?: string;
21
- place?: string;
22
- checkpoint?: string;
23
- description: string;
24
- priority: number;
25
- visitReport?: string;
26
- imgs?: File[];
27
- spot?: string;
28
- areaNature?: "housing" | "other_spots" | "common_areas" | "zone";
29
- isTenantRequest?: boolean;
30
- reason?: string;
31
- origin?: string;
32
- assignee?: string;
33
- }
34
- export type Tab = "mySector" | "others";
35
- export interface TalkPayload {
36
- id: string;
37
- issueReportId: string;
38
- message: string;
39
- tab: Tab;
40
- }
41
- export interface ITalk {
42
- id: string;
43
- author: {
44
- id: string;
45
- name: string;
46
- };
47
- message: string;
48
- files: string[];
49
- created_at?: Date;
50
- }
51
- export type ActivityName = "assignation" | "status" | "email_sent" | "erp";
52
- export interface IActivity extends IModel {
53
- _id?: string;
54
- name: ActivityName;
55
- createdAt: Date;
56
- metadata?: Record<string, any>;
57
- authorId?: string;
58
- author?: IUser;
59
- issueReportId?: string;
60
- issueReport?: IIssueReport;
61
- }
62
- export interface IIssueReport extends IModel {
63
- _id?: string;
64
- remoteId?: string;
65
- priority: string;
66
- message: string;
67
- status: string;
68
- checkpointId?: number;
69
- createdAt?: Date;
70
- updatedAt?: Date;
71
- place?: IPlace;
72
- category?: ICategory;
73
- checkpoint?: ICheckpoint;
74
- author?: IUser;
75
- company?: ICompany;
76
- residence?: IResidence;
77
- area?: IArea;
78
- talks?: ITalk[];
79
- activities?: IActivity[];
80
- spot?: ISpot | ISpot[];
81
- imgs?: string[];
82
- isTenantRequest?: boolean;
83
- reason?: IReason;
84
- origin?: IOrigin;
85
- assignee?: IUser;
86
- seen?: boolean;
87
- validate?: () => string;
88
- }
89
- export declare class IssueCollection extends PouchCollection<IIssueReport> implements IClearable {
90
- beforeInit(): Promise<void>;
91
- clear(): Promise<void>;
92
- find(selector?: Record<string, any> | Partial<IIssueReport> | undefined, opts?: CollectionFindOptions): Promise<IIssueReport[]>;
93
- bulkUpsertIfNotExists(items: IIssueReport[]): Promise<IIssueReport[]>;
94
- }
95
- export declare class SPActivity extends ApplicationRecord implements IActivity {
96
- static jsonapiType: string;
97
- name: ActivityName;
98
- createdAt: Date;
99
- metadata: Record<string, any>;
100
- issueReport: SPIssueReportItem;
101
- author: SPUserItem;
102
- }
103
- export declare class SPIssueReportItem extends ApplicationRecord implements Partial<IIssueReport> {
104
- static jsonapiType: string;
105
- isTenantRequest: boolean;
106
- message: string;
107
- talks: ITalk[];
108
- imgs: string[];
109
- priority: string;
110
- status: string;
111
- checkpointId: number;
112
- createdAt: Date;
113
- updatedAt: Date;
114
- pendingIimestamp: Date;
115
- ongoingTimestamp: Date;
116
- doneTimestamp: Date;
117
- canceledTimestamp: Date;
118
- rejectedTimestamp: Date;
119
- seen: boolean;
120
- author: SPUserItem;
121
- category: SPCategoryItem;
122
- residence: IResidence;
123
- place: SPPlaceItem;
124
- spot: SPSpotItem;
125
- company: SPCompany;
126
- visitReport: SPVisitReport;
127
- checkpoint: SPCheckpointItem;
128
- reason: SPReasonItem;
129
- origin?: SPOriginItem | undefined;
130
- assignee?: SPAssignee;
131
- unseenIssues: SPUnseenIssue[];
132
- activities: SPActivity[];
133
- static validate(payload: IssueReportPayload): Promise<string>;
134
- }
135
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/IssueReport/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAY,MAAM,UAAU,CAAA;AAI5D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,cAAc,E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