@attraccess/database-entities 1.5.2 → 1.8.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 (73) hide show
  1. package/LICENSE.md +46 -0
  2. package/package.json +3 -3
  3. package/src/lib/entities/attractapCrashReport.entity.d.ts +20 -0
  4. package/src/lib/entities/attractapCrashReport.entity.js +153 -0
  5. package/src/lib/entities/attractapCrashReport.entity.js.map +1 -0
  6. package/src/lib/entities/conversation-participant.entity.d.ts +11 -0
  7. package/src/lib/entities/conversation-participant.entity.js +61 -0
  8. package/src/lib/entities/conversation-participant.entity.js.map +1 -0
  9. package/src/lib/entities/conversation.entity.d.ts +5 -0
  10. package/src/lib/entities/conversation.entity.js +34 -0
  11. package/src/lib/entities/conversation.entity.js.map +1 -0
  12. package/src/lib/entities/email-template.entity.d.ts +9 -1
  13. package/src/lib/entities/email-template.entity.js +8 -1
  14. package/src/lib/entities/email-template.entity.js.map +1 -1
  15. package/src/lib/entities/message.entity.d.ts +19 -0
  16. package/src/lib/entities/message.entity.js +99 -0
  17. package/src/lib/entities/message.entity.js.map +1 -0
  18. package/src/lib/entities/notification-preference.entity.d.ts +9 -0
  19. package/src/lib/entities/notification-preference.entity.js +58 -0
  20. package/src/lib/entities/notification-preference.entity.js.map +1 -0
  21. package/src/lib/entities/password-history.entity.d.ts +8 -0
  22. package/src/lib/entities/password-history.entity.js +44 -0
  23. package/src/lib/entities/password-history.entity.js.map +1 -0
  24. package/src/lib/entities/password-policy-audit.entity.d.ts +19 -0
  25. package/src/lib/entities/password-policy-audit.entity.js +83 -0
  26. package/src/lib/entities/password-policy-audit.entity.js.map +1 -0
  27. package/src/lib/entities/password-policy-override.entity.d.ts +22 -0
  28. package/src/lib/entities/password-policy-override.entity.js +100 -0
  29. package/src/lib/entities/password-policy-override.entity.js.map +1 -0
  30. package/src/lib/entities/password-policy.entity.d.ts +19 -0
  31. package/src/lib/entities/password-policy.entity.js +94 -0
  32. package/src/lib/entities/password-policy.entity.js.map +1 -0
  33. package/src/lib/entities/push-subscription.entity.d.ts +12 -0
  34. package/src/lib/entities/push-subscription.entity.js +72 -0
  35. package/src/lib/entities/push-subscription.entity.js.map +1 -0
  36. package/src/lib/entities/resource-maintenance-request.entity.d.ts +21 -0
  37. package/src/lib/entities/resource-maintenance-request.entity.js +113 -0
  38. package/src/lib/entities/resource-maintenance-request.entity.js.map +1 -0
  39. package/src/lib/entities/resource.entity.d.ts +11 -0
  40. package/src/lib/entities/resource.entity.js +93 -0
  41. package/src/lib/entities/resource.entity.js.map +1 -1
  42. package/src/lib/entities/resource.supervision.d.ts +20 -0
  43. package/src/lib/entities/resource.supervision.js +26 -0
  44. package/src/lib/entities/resource.supervision.js.map +1 -0
  45. package/src/lib/entities/resourceFlowNode.d.ts +60 -1
  46. package/src/lib/entities/resourceFlowNode.js +72 -3
  47. package/src/lib/entities/resourceFlowNode.js.map +1 -1
  48. package/src/lib/entities/resourceFlowVariable.d.ts +17 -0
  49. package/src/lib/entities/resourceFlowVariable.js +66 -0
  50. package/src/lib/entities/resourceFlowVariable.js.map +1 -0
  51. package/src/lib/entities/resourceGroup.entity.d.ts +4 -0
  52. package/src/lib/entities/resourceGroup.entity.js +38 -0
  53. package/src/lib/entities/resourceGroup.entity.js.map +1 -1
  54. package/src/lib/entities/resourceHealthState.entity.d.ts +22 -0
  55. package/src/lib/entities/resourceHealthState.entity.js +114 -0
  56. package/src/lib/entities/resourceHealthState.entity.js.map +1 -0
  57. package/src/lib/entities/resourceIntroducer.entity.d.ts +5 -0
  58. package/src/lib/entities/resourceIntroducer.entity.js +20 -1
  59. package/src/lib/entities/resourceIntroducer.entity.js.map +1 -1
  60. package/src/lib/entities/resourceIntroduction.entity.d.ts +1 -0
  61. package/src/lib/entities/resourceIntroduction.entity.js +10 -0
  62. package/src/lib/entities/resourceIntroduction.entity.js.map +1 -1
  63. package/src/lib/entities/resourceUsage.entity.d.ts +2 -0
  64. package/src/lib/entities/resourceUsage.entity.js +20 -0
  65. package/src/lib/entities/resourceUsage.entity.js.map +1 -1
  66. package/src/lib/entities/ssoProvider.oidc.js +2 -2
  67. package/src/lib/entities/ssoProvider.oidc.js.map +1 -1
  68. package/src/lib/entities/user.entity.d.ts +3 -0
  69. package/src/lib/entities/user.entity.js +15 -0
  70. package/src/lib/entities/user.entity.js.map +1 -1
  71. package/src/lib/entities-index.d.ts +30 -3
  72. package/src/lib/entities-index.js +61 -2
  73. package/src/lib/entities-index.js.map +1 -1
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PasswordHistory = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const swagger_1 = require("@nestjs/swagger");
7
+ const class_transformer_1 = require("class-transformer");
8
+ const user_entity_1 = require("./user.entity");
9
+ let PasswordHistory = class PasswordHistory {
10
+ };
11
+ exports.PasswordHistory = PasswordHistory;
12
+ tslib_1.__decorate([
13
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
14
+ (0, swagger_1.ApiProperty)({ description: 'Primary identifier', example: 1 }),
15
+ tslib_1.__metadata("design:type", Number)
16
+ ], PasswordHistory.prototype, "id", void 0);
17
+ tslib_1.__decorate([
18
+ (0, typeorm_1.Column)({ type: 'integer' }),
19
+ (0, swagger_1.ApiProperty)({ description: 'Owning user id', example: 1 }),
20
+ tslib_1.__metadata("design:type", Number)
21
+ ], PasswordHistory.prototype, "userId", void 0);
22
+ tslib_1.__decorate([
23
+ (0, typeorm_1.Column)({ type: 'text' }),
24
+ (0, class_transformer_1.Exclude)(),
25
+ (0, swagger_1.ApiProperty)({ description: 'Bcrypt hash of a previously used password', required: false }),
26
+ tslib_1.__metadata("design:type", String)
27
+ ], PasswordHistory.prototype, "passwordHash", void 0);
28
+ tslib_1.__decorate([
29
+ (0, typeorm_1.CreateDateColumn)(),
30
+ (0, swagger_1.ApiProperty)({ description: 'When this entry was recorded' }),
31
+ tslib_1.__metadata("design:type", Date)
32
+ ], PasswordHistory.prototype, "createdAt", void 0);
33
+ tslib_1.__decorate([
34
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, {
35
+ onDelete: 'CASCADE',
36
+ }),
37
+ (0, typeorm_1.JoinColumn)({ name: 'userId' }),
38
+ tslib_1.__metadata("design:type", user_entity_1.User)
39
+ ], PasswordHistory.prototype, "user", void 0);
40
+ exports.PasswordHistory = PasswordHistory = tslib_1.__decorate([
41
+ (0, typeorm_1.Entity)(),
42
+ (0, typeorm_1.Index)(['userId', 'createdAt'])
43
+ ], PasswordHistory);
44
+ //# sourceMappingURL=password-history.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password-history.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/password-history.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAAiH;AACjH,6CAA8C;AAC9C,yDAA4C;AAC5C,+CAAqC;AAI9B,IAAM,eAAe,GAArB,MAAM,eAAe;CAuB3B,CAAA;AAvBY,0CAAe;AAG1B;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;2CACnD;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+CAC3C;AAKhB;IAHC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACxB,IAAA,2BAAO,GAAE;IACT,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qDACrE;AAItB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;sCACjD,IAAI;kDAAC;AAMjB;IAJC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE;QACrB,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;sCACxB,kBAAI;6CAAC;0BAtBD,eAAe;IAF3B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;GAClB,eAAe,CAuB3B"}
@@ -0,0 +1,19 @@
1
+ export declare enum PasswordPolicyAuditEvent {
2
+ GLOBAL_POLICY_UPDATED = "global_policy_updated",
3
+ OVERRIDE_UPSERTED = "override_upserted",
4
+ OVERRIDE_DELETED = "override_deleted"
5
+ }
6
+ export declare class PasswordPolicyAudit {
7
+ id: number;
8
+ at: Date;
9
+ event: PasswordPolicyAuditEvent;
10
+ actorId: number | null;
11
+ actorUsername: string | null;
12
+ ip: string | null;
13
+ userAgent: string | null;
14
+ requestId: string | null;
15
+ role: string | null;
16
+ before: string | null;
17
+ after: string | null;
18
+ changedFields: string | null;
19
+ }
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ // Append-only audit log for password policy admin mutations (global PATCH + per-role override CRUD)
3
+ // FEATURE: Password policy admin audit trail (DB-backed, queryable, retains actor + before/after diff)
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.PasswordPolicyAudit = exports.PasswordPolicyAuditEvent = void 0;
6
+ const tslib_1 = require("tslib");
7
+ const typeorm_1 = require("typeorm");
8
+ const swagger_1 = require("@nestjs/swagger");
9
+ var PasswordPolicyAuditEvent;
10
+ (function (PasswordPolicyAuditEvent) {
11
+ PasswordPolicyAuditEvent["GLOBAL_POLICY_UPDATED"] = "global_policy_updated";
12
+ PasswordPolicyAuditEvent["OVERRIDE_UPSERTED"] = "override_upserted";
13
+ PasswordPolicyAuditEvent["OVERRIDE_DELETED"] = "override_deleted";
14
+ })(PasswordPolicyAuditEvent || (exports.PasswordPolicyAuditEvent = PasswordPolicyAuditEvent = {}));
15
+ let PasswordPolicyAudit = class PasswordPolicyAudit {
16
+ };
17
+ exports.PasswordPolicyAudit = PasswordPolicyAudit;
18
+ tslib_1.__decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
20
+ (0, swagger_1.ApiProperty)({ description: 'Auto-incremented audit row id', example: 42 }),
21
+ tslib_1.__metadata("design:type", Number)
22
+ ], PasswordPolicyAudit.prototype, "id", void 0);
23
+ tslib_1.__decorate([
24
+ (0, typeorm_1.Index)(),
25
+ (0, typeorm_1.CreateDateColumn)(),
26
+ (0, swagger_1.ApiProperty)({ description: 'When the audited mutation happened' }),
27
+ tslib_1.__metadata("design:type", Date)
28
+ ], PasswordPolicyAudit.prototype, "at", void 0);
29
+ tslib_1.__decorate([
30
+ (0, typeorm_1.Column)({ type: 'varchar', length: 64 }),
31
+ (0, swagger_1.ApiProperty)({ description: 'Which mutation was performed', enum: PasswordPolicyAuditEvent, enumName: 'PasswordPolicyAuditEvent' }),
32
+ tslib_1.__metadata("design:type", String)
33
+ ], PasswordPolicyAudit.prototype, "event", void 0);
34
+ tslib_1.__decorate([
35
+ (0, typeorm_1.Index)(),
36
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
37
+ (0, swagger_1.ApiProperty)({ description: 'User id of the admin who performed the change', nullable: true, example: 1 }),
38
+ tslib_1.__metadata("design:type", Number)
39
+ ], PasswordPolicyAudit.prototype, "actorId", void 0);
40
+ tslib_1.__decorate([
41
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
42
+ (0, swagger_1.ApiProperty)({ description: 'Username snapshot at the time of the change', nullable: true, example: 'root' }),
43
+ tslib_1.__metadata("design:type", String)
44
+ ], PasswordPolicyAudit.prototype, "actorUsername", void 0);
45
+ tslib_1.__decorate([
46
+ (0, typeorm_1.Column)({ type: 'varchar', length: 45, nullable: true }),
47
+ (0, swagger_1.ApiProperty)({ description: 'Source IP address of the admin request', nullable: true, example: '203.0.113.4' }),
48
+ tslib_1.__metadata("design:type", String)
49
+ ], PasswordPolicyAudit.prototype, "ip", void 0);
50
+ tslib_1.__decorate([
51
+ (0, typeorm_1.Column)({ type: 'varchar', length: 512, nullable: true }),
52
+ (0, swagger_1.ApiProperty)({ description: 'User-agent of the admin request', nullable: true }),
53
+ tslib_1.__metadata("design:type", String)
54
+ ], PasswordPolicyAudit.prototype, "userAgent", void 0);
55
+ tslib_1.__decorate([
56
+ (0, typeorm_1.Column)({ type: 'varchar', length: 128, nullable: true }),
57
+ (0, swagger_1.ApiProperty)({ description: 'Optional request id for tracing', nullable: true }),
58
+ tslib_1.__metadata("design:type", String)
59
+ ], PasswordPolicyAudit.prototype, "requestId", void 0);
60
+ tslib_1.__decorate([
61
+ (0, typeorm_1.Column)({ type: 'varchar', length: 64, nullable: true }),
62
+ (0, swagger_1.ApiProperty)({ description: 'Role the change applied to (only set for override events)', nullable: true }),
63
+ tslib_1.__metadata("design:type", String)
64
+ ], PasswordPolicyAudit.prototype, "role", void 0);
65
+ tslib_1.__decorate([
66
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
67
+ (0, swagger_1.ApiProperty)({ description: 'JSON-encoded snapshot of the row before the change', nullable: true }),
68
+ tslib_1.__metadata("design:type", String)
69
+ ], PasswordPolicyAudit.prototype, "before", void 0);
70
+ tslib_1.__decorate([
71
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
72
+ (0, swagger_1.ApiProperty)({ description: 'JSON-encoded snapshot of the row after the change', nullable: true }),
73
+ tslib_1.__metadata("design:type", String)
74
+ ], PasswordPolicyAudit.prototype, "after", void 0);
75
+ tslib_1.__decorate([
76
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
77
+ (0, swagger_1.ApiProperty)({ description: 'JSON array of field names that changed', nullable: true }),
78
+ tslib_1.__metadata("design:type", String)
79
+ ], PasswordPolicyAudit.prototype, "changedFields", void 0);
80
+ exports.PasswordPolicyAudit = PasswordPolicyAudit = tslib_1.__decorate([
81
+ (0, typeorm_1.Entity)()
82
+ ], PasswordPolicyAudit);
83
+ //# sourceMappingURL=password-policy-audit.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password-policy-audit.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/password-policy-audit.entity.ts"],"names":[],"mappings":";AAAA,oGAAoG;AACpG,uGAAuG;;;;AAEvG,qCAA0F;AAC1F,6CAA8C;AAE9C,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,2EAA+C,CAAA;IAC/C,mEAAuC,CAAA;IACvC,iEAAqC,CAAA;AACvC,CAAC,EAJW,wBAAwB,wCAAxB,wBAAwB,QAInC;AAGM,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAkD/B,CAAA;AAlDY,kDAAmB;AAG9B;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;+CAC/D;AAKZ;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;sCAC9D,IAAI;+CAAC;AAIV;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACvC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,8BAA8B,EAAE,IAAI,EAAE,wBAAwB,EAAE,QAAQ,EAAE,0BAA0B,EAAE,CAAC;;kDAClG;AAKjC;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,+CAA+C,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oD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AAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oDAAoD,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDAC5E;AAIvB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACxC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mDAAmD,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC5E;AAItB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACxC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,wCAAwC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACzD;8BAjDnB,mBAAmB;IAD/B,IAAA,gBAAM,GAAE;GACI,mBAAmB,CAkD/B"}
@@ -0,0 +1,22 @@
1
+ export declare enum PasswordPolicyRole {
2
+ ADMIN = "admin"
3
+ }
4
+ export declare const PASSWORD_POLICY_ROLES: PasswordPolicyRole[];
5
+ export declare class PasswordPolicyOverride {
6
+ role: PasswordPolicyRole;
7
+ minLength: number | null;
8
+ maxLength: number | null;
9
+ allowAllUnicode: boolean | null;
10
+ requireUppercase: boolean | null;
11
+ requireLowercase: boolean | null;
12
+ requireDigit: boolean | null;
13
+ requireSpecial: boolean | null;
14
+ checkHIBP: boolean | null;
15
+ checkCommonPasswords: boolean | null;
16
+ minZxcvbnScore: number | null;
17
+ historySize: number | null;
18
+ rotationDays: number | null;
19
+ createdAt: Date;
20
+ updatedAt: Date;
21
+ version: number;
22
+ }
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ // Per-role password policy override; nullable columns inherit from global singleton policy
3
+ // FEATURE: Password policy per-role overrides (admin only; machine/api-token are future slices)
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.PasswordPolicyOverride = exports.PASSWORD_POLICY_ROLES = exports.PasswordPolicyRole = void 0;
6
+ const tslib_1 = require("tslib");
7
+ const typeorm_1 = require("typeorm");
8
+ const swagger_1 = require("@nestjs/swagger");
9
+ var PasswordPolicyRole;
10
+ (function (PasswordPolicyRole) {
11
+ PasswordPolicyRole["ADMIN"] = "admin";
12
+ })(PasswordPolicyRole || (exports.PasswordPolicyRole = PasswordPolicyRole = {}));
13
+ exports.PASSWORD_POLICY_ROLES = [PasswordPolicyRole.ADMIN];
14
+ let PasswordPolicyOverride = class PasswordPolicyOverride {
15
+ };
16
+ exports.PasswordPolicyOverride = PasswordPolicyOverride;
17
+ tslib_1.__decorate([
18
+ (0, typeorm_1.PrimaryColumn)({ type: 'simple-enum', enum: PasswordPolicyRole }),
19
+ (0, swagger_1.ApiProperty)({ description: 'Role this override applies to', enum: PasswordPolicyRole, enumName: 'PasswordPolicyRole' }),
20
+ tslib_1.__metadata("design:type", String)
21
+ ], PasswordPolicyOverride.prototype, "role", void 0);
22
+ tslib_1.__decorate([
23
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
24
+ (0, swagger_1.ApiProperty)({ description: 'Override minimum password length', example: 16, nullable: true, required: false }),
25
+ tslib_1.__metadata("design:type", Number)
26
+ ], PasswordPolicyOverride.prototype, "minLength", void 0);
27
+ tslib_1.__decorate([
28
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
29
+ (0, swagger_1.ApiProperty)({ description: 'Override maximum password length', example: 256, nullable: true, required: false }),
30
+ tslib_1.__metadata("design:type", Number)
31
+ ], PasswordPolicyOverride.prototype, "maxLength", void 0);
32
+ tslib_1.__decorate([
33
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
34
+ (0, swagger_1.ApiProperty)({ description: 'Override allow-all-unicode flag', nullable: true, required: false }),
35
+ tslib_1.__metadata("design:type", Boolean)
36
+ ], PasswordPolicyOverride.prototype, "allowAllUnicode", void 0);
37
+ tslib_1.__decorate([
38
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
39
+ (0, swagger_1.ApiProperty)({ description: 'Override require-uppercase flag', nullable: true, required: false }),
40
+ tslib_1.__metadata("design:type", Boolean)
41
+ ], PasswordPolicyOverride.prototype, "requireUppercase", void 0);
42
+ tslib_1.__decorate([
43
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
44
+ (0, swagger_1.ApiProperty)({ description: 'Override require-lowercase flag', nullable: true, required: false }),
45
+ tslib_1.__metadata("design:type", Boolean)
46
+ ], PasswordPolicyOverride.prototype, "requireLowercase", void 0);
47
+ tslib_1.__decorate([
48
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
49
+ (0, swagger_1.ApiProperty)({ description: 'Override require-digit flag', nullable: true, required: false }),
50
+ tslib_1.__metadata("design:type", Boolean)
51
+ ], PasswordPolicyOverride.prototype, "requireDigit", void 0);
52
+ tslib_1.__decorate([
53
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
54
+ (0, swagger_1.ApiProperty)({ description: 'Override require-special flag', nullable: true, required: false }),
55
+ tslib_1.__metadata("design:type", Boolean)
56
+ ], PasswordPolicyOverride.prototype, "requireSpecial", void 0);
57
+ tslib_1.__decorate([
58
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
59
+ (0, swagger_1.ApiProperty)({ description: 'Override HIBP breach check flag', nullable: true, required: false }),
60
+ tslib_1.__metadata("design:type", Boolean)
61
+ ], PasswordPolicyOverride.prototype, "checkHIBP", void 0);
62
+ tslib_1.__decorate([
63
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
64
+ (0, swagger_1.ApiProperty)({ description: 'Override common-password rejection flag', nullable: true, required: false }),
65
+ tslib_1.__metadata("design:type", Boolean)
66
+ ], PasswordPolicyOverride.prototype, "checkCommonPasswords", void 0);
67
+ tslib_1.__decorate([
68
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
69
+ (0, swagger_1.ApiProperty)({ description: 'Override minimum zxcvbn score (0-4)', example: 4, nullable: true, required: false }),
70
+ tslib_1.__metadata("design:type", Number)
71
+ ], PasswordPolicyOverride.prototype, "minZxcvbnScore", void 0);
72
+ tslib_1.__decorate([
73
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
74
+ (0, swagger_1.ApiProperty)({ description: 'Override password history size', example: 5, nullable: true, required: false }),
75
+ tslib_1.__metadata("design:type", Number)
76
+ ], PasswordPolicyOverride.prototype, "historySize", void 0);
77
+ tslib_1.__decorate([
78
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
79
+ (0, swagger_1.ApiProperty)({ description: 'Override forced rotation interval in days', example: 90, nullable: true, required: false }),
80
+ tslib_1.__metadata("design:type", Number)
81
+ ], PasswordPolicyOverride.prototype, "rotationDays", void 0);
82
+ tslib_1.__decorate([
83
+ (0, typeorm_1.CreateDateColumn)(),
84
+ (0, swagger_1.ApiProperty)({ description: 'When the override row was created' }),
85
+ tslib_1.__metadata("design:type", Date)
86
+ ], PasswordPolicyOverride.prototype, "createdAt", void 0);
87
+ tslib_1.__decorate([
88
+ (0, typeorm_1.UpdateDateColumn)(),
89
+ (0, swagger_1.ApiProperty)({ description: 'When the override row was last updated' }),
90
+ tslib_1.__metadata("design:type", Date)
91
+ ], PasswordPolicyOverride.prototype, "updatedAt", void 0);
92
+ tslib_1.__decorate([
93
+ (0, typeorm_1.VersionColumn)(),
94
+ (0, swagger_1.ApiProperty)({ description: 'Row version for optimistic concurrency control', example: 1 }),
95
+ tslib_1.__metadata("design:type", Number)
96
+ ], PasswordPolicyOverride.prototype, "version", void 0);
97
+ exports.PasswordPolicyOverride = PasswordPolicyOverride = tslib_1.__decorate([
98
+ (0, typeorm_1.Entity)()
99
+ ], PasswordPolicyOverride);
100
+ //# sourceMappingURL=password-policy-override.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password-policy-override.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/password-policy-override.entity.ts"],"names":[],"mappings":";AAAA,2FAA2F;AAC3F,gGAAgG;;;;AAEhG,qCAA2G;AAC3G,6CAA8C;AAE9C,I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+ export declare class PasswordPolicy {
3
+ id: number;
4
+ minLength: number;
5
+ maxLength: number;
6
+ allowAllUnicode: boolean;
7
+ requireUppercase: boolean;
8
+ requireLowercase: boolean;
9
+ requireDigit: boolean;
10
+ requireSpecial: boolean;
11
+ checkHIBP: boolean;
12
+ checkCommonPasswords: boolean;
13
+ minZxcvbnScore: number;
14
+ historySize: number;
15
+ rotationDays: number;
16
+ createdAt: Date;
17
+ updatedAt: Date;
18
+ version: number;
19
+ }
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PasswordPolicy = exports.PASSWORD_POLICY_SINGLETON_ID = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const swagger_1 = require("@nestjs/swagger");
7
+ exports.PASSWORD_POLICY_SINGLETON_ID = 1;
8
+ let PasswordPolicy = class PasswordPolicy {
9
+ };
10
+ exports.PasswordPolicy = PasswordPolicy;
11
+ tslib_1.__decorate([
12
+ (0, typeorm_1.PrimaryColumn)({ type: 'integer' }),
13
+ (0, swagger_1.ApiProperty)({ description: 'Singleton row identifier', example: exports.PASSWORD_POLICY_SINGLETON_ID }),
14
+ tslib_1.__metadata("design:type", Number)
15
+ ], PasswordPolicy.prototype, "id", void 0);
16
+ tslib_1.__decorate([
17
+ (0, typeorm_1.Column)({ type: 'integer', default: 12 }),
18
+ (0, swagger_1.ApiProperty)({ description: 'Minimum allowed password length', example: 12 }),
19
+ tslib_1.__metadata("design:type", Number)
20
+ ], PasswordPolicy.prototype, "minLength", void 0);
21
+ tslib_1.__decorate([
22
+ (0, typeorm_1.Column)({ type: 'integer', default: 128 }),
23
+ (0, swagger_1.ApiProperty)({ description: 'Maximum allowed password length', example: 128 }),
24
+ tslib_1.__metadata("design:type", Number)
25
+ ], PasswordPolicy.prototype, "maxLength", void 0);
26
+ tslib_1.__decorate([
27
+ (0, typeorm_1.Column)({ type: 'boolean', default: true }),
28
+ (0, swagger_1.ApiProperty)({ description: 'Whether all Unicode characters are allowed', example: true }),
29
+ tslib_1.__metadata("design:type", Boolean)
30
+ ], PasswordPolicy.prototype, "allowAllUnicode", void 0);
31
+ tslib_1.__decorate([
32
+ (0, typeorm_1.Column)({ type: 'boolean', default: false }),
33
+ (0, swagger_1.ApiProperty)({ description: 'Whether at least one uppercase letter is required', example: false }),
34
+ tslib_1.__metadata("design:type", Boolean)
35
+ ], PasswordPolicy.prototype, "requireUppercase", void 0);
36
+ tslib_1.__decorate([
37
+ (0, typeorm_1.Column)({ type: 'boolean', default: false }),
38
+ (0, swagger_1.ApiProperty)({ description: 'Whether at least one lowercase letter is required', example: false }),
39
+ tslib_1.__metadata("design:type", Boolean)
40
+ ], PasswordPolicy.prototype, "requireLowercase", void 0);
41
+ tslib_1.__decorate([
42
+ (0, typeorm_1.Column)({ type: 'boolean', default: false }),
43
+ (0, swagger_1.ApiProperty)({ description: 'Whether at least one digit is required', example: false }),
44
+ tslib_1.__metadata("design:type", Boolean)
45
+ ], PasswordPolicy.prototype, "requireDigit", void 0);
46
+ tslib_1.__decorate([
47
+ (0, typeorm_1.Column)({ type: 'boolean', default: false }),
48
+ (0, swagger_1.ApiProperty)({ description: 'Whether at least one special character is required', example: false }),
49
+ tslib_1.__metadata("design:type", Boolean)
50
+ ], PasswordPolicy.prototype, "requireSpecial", void 0);
51
+ tslib_1.__decorate([
52
+ (0, typeorm_1.Column)({ type: 'boolean', default: true }),
53
+ (0, swagger_1.ApiProperty)({ description: 'Whether to check the password against the HIBP breach corpus', example: true }),
54
+ tslib_1.__metadata("design:type", Boolean)
55
+ ], PasswordPolicy.prototype, "checkHIBP", void 0);
56
+ tslib_1.__decorate([
57
+ (0, typeorm_1.Column)({ type: 'boolean', default: true }),
58
+ (0, swagger_1.ApiProperty)({ description: 'Whether to reject common passwords (top-10k list)', example: true }),
59
+ tslib_1.__metadata("design:type", Boolean)
60
+ ], PasswordPolicy.prototype, "checkCommonPasswords", void 0);
61
+ tslib_1.__decorate([
62
+ (0, typeorm_1.Column)({ type: 'integer', default: 3 }),
63
+ (0, swagger_1.ApiProperty)({ description: 'Minimum required zxcvbn score (0-4)', example: 3 }),
64
+ tslib_1.__metadata("design:type", Number)
65
+ ], PasswordPolicy.prototype, "minZxcvbnScore", void 0);
66
+ tslib_1.__decorate([
67
+ (0, typeorm_1.Column)({ type: 'integer', default: 0 }),
68
+ (0, swagger_1.ApiProperty)({ description: 'How many previous passwords to remember (0 disables)', example: 0 }),
69
+ tslib_1.__metadata("design:type", Number)
70
+ ], PasswordPolicy.prototype, "historySize", void 0);
71
+ tslib_1.__decorate([
72
+ (0, typeorm_1.Column)({ type: 'integer', default: 0 }),
73
+ (0, swagger_1.ApiProperty)({ description: 'Forced rotation interval in days (0 disables)', example: 0 }),
74
+ tslib_1.__metadata("design:type", Number)
75
+ ], PasswordPolicy.prototype, "rotationDays", void 0);
76
+ tslib_1.__decorate([
77
+ (0, typeorm_1.CreateDateColumn)(),
78
+ (0, swagger_1.ApiProperty)({ description: 'When the policy record was created' }),
79
+ tslib_1.__metadata("design:type", Date)
80
+ ], PasswordPolicy.prototype, "createdAt", void 0);
81
+ tslib_1.__decorate([
82
+ (0, typeorm_1.UpdateDateColumn)(),
83
+ (0, swagger_1.ApiProperty)({ description: 'When the policy record was last updated' }),
84
+ tslib_1.__metadata("design:type", Date)
85
+ ], PasswordPolicy.prototype, "updatedAt", void 0);
86
+ tslib_1.__decorate([
87
+ (0, typeorm_1.VersionColumn)(),
88
+ (0, swagger_1.ApiProperty)({ description: 'Row version for optimistic concurrency control', example: 1 }),
89
+ tslib_1.__metadata("design:type", Number)
90
+ ], PasswordPolicy.prototype, "version", void 0);
91
+ exports.PasswordPolicy = PasswordPolicy = tslib_1.__decorate([
92
+ (0, typeorm_1.Entity)()
93
+ ], PasswordPolicy);
94
+ //# sourceMappingURL=password-policy.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password-policy.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities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C,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACvC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,+CAA+C,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oDACpE;AAItB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;sCACvD,IAAI;iDAAC;AAIjB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;sCAC5D,IAAI;iDAAC;AAIjB;IAFC,IAAA,uBAAa,GAAE;IACf,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gDAAgD,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+CAC1E;yBA/DN,cAAc;IAD1B,IAAA,gBAAM,GAAE;GACI,cAAc,CAgE1B"}
@@ -0,0 +1,12 @@
1
+ import { User } from './user.entity';
2
+ export declare class PushSubscription {
3
+ id: number;
4
+ userId: number;
5
+ endpoint: string;
6
+ p256dh: string;
7
+ auth: string;
8
+ userAgent: string | null;
9
+ createdAt: Date;
10
+ lastSeenAt: Date | null;
11
+ user: User;
12
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PushSubscription = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const swagger_1 = require("@nestjs/swagger");
7
+ const user_entity_1 = require("./user.entity");
8
+ let PushSubscription = class PushSubscription {
9
+ };
10
+ exports.PushSubscription = PushSubscription;
11
+ tslib_1.__decorate([
12
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
13
+ (0, swagger_1.ApiProperty)({ description: 'The unique identifier of the push subscription', example: 1 }),
14
+ tslib_1.__metadata("design:type", Number)
15
+ ], PushSubscription.prototype, "id", void 0);
16
+ tslib_1.__decorate([
17
+ (0, typeorm_1.Column)({ type: 'integer' }),
18
+ (0, swagger_1.ApiProperty)({ description: 'The ID of the user this subscription belongs to', example: 1 }),
19
+ tslib_1.__metadata("design:type", Number)
20
+ ], PushSubscription.prototype, "userId", void 0);
21
+ tslib_1.__decorate([
22
+ (0, typeorm_1.Column)({ type: 'text', unique: true }),
23
+ (0, swagger_1.ApiProperty)({
24
+ description: 'The push service endpoint URL that uniquely identifies this subscription (one per device/browser)',
25
+ example: 'https://fcm.googleapis.com/fcm/send/abc123',
26
+ }),
27
+ tslib_1.__metadata("design:type", String)
28
+ ], PushSubscription.prototype, "endpoint", void 0);
29
+ tslib_1.__decorate([
30
+ (0, typeorm_1.Column)({ type: 'text' }),
31
+ (0, swagger_1.ApiProperty)({ description: 'The P-256 ECDH public key of the subscription, used to encrypt push payloads' }),
32
+ tslib_1.__metadata("design:type", String)
33
+ ], PushSubscription.prototype, "p256dh", void 0);
34
+ tslib_1.__decorate([
35
+ (0, typeorm_1.Column)({ type: 'text' }),
36
+ (0, swagger_1.ApiProperty)({ description: 'The authentication secret of the subscription, used to encrypt push payloads' }),
37
+ tslib_1.__metadata("design:type", String)
38
+ ], PushSubscription.prototype, "auth", void 0);
39
+ tslib_1.__decorate([
40
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
41
+ (0, swagger_1.ApiProperty)({
42
+ description: 'The user agent of the browser that created this subscription, for display/debugging',
43
+ example: 'Mozilla/5.0 (X11; Linux x86_64) ...',
44
+ nullable: true,
45
+ }),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], PushSubscription.prototype, "userAgent", void 0);
48
+ tslib_1.__decorate([
49
+ (0, typeorm_1.CreateDateColumn)(),
50
+ (0, swagger_1.ApiProperty)({ description: 'When this subscription was created', example: '2025-01-18T12:30:00.000Z' }),
51
+ tslib_1.__metadata("design:type", Date)
52
+ ], PushSubscription.prototype, "createdAt", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
55
+ (0, swagger_1.ApiProperty)({
56
+ description: 'When this subscription was last re-confirmed by the client',
57
+ example: '2025-01-18T12:30:00.000Z',
58
+ nullable: true,
59
+ }),
60
+ tslib_1.__metadata("design:type", Date)
61
+ ], PushSubscription.prototype, "lastSeenAt", void 0);
62
+ tslib_1.__decorate([
63
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: 'CASCADE' }),
64
+ (0, typeorm_1.JoinColumn)({ name: 'userId' }),
65
+ (0, swagger_1.ApiProperty)({ description: 'The user this subscription belongs to', type: () => user_entity_1.User }),
66
+ tslib_1.__metadata("design:type", user_entity_1.User)
67
+ ], PushSubscription.prototype, "user", void 0);
68
+ exports.PushSubscription = PushSubscription = tslib_1.__decorate([
69
+ (0, typeorm_1.Entity)(),
70
+ (0, typeorm_1.Index)(['userId'])
71
+ ], PushSubscription);
72
+ //# sourceMappingURL=push-subscription.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-subscription.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/push-subscription.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAAiH;AACjH,6CAA8C;AAC9C,+CAAqC;AAI9B,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAgD5B,CAAA;AAhDY,4CAAgB;AAG3B;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gDAAgD,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;4CAC/E;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gDAC5E;AAOhB;IALC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACtC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,mGAA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;IAF5B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,CAAC,QAAQ,CAAC,CAAC;GACL,gBAAgB,CAgD5B"}
@@ -0,0 +1,21 @@
1
+ import { Resource } from './resource.entity';
2
+ import { User } from './user.entity';
3
+ import { ResourceMaintenance } from './resource.maintenance';
4
+ export declare enum MaintenanceRequestStatus {
5
+ OPEN = "open",
6
+ RESOLVED = "resolved",
7
+ DISMISSED = "dismissed"
8
+ }
9
+ export declare class ResourceMaintenanceRequest {
10
+ id: number;
11
+ createdAt: Date;
12
+ updatedAt: Date;
13
+ resourceId: number;
14
+ resource: Resource;
15
+ reason: string;
16
+ status: MaintenanceRequestStatus;
17
+ createdByUser: User | null;
18
+ resolvedByUser: User | null;
19
+ resolvedAt: Date | null;
20
+ resultingMaintenance: ResourceMaintenance | null;
21
+ }
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResourceMaintenanceRequest = exports.MaintenanceRequestStatus = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const swagger_1 = require("@nestjs/swagger");
7
+ const resource_entity_1 = require("./resource.entity");
8
+ const user_entity_1 = require("./user.entity");
9
+ const resource_maintenance_1 = require("./resource.maintenance");
10
+ var MaintenanceRequestStatus;
11
+ (function (MaintenanceRequestStatus) {
12
+ MaintenanceRequestStatus["OPEN"] = "open";
13
+ MaintenanceRequestStatus["RESOLVED"] = "resolved";
14
+ MaintenanceRequestStatus["DISMISSED"] = "dismissed";
15
+ })(MaintenanceRequestStatus || (exports.MaintenanceRequestStatus = MaintenanceRequestStatus = {}));
16
+ let ResourceMaintenanceRequest = class ResourceMaintenanceRequest {
17
+ };
18
+ exports.ResourceMaintenanceRequest = ResourceMaintenanceRequest;
19
+ tslib_1.__decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
21
+ (0, swagger_1.ApiProperty)({
22
+ description: 'The unique identifier of the maintenance request',
23
+ example: 1,
24
+ }),
25
+ tslib_1.__metadata("design:type", Number)
26
+ ], ResourceMaintenanceRequest.prototype, "id", void 0);
27
+ tslib_1.__decorate([
28
+ (0, typeorm_1.CreateDateColumn)(),
29
+ (0, swagger_1.ApiProperty)({
30
+ description: 'When the request was created',
31
+ }),
32
+ tslib_1.__metadata("design:type", Date)
33
+ ], ResourceMaintenanceRequest.prototype, "createdAt", void 0);
34
+ tslib_1.__decorate([
35
+ (0, typeorm_1.UpdateDateColumn)(),
36
+ (0, swagger_1.ApiProperty)({
37
+ description: 'When the request was last updated',
38
+ }),
39
+ tslib_1.__metadata("design:type", Date)
40
+ ], ResourceMaintenanceRequest.prototype, "updatedAt", void 0);
41
+ tslib_1.__decorate([
42
+ (0, typeorm_1.Column)({ type: 'int' }),
43
+ (0, swagger_1.ApiProperty)({
44
+ description: 'The ID of the resource the request is for',
45
+ example: 1,
46
+ }),
47
+ tslib_1.__metadata("design:type", Number)
48
+ ], ResourceMaintenanceRequest.prototype, "resourceId", void 0);
49
+ tslib_1.__decorate([
50
+ (0, typeorm_1.ManyToOne)(() => resource_entity_1.Resource, { onDelete: 'CASCADE' }),
51
+ tslib_1.__metadata("design:type", resource_entity_1.Resource)
52
+ ], ResourceMaintenanceRequest.prototype, "resource", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.Column)({ type: 'text' }),
55
+ (0, swagger_1.ApiProperty)({
56
+ description: 'Why the user thinks the resource needs maintenance',
57
+ example: 'The spindle makes a grinding noise and stops mid-cut.',
58
+ }),
59
+ tslib_1.__metadata("design:type", String)
60
+ ], ResourceMaintenanceRequest.prototype, "reason", void 0);
61
+ tslib_1.__decorate([
62
+ (0, typeorm_1.Column)({
63
+ type: 'simple-enum',
64
+ enum: MaintenanceRequestStatus,
65
+ default: MaintenanceRequestStatus.OPEN,
66
+ }),
67
+ (0, swagger_1.ApiProperty)({
68
+ description: 'The current status of the request',
69
+ enum: MaintenanceRequestStatus,
70
+ enumName: 'MaintenanceRequestStatus',
71
+ example: MaintenanceRequestStatus.OPEN,
72
+ }),
73
+ tslib_1.__metadata("design:type", String)
74
+ ], ResourceMaintenanceRequest.prototype, "status", void 0);
75
+ tslib_1.__decorate([
76
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, { nullable: true }),
77
+ (0, swagger_1.ApiProperty)({
78
+ description: 'The user who reported the resource as broken',
79
+ required: false,
80
+ }),
81
+ tslib_1.__metadata("design:type", user_entity_1.User)
82
+ ], ResourceMaintenanceRequest.prototype, "createdByUser", void 0);
83
+ tslib_1.__decorate([
84
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, { nullable: true }),
85
+ (0, swagger_1.ApiProperty)({
86
+ description: 'The maintainer who resolved or dismissed the request',
87
+ required: false,
88
+ }),
89
+ tslib_1.__metadata("design:type", user_entity_1.User)
90
+ ], ResourceMaintenanceRequest.prototype, "resolvedByUser", void 0);
91
+ tslib_1.__decorate([
92
+ (0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
93
+ (0, swagger_1.ApiProperty)({
94
+ description: 'When the request was resolved or dismissed',
95
+ required: false,
96
+ type: String,
97
+ nullable: true,
98
+ format: 'date-time',
99
+ }),
100
+ tslib_1.__metadata("design:type", Date)
101
+ ], ResourceMaintenanceRequest.prototype, "resolvedAt", void 0);
102
+ tslib_1.__decorate([
103
+ (0, typeorm_1.ManyToOne)(() => resource_maintenance_1.ResourceMaintenance, { nullable: true }),
104
+ (0, swagger_1.ApiProperty)({
105
+ description: 'The maintenance created from this request (null until converted)',
106
+ required: false,
107
+ }),
108
+ tslib_1.__metadata("design:type", resource_maintenance_1.ResourceMaintenance)
109
+ ], ResourceMaintenanceRequest.prototype, "resultingMaintenance", void 0);
110
+ exports.ResourceMaintenanceRequest = ResourceMaintenanceRequest = tslib_1.__decorate([
111
+ (0, typeorm_1.Entity)()
112
+ ], ResourceMaintenanceRequest);
113
+ //# sourceMappingURL=resource-maintenance-request.entity.js.map