@sigmatech/pergamo 0.1.87 → 0.1.90

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 (37) hide show
  1. package/dist/entities/cases/case-asset.entity.d.ts +25 -0
  2. package/dist/entities/cases/case-asset.entity.d.ts.map +1 -0
  3. package/dist/entities/cases/case-asset.entity.js +114 -0
  4. package/dist/entities/cases/case-asset.entity.js.map +1 -0
  5. package/dist/entities/cases/case-event.entity.d.ts +14 -0
  6. package/dist/entities/cases/case-event.entity.d.ts.map +1 -0
  7. package/dist/entities/cases/case-event.entity.js +57 -0
  8. package/dist/entities/cases/case-event.entity.js.map +1 -0
  9. package/dist/entities/cases/case-note.entity.d.ts +14 -0
  10. package/dist/entities/cases/case-note.entity.d.ts.map +1 -0
  11. package/dist/entities/cases/case-note.entity.js +62 -0
  12. package/dist/entities/cases/case-note.entity.js.map +1 -0
  13. package/dist/entities/cases/case-role.entity.d.ts +23 -0
  14. package/dist/entities/cases/case-role.entity.d.ts.map +1 -0
  15. package/dist/entities/cases/case-role.entity.js +130 -0
  16. package/dist/entities/cases/case-role.entity.js.map +1 -0
  17. package/dist/entities/cases/case-search.entity.d.ts +22 -0
  18. package/dist/entities/cases/case-search.entity.d.ts.map +1 -0
  19. package/dist/entities/cases/case-search.entity.js +100 -0
  20. package/dist/entities/cases/case-search.entity.js.map +1 -0
  21. package/dist/entities/cases/enums.d.ts +136 -0
  22. package/dist/entities/cases/enums.d.ts.map +1 -0
  23. package/dist/entities/cases/enums.js +154 -0
  24. package/dist/entities/cases/enums.js.map +1 -0
  25. package/dist/entities/cases/index.d.ts +8 -0
  26. package/dist/entities/cases/index.d.ts.map +1 -0
  27. package/dist/entities/cases/index.js +24 -0
  28. package/dist/entities/cases/index.js.map +1 -0
  29. package/dist/entities/cases/intel-case.entity.d.ts +34 -0
  30. package/dist/entities/cases/intel-case.entity.d.ts.map +1 -0
  31. package/dist/entities/cases/intel-case.entity.js +162 -0
  32. package/dist/entities/cases/intel-case.entity.js.map +1 -0
  33. package/dist/entities/index.d.ts +1 -4
  34. package/dist/entities/index.d.ts.map +1 -1
  35. package/dist/entities/index.js +7 -5
  36. package/dist/entities/index.js.map +1 -1
  37. package/package.json +1 -1
@@ -0,0 +1,25 @@
1
+ import { EntityBase } from '../base/_base';
2
+ import { IntelCase } from './intel-case.entity';
3
+ import { AssetType, AssetRole, AssetStatus } from './enums';
4
+ export declare class CaseAsset extends EntityBase {
5
+ case: IntelCase;
6
+ caseId?: string;
7
+ assetType: AssetType;
8
+ assetReference: string;
9
+ assetRole: AssetRole;
10
+ status: AssetStatus;
11
+ displayName?: string;
12
+ description?: string;
13
+ notes?: string;
14
+ personId?: string;
15
+ personPioId?: string;
16
+ snapshot?: Record<string, any>;
17
+ linkedDate?: Date;
18
+ linkedBy?: string;
19
+ sourceSearchId?: string;
20
+ isPrimary: boolean;
21
+ relevanceScore: number;
22
+ metadata?: Record<string, any>;
23
+ setDefaults(): void;
24
+ }
25
+ //# sourceMappingURL=case-asset.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case-asset.entity.d.ts","sourceRoot":"","sources":["../../../src/entities/cases/case-asset.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE5D,qBAKa,SAAU,SAAQ,UAAU;IAGvC,IAAI,EAAG,SAAS,CAAC;IAGjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,SAAS,EAAG,SAAS,CAAC;IAGtB,cAAc,EAAG,MAAM,CAAC;IAGxB,SAAS,EAAG,SAAS,CAAC;IAGtB,MAAM,EAAG,WAAW,CAAC;IAGrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAG/B,UAAU,CAAC,EAAE,IAAI,CAAC;IAGlB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,cAAc,CAAC,EAAE,MAAM,CAAC;IAGxB,SAAS,EAAG,OAAO,CAAC;IAGpB,cAAc,EAAG,MAAM,CAAC;IAGxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAI/B,WAAW;CAMZ"}
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CaseAsset = void 0;
13
+ const _base_1 = require("../base/_base");
14
+ const typeorm_1 = require("typeorm");
15
+ const intel_case_entity_1 = require("./intel-case.entity");
16
+ const enums_1 = require("./enums");
17
+ let CaseAsset = class CaseAsset extends _base_1.EntityBase {
18
+ setDefaults() {
19
+ if (!this.linkedDate)
20
+ this.linkedDate = new Date();
21
+ if (this.displayName === undefined || this.displayName === null) {
22
+ this.displayName = `${this.assetType}: ${this.assetReference}`;
23
+ }
24
+ }
25
+ };
26
+ exports.CaseAsset = CaseAsset;
27
+ __decorate([
28
+ (0, typeorm_1.ManyToOne)(() => intel_case_entity_1.IntelCase, (c) => c.assets, { onDelete: 'CASCADE' }),
29
+ (0, typeorm_1.JoinColumn)({ name: 'case_id' }),
30
+ __metadata("design:type", intel_case_entity_1.IntelCase)
31
+ ], CaseAsset.prototype, "case", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true, name: 'case_id' }),
34
+ __metadata("design:type", String)
35
+ ], CaseAsset.prototype, "caseId", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: 'enum', enum: enums_1.AssetType, name: 'asset_type' }),
38
+ __metadata("design:type", String)
39
+ ], CaseAsset.prototype, "assetType", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, name: 'asset_reference' }),
42
+ __metadata("design:type", String)
43
+ ], CaseAsset.prototype, "assetReference", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ type: 'enum', enum: enums_1.AssetRole, name: 'asset_role' }),
46
+ __metadata("design:type", String)
47
+ ], CaseAsset.prototype, "assetRole", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ type: 'enum', enum: enums_1.AssetStatus, default: enums_1.AssetStatus.ACTIVE }),
50
+ __metadata("design:type", String)
51
+ ], CaseAsset.prototype, "status", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true, name: 'display_name' }),
54
+ __metadata("design:type", String)
55
+ ], CaseAsset.prototype, "displayName", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true }),
58
+ __metadata("design:type", String)
59
+ ], CaseAsset.prototype, "description", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
62
+ __metadata("design:type", String)
63
+ ], CaseAsset.prototype, "notes", void 0);
64
+ __decorate([
65
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true, name: 'person_id' }),
66
+ __metadata("design:type", String)
67
+ ], CaseAsset.prototype, "personId", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true, name: 'person_pio_id' }),
70
+ __metadata("design:type", String)
71
+ ], CaseAsset.prototype, "personPioId", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
74
+ __metadata("design:type", Object)
75
+ ], CaseAsset.prototype, "snapshot", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.Column)({ type: 'date', nullable: true, name: 'linked_date' }),
78
+ __metadata("design:type", Date)
79
+ ], CaseAsset.prototype, "linkedDate", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true, name: 'linked_by' }),
82
+ __metadata("design:type", String)
83
+ ], CaseAsset.prototype, "linkedBy", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true, name: 'source_search_id' }),
86
+ __metadata("design:type", String)
87
+ ], CaseAsset.prototype, "sourceSearchId", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.Column)({ type: 'boolean', default: false, name: 'is_primary' }),
90
+ __metadata("design:type", Boolean)
91
+ ], CaseAsset.prototype, "isPrimary", void 0);
92
+ __decorate([
93
+ (0, typeorm_1.Column)({ type: 'int', default: 0, name: 'relevance_score' }),
94
+ __metadata("design:type", Number)
95
+ ], CaseAsset.prototype, "relevanceScore", void 0);
96
+ __decorate([
97
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
98
+ __metadata("design:type", Object)
99
+ ], CaseAsset.prototype, "metadata", void 0);
100
+ __decorate([
101
+ (0, typeorm_1.BeforeInsert)(),
102
+ (0, typeorm_1.BeforeUpdate)(),
103
+ __metadata("design:type", Function),
104
+ __metadata("design:paramtypes", []),
105
+ __metadata("design:returntype", void 0)
106
+ ], CaseAsset.prototype, "setDefaults", null);
107
+ exports.CaseAsset = CaseAsset = __decorate([
108
+ (0, typeorm_1.Entity)({ name: 'case_asset', schema: 'cases' }),
109
+ (0, typeorm_1.Index)('case_asset_case_idx', ['caseId']),
110
+ (0, typeorm_1.Index)('case_asset_type_idx', ['assetType']),
111
+ (0, typeorm_1.Index)('case_asset_reference_idx', ['assetType', 'assetReference']),
112
+ (0, typeorm_1.Index)('case_asset_tenant_idx', ['tenantId'])
113
+ ], CaseAsset);
114
+ //# sourceMappingURL=case-asset.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case-asset.entity.js","sourceRoot":"","sources":["../../../src/entities/cases/case-asset.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA2C;AAC3C,qCAAmG;AACnG,2DAAgD;AAChD,mCAA4D;AAOrD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,kBAAU;IA0DvC,WAAW;QACT,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;QACnD,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;YAChE,IAAI,CAAC,WAAW,GAAG,GAAG,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;QACjE,CAAC;IACH,CAAC;CACF,CAAA;AAhEY,8BAAS;AAGpB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6BAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACpE,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8BACzB,6BAAS;uCAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;yCAC1C;A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,CAAC;GAChC,SAAS,CAgErB"}
@@ -0,0 +1,14 @@
1
+ import { EntityBase } from '../base/_base';
2
+ import { IntelCase } from './intel-case.entity';
3
+ import { User } from '../user.entity';
4
+ import { CaseEventType } from './enums';
5
+ export declare class CaseEvent extends EntityBase {
6
+ case: IntelCase;
7
+ caseId?: string;
8
+ eventType: CaseEventType;
9
+ description: string;
10
+ metadata?: Record<string, any>;
11
+ occurredAt: Date;
12
+ performedBy?: User;
13
+ }
14
+ //# sourceMappingURL=case-event.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case-event.entity.d.ts","sourceRoot":"","sources":["../../../src/entities/cases/case-event.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,qBAIa,SAAU,SAAQ,UAAU;IAGvC,IAAI,EAAG,SAAS,CAAC;IAGjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,SAAS,EAAG,aAAa,CAAC;IAG1B,WAAW,EAAG,MAAM,CAAC;IAGrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAG/B,UAAU,EAAG,IAAI,CAAC;IAIlB,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CaseEvent = void 0;
13
+ const _base_1 = require("../base/_base");
14
+ const typeorm_1 = require("typeorm");
15
+ const intel_case_entity_1 = require("./intel-case.entity");
16
+ const user_entity_1 = require("../user.entity");
17
+ const enums_1 = require("./enums");
18
+ let CaseEvent = class CaseEvent extends _base_1.EntityBase {
19
+ };
20
+ exports.CaseEvent = CaseEvent;
21
+ __decorate([
22
+ (0, typeorm_1.ManyToOne)(() => intel_case_entity_1.IntelCase, (c) => c.events, { onDelete: 'CASCADE' }),
23
+ (0, typeorm_1.JoinColumn)({ name: 'case_id' }),
24
+ __metadata("design:type", intel_case_entity_1.IntelCase)
25
+ ], CaseEvent.prototype, "case", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true, name: 'case_id' }),
28
+ __metadata("design:type", String)
29
+ ], CaseEvent.prototype, "caseId", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ type: 'enum', enum: enums_1.CaseEventType, name: 'event_type' }),
32
+ __metadata("design:type", String)
33
+ ], CaseEvent.prototype, "eventType", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ type: 'text' }),
36
+ __metadata("design:type", String)
37
+ ], CaseEvent.prototype, "description", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
40
+ __metadata("design:type", Object)
41
+ ], CaseEvent.prototype, "metadata", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP', name: 'occurred_at' }),
44
+ __metadata("design:type", Date)
45
+ ], CaseEvent.prototype, "occurredAt", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, { nullable: true, eager: false }),
48
+ (0, typeorm_1.JoinColumn)({ name: 'performed_by_id' }),
49
+ __metadata("design:type", user_entity_1.User)
50
+ ], CaseEvent.prototype, "performedBy", void 0);
51
+ exports.CaseEvent = CaseEvent = __decorate([
52
+ (0, typeorm_1.Entity)({ name: 'case_event', schema: 'cases' }),
53
+ (0, typeorm_1.Index)('case_event_case_idx', ['caseId']),
54
+ (0, typeorm_1.Index)('case_event_type_idx', ['eventType']),
55
+ (0, typeorm_1.Index)('case_event_occurred_idx', ['occurredAt'])
56
+ ], CaseEvent);
57
+ //# sourceMappingURL=case-event.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case-event.entity.js","sourceRoot":"","sources":["../../../src/entities/cases/case-event.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA2C;AAC3C,qCAAuE;AACvE,2DAAgD;AAChD,gDAAsC;AACtC,mCAAwC;AAMjC,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,kBAAU;CAuBxC,CAAA;AAvBY,8BAAS;AAGpB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6BAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACpE,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8BACzB,6BAAS;uCAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;yCAC1C;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAa,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;;4CACxC;AAG1B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CACJ;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACX;AAG/B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BAC1E,IAAI;6CAAC;AAIlB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IACvD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;8BAC1B,kBAAI;8CAAC;oBAtBR,SAAS;IAJrB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC/C,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,WAAW,CAAC,CAAC;IAC3C,IAAA,eAAK,EAAC,yBAAyB,EAAE,CAAC,YAAY,CAAC,CAAC;GACpC,SAAS,CAuBrB"}
@@ -0,0 +1,14 @@
1
+ import { EntityBase } from '../base/_base';
2
+ import { IntelCase } from './intel-case.entity';
3
+ import { NoteType, ClassificationLevel } from './enums';
4
+ export declare class CaseNote extends EntityBase {
5
+ case: IntelCase;
6
+ caseId?: string;
7
+ content: string;
8
+ noteType: NoteType;
9
+ classificationLevel: ClassificationLevel;
10
+ attachments?: Record<string, any>[];
11
+ isRedacted: boolean;
12
+ metadata?: Record<string, any>;
13
+ }
14
+ //# sourceMappingURL=case-note.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case-note.entity.d.ts","sourceRoot":"","sources":["../../../src/entities/cases/case-note.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAExD,qBAIa,QAAS,SAAQ,UAAU;IAGtC,IAAI,EAAG,SAAS,CAAC;IAGjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,OAAO,EAAG,MAAM,CAAC;IAGjB,QAAQ,EAAG,QAAQ,CAAC;IAMpB,mBAAmB,EAAG,mBAAmB,CAAC;IAG1C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IAGpC,UAAU,EAAG,OAAO,CAAC;IAGrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CaseNote = void 0;
13
+ const _base_1 = require("../base/_base");
14
+ const typeorm_1 = require("typeorm");
15
+ const intel_case_entity_1 = require("./intel-case.entity");
16
+ const enums_1 = require("./enums");
17
+ let CaseNote = class CaseNote extends _base_1.EntityBase {
18
+ };
19
+ exports.CaseNote = CaseNote;
20
+ __decorate([
21
+ (0, typeorm_1.ManyToOne)(() => intel_case_entity_1.IntelCase, (c) => c.notes, { onDelete: 'CASCADE' }),
22
+ (0, typeorm_1.JoinColumn)({ name: 'case_id' }),
23
+ __metadata("design:type", intel_case_entity_1.IntelCase)
24
+ ], CaseNote.prototype, "case", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true, name: 'case_id' }),
27
+ __metadata("design:type", String)
28
+ ], CaseNote.prototype, "caseId", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ type: 'text' }),
31
+ __metadata("design:type", String)
32
+ ], CaseNote.prototype, "content", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ type: 'enum', enum: enums_1.NoteType, name: 'note_type', default: enums_1.NoteType.OPERACIONAL }),
35
+ __metadata("design:type", String)
36
+ ], CaseNote.prototype, "noteType", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({
39
+ type: 'enum', enum: enums_1.ClassificationLevel,
40
+ name: 'classification_level', default: enums_1.ClassificationLevel.CONFIDENCIAL,
41
+ }),
42
+ __metadata("design:type", String)
43
+ ], CaseNote.prototype, "classificationLevel", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
46
+ __metadata("design:type", Array)
47
+ ], CaseNote.prototype, "attachments", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ type: 'boolean', default: false, name: 'is_redacted' }),
50
+ __metadata("design:type", Boolean)
51
+ ], CaseNote.prototype, "isRedacted", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
54
+ __metadata("design:type", Object)
55
+ ], CaseNote.prototype, "metadata", void 0);
56
+ exports.CaseNote = CaseNote = __decorate([
57
+ (0, typeorm_1.Entity)({ name: 'case_note', schema: 'cases' }),
58
+ (0, typeorm_1.Index)('case_note_case_idx', ['caseId']),
59
+ (0, typeorm_1.Index)('case_note_type_idx', ['noteType']),
60
+ (0, typeorm_1.Index)('case_note_tenant_idx', ['tenantId'])
61
+ ], CaseNote);
62
+ //# sourceMappingURL=case-note.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case-note.entity.js","sourceRoot":"","sources":["../../../src/entities/cases/case-note.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA2C;AAC3C,qCAAuE;AACvE,2DAAgD;AAChD,mCAAwD;AAMjD,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,kBAAU;CA4BvC,CAAA;AA5BY,4BAAQ;AAGnB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6BAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACnE,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8BACzB,6BAAS;sCAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCAC1C;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACR;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAQ,CAAC,WAAW,EAAE,CAAC;;0CACvE;AAMpB;IAJC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,2BAAmB;QACvC,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,2BAAmB,CAAC,YAAY;KACxE,CAAC;;qDACwC;AAG1C;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACN;AAGpC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;;4CAC5C;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACX;mBA3BpB,QAAQ;IAJpB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC9C,IAAA,eAAK,EAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAA,eAAK,EAAC,oBAAoB,EAAE,CAAC,UAAU,CAAC,CAAC;IACzC,IAAA,eAAK,EAAC,sBAAsB,EAAE,CAAC,UAAU,CAAC,CAAC;GAC/B,QAAQ,CA4BpB"}
@@ -0,0 +1,23 @@
1
+ import { EntityBase } from '../base/_base';
2
+ import { IntelCase } from './intel-case.entity';
3
+ import { User } from '../user.entity';
4
+ import { CaseUserRole, CasePermission } from './enums';
5
+ export declare class CaseRole extends EntityBase {
6
+ case: IntelCase;
7
+ caseId?: string;
8
+ user: User;
9
+ userId?: string;
10
+ role: CaseUserRole;
11
+ permissions: CasePermission[];
12
+ isActive: boolean;
13
+ assignedDate?: Date;
14
+ expiresDate?: Date;
15
+ assignedBy?: string;
16
+ notes?: string;
17
+ receiveNotifications: boolean;
18
+ metadata?: Record<string, any>;
19
+ setDefaults(): void;
20
+ private getDefaultPermissions;
21
+ hasPermission(permission: CasePermission): boolean;
22
+ }
23
+ //# sourceMappingURL=case-role.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case-role.entity.d.ts","sourceRoot":"","sources":["../../../src/entities/cases/case-role.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEvD,qBAIa,QAAS,SAAQ,UAAU;IAGtC,IAAI,EAAG,SAAS,CAAC;IAGjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,IAAI,EAAG,IAAI,CAAC;IAGZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,IAAI,EAAG,YAAY,CAAC;IAGpB,WAAW,EAAG,cAAc,EAAE,CAAC;IAG/B,QAAQ,EAAG,OAAO,CAAC;IAGnB,YAAY,CAAC,EAAE,IAAI,CAAC;IAGpB,WAAW,CAAC,EAAE,IAAI,CAAC;IAGnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,oBAAoB,EAAG,OAAO,CAAC;IAG/B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAI/B,WAAW;IAQX,OAAO,CAAC,qBAAqB;IA2B7B,aAAa,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO;CAKnD"}
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CaseRole = void 0;
13
+ const _base_1 = require("../base/_base");
14
+ const typeorm_1 = require("typeorm");
15
+ const intel_case_entity_1 = require("./intel-case.entity");
16
+ const user_entity_1 = require("../user.entity");
17
+ const enums_1 = require("./enums");
18
+ let CaseRole = class CaseRole extends _base_1.EntityBase {
19
+ setDefaults() {
20
+ if (!this.assignedDate)
21
+ this.assignedDate = new Date();
22
+ if (!this.permissions || this.permissions.length === 0) {
23
+ this.permissions = this.getDefaultPermissions();
24
+ }
25
+ if (this.expiresDate && new Date() > this.expiresDate)
26
+ this.isActive = false;
27
+ }
28
+ getDefaultPermissions() {
29
+ const map = {
30
+ [enums_1.CaseUserRole.DIRECTOR]: [
31
+ enums_1.CasePermission.VIEW, enums_1.CasePermission.EDIT, enums_1.CasePermission.DELETE,
32
+ enums_1.CasePermission.MANAGE_ASSETS, enums_1.CasePermission.MANAGE_SEARCHES,
33
+ enums_1.CasePermission.MANAGE_ROLES, enums_1.CasePermission.MANAGE_NOTES,
34
+ enums_1.CasePermission.EXPORT, enums_1.CasePermission.ADMIN,
35
+ ],
36
+ [enums_1.CaseUserRole.OPERADOR]: [
37
+ enums_1.CasePermission.VIEW, enums_1.CasePermission.EDIT,
38
+ enums_1.CasePermission.MANAGE_ASSETS, enums_1.CasePermission.MANAGE_SEARCHES,
39
+ enums_1.CasePermission.MANAGE_NOTES, enums_1.CasePermission.EXPORT,
40
+ ],
41
+ [enums_1.CaseUserRole.ANALISTA]: [
42
+ enums_1.CasePermission.VIEW, enums_1.CasePermission.MANAGE_SEARCHES,
43
+ enums_1.CasePermission.MANAGE_NOTES, enums_1.CasePermission.EXPORT,
44
+ ],
45
+ [enums_1.CaseUserRole.ENLACE]: [
46
+ enums_1.CasePermission.VIEW, enums_1.CasePermission.EDIT, enums_1.CasePermission.MANAGE_NOTES,
47
+ ],
48
+ [enums_1.CaseUserRole.AUDITOR]: [
49
+ enums_1.CasePermission.VIEW, enums_1.CasePermission.EXPORT,
50
+ ],
51
+ };
52
+ return map[this.role] || [];
53
+ }
54
+ hasPermission(permission) {
55
+ if (!this.isActive)
56
+ return false;
57
+ if (this.expiresDate && new Date() > this.expiresDate)
58
+ return false;
59
+ return this.permissions.includes(permission) || this.permissions.includes(enums_1.CasePermission.ADMIN);
60
+ }
61
+ };
62
+ exports.CaseRole = CaseRole;
63
+ __decorate([
64
+ (0, typeorm_1.ManyToOne)(() => intel_case_entity_1.IntelCase, (c) => c.roles, { onDelete: 'CASCADE' }),
65
+ (0, typeorm_1.JoinColumn)({ name: 'case_id' }),
66
+ __metadata("design:type", intel_case_entity_1.IntelCase)
67
+ ], CaseRole.prototype, "case", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true, name: 'case_id' }),
70
+ __metadata("design:type", String)
71
+ ], CaseRole.prototype, "caseId", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: 'CASCADE', eager: false }),
74
+ (0, typeorm_1.JoinColumn)({ name: 'user_id' }),
75
+ __metadata("design:type", user_entity_1.User)
76
+ ], CaseRole.prototype, "user", void 0);
77
+ __decorate([
78
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true, name: 'user_id' }),
79
+ __metadata("design:type", String)
80
+ ], CaseRole.prototype, "userId", void 0);
81
+ __decorate([
82
+ (0, typeorm_1.Column)({ type: 'enum', enum: enums_1.CaseUserRole }),
83
+ __metadata("design:type", String)
84
+ ], CaseRole.prototype, "role", void 0);
85
+ __decorate([
86
+ (0, typeorm_1.Column)({ type: 'jsonb', default: '[]' }),
87
+ __metadata("design:type", Array)
88
+ ], CaseRole.prototype, "permissions", void 0);
89
+ __decorate([
90
+ (0, typeorm_1.Column)({ type: 'boolean', default: true, name: 'is_active' }),
91
+ __metadata("design:type", Boolean)
92
+ ], CaseRole.prototype, "isActive", void 0);
93
+ __decorate([
94
+ (0, typeorm_1.Column)({ type: 'date', nullable: true, name: 'assigned_date' }),
95
+ __metadata("design:type", Date)
96
+ ], CaseRole.prototype, "assignedDate", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.Column)({ type: 'date', nullable: true, name: 'expires_date' }),
99
+ __metadata("design:type", Date)
100
+ ], CaseRole.prototype, "expiresDate", void 0);
101
+ __decorate([
102
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true, name: 'assigned_by' }),
103
+ __metadata("design:type", String)
104
+ ], CaseRole.prototype, "assignedBy", void 0);
105
+ __decorate([
106
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
107
+ __metadata("design:type", String)
108
+ ], CaseRole.prototype, "notes", void 0);
109
+ __decorate([
110
+ (0, typeorm_1.Column)({ type: 'boolean', default: true, name: 'receive_notifications' }),
111
+ __metadata("design:type", Boolean)
112
+ ], CaseRole.prototype, "receiveNotifications", void 0);
113
+ __decorate([
114
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
115
+ __metadata("design:type", Object)
116
+ ], CaseRole.prototype, "metadata", void 0);
117
+ __decorate([
118
+ (0, typeorm_1.BeforeInsert)(),
119
+ (0, typeorm_1.BeforeUpdate)(),
120
+ __metadata("design:type", Function),
121
+ __metadata("design:paramtypes", []),
122
+ __metadata("design:returntype", void 0)
123
+ ], CaseRole.prototype, "setDefaults", null);
124
+ exports.CaseRole = CaseRole = __decorate([
125
+ (0, typeorm_1.Entity)({ name: 'case_role', schema: 'cases' }),
126
+ (0, typeorm_1.Index)('case_role_case_user_idx', ['caseId', 'userId'], { unique: true }),
127
+ (0, typeorm_1.Index)('case_role_case_idx', ['caseId']),
128
+ (0, typeorm_1.Index)('case_role_user_idx', ['userId'])
129
+ ], CaseRole);
130
+ //# sourceMappingURL=case-role.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case-role.entity.js","sourceRoot":"","sources":["../../../src/entities/cases/case-role.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA2C;AAC3C,qCAAmG;AACnG,2DAAgD;AAChD,gDAAsC;AACtC,mCAAuD;AAMhD,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ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,MAAM,EAAE,OAAO,EAAE,CAAC;IAC9C,IAAA,eAAK,EAAC,yBAAyB,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACxE,IAAA,eAAK,EAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAA,eAAK,EAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC,CAAC;GAC3B,QAAQ,CAoFpB"}
@@ -0,0 +1,22 @@
1
+ import { EntityBase } from '../base/_base';
2
+ import { IntelCase } from './intel-case.entity';
3
+ import { CaseSearchType, CaseSearchStatus } from './enums';
4
+ export declare class CaseSearch extends EntityBase {
5
+ case: IntelCase;
6
+ caseId?: string;
7
+ searchType: CaseSearchType;
8
+ status: CaseSearchStatus;
9
+ query: string;
10
+ searchParams?: Record<string, any>;
11
+ results?: Record<string, any>[];
12
+ resultsCount: number;
13
+ linkedAssetsCount: number;
14
+ searchDate: Date;
15
+ executionTimeMs?: number;
16
+ performedBy?: string;
17
+ errorMessage?: string;
18
+ notes?: string;
19
+ metadata?: Record<string, any>;
20
+ setDefaults(): void;
21
+ }
22
+ //# sourceMappingURL=case-search.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case-search.entity.d.ts","sourceRoot":"","sources":["../../../src/entities/cases/case-search.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3D,qBAKa,UAAW,SAAQ,UAAU;IAGxC,IAAI,EAAG,SAAS,CAAC;IAGjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,UAAU,EAAG,cAAc,CAAC;IAG5B,MAAM,EAAG,gBAAgB,CAAC;IAG1B,KAAK,EAAG,MAAM,CAAC;IAGf,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAGnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IAGhC,YAAY,EAAG,MAAM,CAAC;IAGtB,iBAAiB,EAAG,MAAM,CAAC;IAG3B,UAAU,EAAG,IAAI,CAAC;IAGlB,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAG/B,WAAW;CAIZ"}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CaseSearch = void 0;
13
+ const _base_1 = require("../base/_base");
14
+ const typeorm_1 = require("typeorm");
15
+ const intel_case_entity_1 = require("./intel-case.entity");
16
+ const enums_1 = require("./enums");
17
+ let CaseSearch = class CaseSearch extends _base_1.EntityBase {
18
+ setDefaults() {
19
+ if (!this.searchDate)
20
+ this.searchDate = new Date();
21
+ if (!this.performedBy && this.createdBy?.id)
22
+ this.performedBy = this.createdBy.id;
23
+ }
24
+ };
25
+ exports.CaseSearch = CaseSearch;
26
+ __decorate([
27
+ (0, typeorm_1.ManyToOne)(() => intel_case_entity_1.IntelCase, (c) => c.searches, { onDelete: 'CASCADE' }),
28
+ (0, typeorm_1.JoinColumn)({ name: 'case_id' }),
29
+ __metadata("design:type", intel_case_entity_1.IntelCase)
30
+ ], CaseSearch.prototype, "case", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.Column)({ type: 'uuid', nullable: true, name: 'case_id' }),
33
+ __metadata("design:type", String)
34
+ ], CaseSearch.prototype, "caseId", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({ type: 'enum', enum: enums_1.CaseSearchType, name: 'search_type' }),
37
+ __metadata("design:type", String)
38
+ ], CaseSearch.prototype, "searchType", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ type: 'enum', enum: enums_1.CaseSearchStatus, default: enums_1.CaseSearchStatus.COMPLETED }),
41
+ __metadata("design:type", String)
42
+ ], CaseSearch.prototype, "status", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ type: 'varchar', length: 500 }),
45
+ __metadata("design:type", String)
46
+ ], CaseSearch.prototype, "query", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true, name: 'search_params' }),
49
+ __metadata("design:type", Object)
50
+ ], CaseSearch.prototype, "searchParams", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
53
+ __metadata("design:type", Array)
54
+ ], CaseSearch.prototype, "results", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.Column)({ type: 'int', default: 0, name: 'results_count' }),
57
+ __metadata("design:type", Number)
58
+ ], CaseSearch.prototype, "resultsCount", void 0);
59
+ __decorate([
60
+ (0, typeorm_1.Column)({ type: 'int', default: 0, name: 'linked_assets_count' }),
61
+ __metadata("design:type", Number)
62
+ ], CaseSearch.prototype, "linkedAssetsCount", void 0);
63
+ __decorate([
64
+ (0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP', name: 'search_date' }),
65
+ __metadata("design:type", Date)
66
+ ], CaseSearch.prototype, "searchDate", void 0);
67
+ __decorate([
68
+ (0, typeorm_1.Column)({ type: 'int', nullable: true, name: 'execution_time_ms' }),
69
+ __metadata("design:type", Number)
70
+ ], CaseSearch.prototype, "executionTimeMs", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true, name: 'performed_by' }),
73
+ __metadata("design:type", String)
74
+ ], CaseSearch.prototype, "performedBy", void 0);
75
+ __decorate([
76
+ (0, typeorm_1.Column)({ type: 'text', nullable: true, name: 'error_message' }),
77
+ __metadata("design:type", String)
78
+ ], CaseSearch.prototype, "errorMessage", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
81
+ __metadata("design:type", String)
82
+ ], CaseSearch.prototype, "notes", void 0);
83
+ __decorate([
84
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
85
+ __metadata("design:type", Object)
86
+ ], CaseSearch.prototype, "metadata", void 0);
87
+ __decorate([
88
+ (0, typeorm_1.BeforeInsert)(),
89
+ __metadata("design:type", Function),
90
+ __metadata("design:paramtypes", []),
91
+ __metadata("design:returntype", void 0)
92
+ ], CaseSearch.prototype, "setDefaults", null);
93
+ exports.CaseSearch = CaseSearch = __decorate([
94
+ (0, typeorm_1.Entity)({ name: 'case_search', schema: 'cases' }),
95
+ (0, typeorm_1.Index)('case_search_case_idx', ['caseId']),
96
+ (0, typeorm_1.Index)('case_search_type_idx', ['searchType']),
97
+ (0, typeorm_1.Index)('case_search_tenant_idx', ['tenantId']),
98
+ (0, typeorm_1.Index)('case_search_date_idx', ['searchDate'])
99
+ ], CaseSearch);
100
+ //# sourceMappingURL=case-search.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case-search.entity.js","sourceRoot":"","sources":["../../../src/entities/cases/case-search.entity.ts"],"names":[],"mappings":";;;;;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