@platform-modules/civil-aviation-authority 1.0.23 → 1.0.25
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/dist/data-source.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/ITApprovalSettings.d.ts +2 -4
- package/dist/models/ITApprovalSettings.js +8 -18
- package/dist/models/Workflows.d.ts +9 -0
- package/dist/models/Workflows.js +50 -0
- package/package.json +1 -1
- package/src/data-source.ts +2 -1
- package/src/index.ts +1 -0
- package/src/models/ITApprovalSettings.ts +8 -18
- package/src/models/Workflows.ts +40 -0
package/dist/data-source.js
CHANGED
|
@@ -14,6 +14,7 @@ const ITServicesTypesMuscatModel_1 = require("./models/ITServicesTypesMuscatMode
|
|
|
14
14
|
const CAAServices_1 = require("./models/CAAServices");
|
|
15
15
|
const CAASubServices_1 = require("./models/CAASubServices");
|
|
16
16
|
const ITApprovalSettings_1 = require("./models/ITApprovalSettings");
|
|
17
|
+
const Workflows_1 = require("./models/Workflows");
|
|
17
18
|
exports.AppDataSource = new typeorm_1.DataSource({
|
|
18
19
|
type: 'postgres',
|
|
19
20
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -23,5 +24,5 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
23
24
|
database: process.env.DB_NAME || 'common_models',
|
|
24
25
|
synchronize: true, // auto-create tables (disable in prod)
|
|
25
26
|
logging: false,
|
|
26
|
-
entities: [user_1.User, user_sessions_1.userSessions, role_1.Role, ITHelpDeskModel_1.ITHelpDeskRequests, ITServicesTypesSalalahModel_1.ITServicesTypesSalalah, ITServicesTypesMuscatModel_1.ITServicesTypesMuscat, CAAServices_1.CAAServices, CAASubServices_1.CAASubServices, ITApprovalSettings_1.ITApprovalSettings],
|
|
27
|
+
entities: [user_1.User, user_sessions_1.userSessions, role_1.Role, ITHelpDeskModel_1.ITHelpDeskRequests, ITServicesTypesSalalahModel_1.ITServicesTypesSalalah, ITServicesTypesMuscatModel_1.ITServicesTypesMuscat, CAAServices_1.CAAServices, CAASubServices_1.CAASubServices, ITApprovalSettings_1.ITApprovalSettings, Workflows_1.Workflows],
|
|
27
28
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -23,3 +23,4 @@ __exportStar(require("./models/ITServicesTypesMuscatModel"), exports);
|
|
|
23
23
|
__exportStar(require("./models/CAAServices"), exports);
|
|
24
24
|
__exportStar(require("./models/CAASubServices"), exports);
|
|
25
25
|
__exportStar(require("./models/ITApprovalSettings"), exports);
|
|
26
|
+
__exportStar(require("./models/Workflows"), exports);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { BaseModel } from './BaseModel';
|
|
2
2
|
export declare class ITApprovalSettings extends BaseModel {
|
|
3
|
-
service_id: number;
|
|
4
|
-
sub_service_id: number;
|
|
5
|
-
request_for: string;
|
|
6
3
|
level: number;
|
|
7
4
|
approval_role_id: number;
|
|
8
|
-
|
|
5
|
+
workflow_id: number;
|
|
6
|
+
constructor(level: number, approval_role_id: number, workflow_id: number);
|
|
9
7
|
}
|
|
@@ -13,28 +13,14 @@ exports.ITApprovalSettings = void 0;
|
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const BaseModel_1 = require("./BaseModel");
|
|
15
15
|
let ITApprovalSettings = class ITApprovalSettings extends BaseModel_1.BaseModel {
|
|
16
|
-
constructor(
|
|
16
|
+
constructor(level, approval_role_id, workflow_id) {
|
|
17
17
|
super();
|
|
18
|
-
this.service_id = service_id;
|
|
19
|
-
this.sub_service_id = sub_service_id;
|
|
20
|
-
this.request_for = request_for;
|
|
21
18
|
this.level = level;
|
|
22
19
|
this.approval_role_id = approval_role_id;
|
|
20
|
+
this.workflow_id = workflow_id;
|
|
23
21
|
}
|
|
24
22
|
};
|
|
25
23
|
exports.ITApprovalSettings = ITApprovalSettings;
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
|
|
28
|
-
__metadata("design:type", Number)
|
|
29
|
-
], ITApprovalSettings.prototype, "service_id", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
|
|
32
|
-
__metadata("design:type", Number)
|
|
33
|
-
], ITApprovalSettings.prototype, "sub_service_id", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 16, nullable: false }),
|
|
36
|
-
__metadata("design:type", String)
|
|
37
|
-
], ITApprovalSettings.prototype, "request_for", void 0);
|
|
38
24
|
__decorate([
|
|
39
25
|
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
40
26
|
__metadata("design:type", Number)
|
|
@@ -43,8 +29,12 @@ __decorate([
|
|
|
43
29
|
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
44
30
|
__metadata("design:type", Number)
|
|
45
31
|
], ITApprovalSettings.prototype, "approval_role_id", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], ITApprovalSettings.prototype, "workflow_id", void 0);
|
|
46
36
|
exports.ITApprovalSettings = ITApprovalSettings = __decorate([
|
|
47
37
|
(0, typeorm_1.Entity)({ name: 'it_approval_settings' }),
|
|
48
|
-
(0, typeorm_1.Unique)(['
|
|
49
|
-
__metadata("design:paramtypes", [Number, Number,
|
|
38
|
+
(0, typeorm_1.Unique)(['workflow_id', 'level']),
|
|
39
|
+
__metadata("design:paramtypes", [Number, Number, Number])
|
|
50
40
|
], ITApprovalSettings);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare class Workflows extends BaseModel {
|
|
3
|
+
name: string;
|
|
4
|
+
service_id: number;
|
|
5
|
+
sub_service_id: number;
|
|
6
|
+
request_for: string;
|
|
7
|
+
levels: number;
|
|
8
|
+
constructor(name: string, service_id: number, sub_service_id: number, request_for: string, levels: number);
|
|
9
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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.Workflows = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let Workflows = class Workflows extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(name, service_id, sub_service_id, request_for, levels) {
|
|
17
|
+
super();
|
|
18
|
+
this.name = name;
|
|
19
|
+
this.service_id = service_id;
|
|
20
|
+
this.sub_service_id = sub_service_id;
|
|
21
|
+
this.request_for = request_for;
|
|
22
|
+
this.levels = levels;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.Workflows = Workflows;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 16, nullable: false }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], Workflows.prototype, "name", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], Workflows.prototype, "service_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], Workflows.prototype, "sub_service_id", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 16, nullable: false }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], Workflows.prototype, "request_for", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], Workflows.prototype, "levels", void 0);
|
|
46
|
+
exports.Workflows = Workflows = __decorate([
|
|
47
|
+
(0, typeorm_1.Entity)({ name: 'workflows' }),
|
|
48
|
+
(0, typeorm_1.Unique)(['service_id', 'sub_service_id', 'request_for']),
|
|
49
|
+
__metadata("design:paramtypes", [String, Number, Number, String, Number])
|
|
50
|
+
], Workflows);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { ITServicesTypesMuscat } from './models/ITServicesTypesMuscatModel';
|
|
|
11
11
|
import { CAAServices } from './models/CAAServices';
|
|
12
12
|
import { CAASubServices } from './models/CAASubServices';
|
|
13
13
|
import { ITApprovalSettings } from './models/ITApprovalSettings';
|
|
14
|
+
import { Workflows } from './models/Workflows';
|
|
14
15
|
export const AppDataSource = new DataSource({
|
|
15
16
|
type: 'postgres',
|
|
16
17
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -20,5 +21,5 @@ export const AppDataSource = new DataSource({
|
|
|
20
21
|
database: process.env.DB_NAME || 'common_models',
|
|
21
22
|
synchronize: true, // auto-create tables (disable in prod)
|
|
22
23
|
logging: false,
|
|
23
|
-
entities: [User,userSessions,Role, ITHelpDeskRequests, ITServicesTypesSalalah, ITServicesTypesMuscat, CAAServices, CAASubServices, ITApprovalSettings],
|
|
24
|
+
entities: [User,userSessions,Role, ITHelpDeskRequests, ITServicesTypesSalalah, ITServicesTypesMuscat, CAAServices, CAASubServices, ITApprovalSettings, Workflows],
|
|
24
25
|
});
|
package/src/index.ts
CHANGED
|
@@ -2,17 +2,9 @@ import { Column, Entity, Unique } from "typeorm";
|
|
|
2
2
|
import { BaseModel } from './BaseModel';
|
|
3
3
|
|
|
4
4
|
@Entity({ name: 'it_approval_settings' })
|
|
5
|
-
@Unique(['
|
|
5
|
+
@Unique(['workflow_id', 'level'])
|
|
6
6
|
export class ITApprovalSettings extends BaseModel {
|
|
7
|
-
|
|
8
|
-
@Column({ type: 'bigint', nullable: false })
|
|
9
|
-
service_id: number;
|
|
10
|
-
|
|
11
|
-
@Column({ type: 'bigint', nullable: false })
|
|
12
|
-
sub_service_id: number;
|
|
13
|
-
|
|
14
|
-
@Column({ type: 'varchar', length: 16, nullable: false })
|
|
15
|
-
request_for: string; // 'Self' | 'Behalf of' | 'Internal'
|
|
7
|
+
|
|
16
8
|
|
|
17
9
|
@Column({ type: 'int', nullable: false })
|
|
18
10
|
level: number;
|
|
@@ -20,20 +12,18 @@ export class ITApprovalSettings extends BaseModel {
|
|
|
20
12
|
@Column({ type: 'int', nullable: false })
|
|
21
13
|
approval_role_id: number;
|
|
22
14
|
|
|
15
|
+
@Column({ type: 'int', nullable: false })
|
|
16
|
+
workflow_id: number;
|
|
23
17
|
constructor(
|
|
24
|
-
service_id: number,
|
|
25
|
-
sub_service_id: number,
|
|
26
|
-
request_for: string,
|
|
27
18
|
level: number,
|
|
28
|
-
approval_role_id: number
|
|
19
|
+
approval_role_id: number,
|
|
20
|
+
workflow_id: number
|
|
29
21
|
) {
|
|
30
22
|
super();
|
|
31
|
-
this.service_id = service_id;
|
|
32
|
-
this.sub_service_id = sub_service_id;
|
|
33
|
-
this.request_for = request_for;
|
|
34
23
|
this.level = level;
|
|
35
24
|
this.approval_role_id = approval_role_id;
|
|
36
|
-
|
|
25
|
+
this.workflow_id = workflow_id;
|
|
26
|
+
}
|
|
37
27
|
}
|
|
38
28
|
|
|
39
29
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Column, Entity, Unique } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'workflows' })
|
|
5
|
+
@Unique(['service_id', 'sub_service_id', 'request_for'])
|
|
6
|
+
export class Workflows extends BaseModel {
|
|
7
|
+
|
|
8
|
+
@Column({ type: 'varchar', length: 16, nullable: false })
|
|
9
|
+
name: string;
|
|
10
|
+
|
|
11
|
+
@Column({ type: 'bigint', nullable: false })
|
|
12
|
+
service_id: number;
|
|
13
|
+
|
|
14
|
+
@Column({ type: 'bigint', nullable: false })
|
|
15
|
+
sub_service_id: number;
|
|
16
|
+
|
|
17
|
+
@Column({ type: 'varchar', length: 16, nullable: false })
|
|
18
|
+
request_for: string; // 'Self' | 'Behalf of' | 'Internal'
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'int', nullable: false })
|
|
21
|
+
levels: number;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
constructor(
|
|
25
|
+
name: string,
|
|
26
|
+
service_id: number,
|
|
27
|
+
sub_service_id: number,
|
|
28
|
+
request_for: string,
|
|
29
|
+
levels: number,
|
|
30
|
+
) {
|
|
31
|
+
super();
|
|
32
|
+
this.name = name;
|
|
33
|
+
this.service_id = service_id;
|
|
34
|
+
this.sub_service_id = sub_service_id;
|
|
35
|
+
this.request_for = request_for;
|
|
36
|
+
this.levels = levels;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|