@platform-modules/civil-aviation-authority 1.0.54 → 1.0.56
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.
- package/.env +7 -1
- package/dist/data-source.js +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/NotificationModel.d.ts +18 -0
- package/dist/models/NotificationModel.js +79 -0
- package/package.json +1 -1
- package/src/data-source.ts +3 -1
- package/src/index.ts +1 -0
- package/src/models/NotificationModel.ts +68 -0
package/.env
CHANGED
package/dist/data-source.js
CHANGED
|
@@ -29,6 +29,7 @@ const serviceBookmarksModel_1 = require("./models/serviceBookmarksModel");
|
|
|
29
29
|
const contactInfoModel_1 = require("./models/contactInfoModel");
|
|
30
30
|
const userRolesModel_1 = require("./models/userRolesModel");
|
|
31
31
|
const roleRightsModel_1 = require("./models/roleRightsModel");
|
|
32
|
+
const NotificationModel_1 = require("./models/NotificationModel");
|
|
32
33
|
exports.AppDataSource = new typeorm_1.DataSource({
|
|
33
34
|
type: 'postgres',
|
|
34
35
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -61,6 +62,7 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
61
62
|
serviceBookmarksModel_1.ServiceBookmarks,
|
|
62
63
|
contactInfoModel_1.ContactInfo,
|
|
63
64
|
userRolesModel_1.UserRole,
|
|
64
|
-
roleRightsModel_1.RoleRights
|
|
65
|
+
roleRightsModel_1.RoleRights,
|
|
66
|
+
NotificationModel_1.Notification
|
|
65
67
|
],
|
|
66
68
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -38,3 +38,4 @@ __exportStar(require("./models/serviceBookmarksModel"), exports);
|
|
|
38
38
|
__exportStar(require("./models/contactInfoModel"), exports);
|
|
39
39
|
__exportStar(require("./models/userRolesModel"), exports);
|
|
40
40
|
__exportStar(require("./models/roleRightsModel"), exports);
|
|
41
|
+
__exportStar(require("./models/NotificationModel"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare enum NotificationType {
|
|
3
|
+
REQUEST_RAISED = "request raised",
|
|
4
|
+
REMINDER = "reminder",
|
|
5
|
+
IMPORT = "import"
|
|
6
|
+
}
|
|
7
|
+
export declare class Notification extends BaseModel {
|
|
8
|
+
type: NotificationType;
|
|
9
|
+
user_id: number;
|
|
10
|
+
role_id: number;
|
|
11
|
+
department_id: number;
|
|
12
|
+
section_id: number;
|
|
13
|
+
content: any;
|
|
14
|
+
is_read: boolean;
|
|
15
|
+
request_id: number;
|
|
16
|
+
route_path: string;
|
|
17
|
+
constructor(type: NotificationType, user_id: number, role_id: number, department_id: number, section_id: number, content: any, is_read: boolean, request_id: number, route_path: string);
|
|
18
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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.Notification = exports.NotificationType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var NotificationType;
|
|
16
|
+
(function (NotificationType) {
|
|
17
|
+
NotificationType["REQUEST_RAISED"] = "request raised";
|
|
18
|
+
NotificationType["REMINDER"] = "reminder";
|
|
19
|
+
NotificationType["IMPORT"] = "import";
|
|
20
|
+
})(NotificationType || (exports.NotificationType = NotificationType = {}));
|
|
21
|
+
let Notification = class Notification extends BaseModel_1.BaseModel {
|
|
22
|
+
constructor(type, user_id, role_id, department_id, section_id, content, is_read, request_id, route_path) {
|
|
23
|
+
super();
|
|
24
|
+
this.type = type;
|
|
25
|
+
this.user_id = user_id;
|
|
26
|
+
this.role_id = role_id;
|
|
27
|
+
this.department_id = department_id;
|
|
28
|
+
this.section_id = section_id;
|
|
29
|
+
this.content = content;
|
|
30
|
+
this.is_read = is_read;
|
|
31
|
+
this.request_id = request_id;
|
|
32
|
+
this.route_path = route_path;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.Notification = Notification;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({
|
|
38
|
+
type: "enum",
|
|
39
|
+
enum: NotificationType,
|
|
40
|
+
nullable: false,
|
|
41
|
+
}),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], Notification.prototype, "type", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], Notification.prototype, "user_id", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], Notification.prototype, "role_id", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
54
|
+
__metadata("design:type", Number)
|
|
55
|
+
], Notification.prototype, "department_id", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
58
|
+
__metadata("design:type", Number)
|
|
59
|
+
], Notification.prototype, "section_id", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], Notification.prototype, "content", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
66
|
+
__metadata("design:type", Boolean)
|
|
67
|
+
], Notification.prototype, "is_read", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
70
|
+
__metadata("design:type", Number)
|
|
71
|
+
], Notification.prototype, "request_id", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true }),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], Notification.prototype, "route_path", void 0);
|
|
76
|
+
exports.Notification = Notification = __decorate([
|
|
77
|
+
(0, typeorm_1.Entity)({ name: 'notification' }),
|
|
78
|
+
__metadata("design:paramtypes", [String, Number, Number, Number, Number, Object, Boolean, Number, String])
|
|
79
|
+
], Notification);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -26,6 +26,7 @@ import { ServiceBookmarks } from './models/serviceBookmarksModel';
|
|
|
26
26
|
import { ContactInfo } from './models/contactInfoModel';
|
|
27
27
|
import { UserRole } from './models/userRolesModel';
|
|
28
28
|
import { RoleRights } from './models/roleRightsModel';
|
|
29
|
+
import { Notification } from './models/NotificationModel';
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
|
|
@@ -61,6 +62,7 @@ export const AppDataSource = new DataSource({
|
|
|
61
62
|
ServiceBookmarks,
|
|
62
63
|
ContactInfo,
|
|
63
64
|
UserRole,
|
|
64
|
-
RoleRights
|
|
65
|
+
RoleRights,
|
|
66
|
+
Notification
|
|
65
67
|
],
|
|
66
68
|
});
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
import { Column, Entity } from "typeorm";
|
|
3
|
+
import { BaseModel } from './BaseModel';
|
|
4
|
+
|
|
5
|
+
export enum NotificationType {
|
|
6
|
+
REQUEST_RAISED = 'request raised',
|
|
7
|
+
REMINDER = 'reminder',
|
|
8
|
+
IMPORT = 'import',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Entity({ name: 'notification' })
|
|
12
|
+
export class Notification extends BaseModel {
|
|
13
|
+
|
|
14
|
+
@Column({
|
|
15
|
+
type: "enum",
|
|
16
|
+
enum: NotificationType,
|
|
17
|
+
nullable: false,
|
|
18
|
+
})
|
|
19
|
+
type: NotificationType;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'bigint', nullable: false })
|
|
22
|
+
user_id: number;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'bigint', nullable: true })
|
|
25
|
+
role_id: number;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'bigint', nullable: true })
|
|
28
|
+
department_id: number;
|
|
29
|
+
|
|
30
|
+
@Column({ type: 'bigint', nullable: true })
|
|
31
|
+
section_id: number;
|
|
32
|
+
|
|
33
|
+
@Column({ type: 'jsonb', nullable: true })
|
|
34
|
+
content: any;
|
|
35
|
+
|
|
36
|
+
@Column({ type: 'boolean', default: false })
|
|
37
|
+
is_read: boolean;
|
|
38
|
+
|
|
39
|
+
@Column({ type: 'bigint', nullable: true })
|
|
40
|
+
request_id: number;
|
|
41
|
+
|
|
42
|
+
@Column({ type: 'varchar', length: 500, nullable: true })
|
|
43
|
+
route_path: string;
|
|
44
|
+
|
|
45
|
+
constructor(
|
|
46
|
+
type: NotificationType,
|
|
47
|
+
user_id: number,
|
|
48
|
+
role_id: number,
|
|
49
|
+
department_id: number,
|
|
50
|
+
section_id: number,
|
|
51
|
+
content: any,
|
|
52
|
+
is_read: boolean,
|
|
53
|
+
request_id: number,
|
|
54
|
+
route_path: string
|
|
55
|
+
) {
|
|
56
|
+
super();
|
|
57
|
+
this.type = type;
|
|
58
|
+
this.user_id = user_id;
|
|
59
|
+
this.role_id = role_id;
|
|
60
|
+
this.department_id = department_id;
|
|
61
|
+
this.section_id = section_id;
|
|
62
|
+
this.content = content;
|
|
63
|
+
this.is_read = is_read;
|
|
64
|
+
this.request_id = request_id;
|
|
65
|
+
this.route_path = route_path;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|