@platform-modules/foreign-ministry 1.3.130 → 1.3.131

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.
@@ -1,4 +1,5 @@
1
1
  import { BaseModel } from './BaseModel';
2
+ import { GatePassType } from "./GatePassRequestsModel";
2
3
  /**
3
4
  * Gate Pass Visitors Table
4
5
  * Stores visitor information for each gate pass request
@@ -17,6 +18,18 @@ export declare class GatePassVisitors extends BaseModel {
17
18
  visitor_mobile_number: string | null;
18
19
  visitor_photo_url: string | null;
19
20
  visitor_photo_file_name: string | null;
21
+ date: Date | null;
22
+ department_id: number | null;
23
+ office_number: string | null;
24
+ visiting_department: string | null;
25
+ person_to_be_interviewed: string | null;
26
+ vehicle_type_and_color: string | null;
27
+ plate_number_and_code: string | null;
28
+ purpose_of_entry: string | null;
29
+ from_date: Date | null;
30
+ to_date: Date | null;
31
+ gate_pass_type: GatePassType | null;
32
+ visiting_person_in_department: string | null;
20
33
  qr_code_url: string | null;
21
34
  qr_code_data: string | null;
22
35
  gate_pass_generated: boolean;
@@ -85,6 +85,54 @@ __decorate([
85
85
  (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
86
86
  __metadata("design:type", Object)
87
87
  ], GatePassVisitors.prototype, "visitor_photo_file_name", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
90
+ __metadata("design:type", Object)
91
+ ], GatePassVisitors.prototype, "date", void 0);
92
+ __decorate([
93
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
94
+ __metadata("design:type", Object)
95
+ ], GatePassVisitors.prototype, "department_id", void 0);
96
+ __decorate([
97
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
98
+ __metadata("design:type", Object)
99
+ ], GatePassVisitors.prototype, "office_number", void 0);
100
+ __decorate([
101
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
102
+ __metadata("design:type", Object)
103
+ ], GatePassVisitors.prototype, "visiting_department", void 0);
104
+ __decorate([
105
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
106
+ __metadata("design:type", Object)
107
+ ], GatePassVisitors.prototype, "person_to_be_interviewed", void 0);
108
+ __decorate([
109
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
110
+ __metadata("design:type", Object)
111
+ ], GatePassVisitors.prototype, "vehicle_type_and_color", void 0);
112
+ __decorate([
113
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
114
+ __metadata("design:type", Object)
115
+ ], GatePassVisitors.prototype, "plate_number_and_code", void 0);
116
+ __decorate([
117
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
118
+ __metadata("design:type", Object)
119
+ ], GatePassVisitors.prototype, "purpose_of_entry", void 0);
120
+ __decorate([
121
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
122
+ __metadata("design:type", Object)
123
+ ], GatePassVisitors.prototype, "from_date", void 0);
124
+ __decorate([
125
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
126
+ __metadata("design:type", Object)
127
+ ], GatePassVisitors.prototype, "to_date", void 0);
128
+ __decorate([
129
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
130
+ __metadata("design:type", Object)
131
+ ], GatePassVisitors.prototype, "gate_pass_type", void 0);
132
+ __decorate([
133
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
134
+ __metadata("design:type", Object)
135
+ ], GatePassVisitors.prototype, "visiting_person_in_department", void 0);
88
136
  __decorate([
89
137
  (0, typeorm_1.Column)({ type: 'text', nullable: true }),
90
138
  __metadata("design:type", Object)
@@ -8,7 +8,8 @@ export declare class ServicesNotificationConfigs extends BaseModel {
8
8
  section_id: number | null;
9
9
  service_id: number;
10
10
  sub_service_id: number | null;
11
+ role_id: number;
11
12
  trigger: ServicesNotificationTriggerType;
12
13
  is_active: boolean;
13
- constructor(department_id: number, section_id: number | null | undefined, service_id: number, sub_service_id?: number | null, trigger?: ServicesNotificationTriggerType, is_active?: boolean);
14
+ constructor(department_id: number, section_id: number | null | undefined, service_id: number, sub_service_id: number | null | undefined, role_id: number, trigger?: ServicesNotificationTriggerType, is_active?: boolean);
14
15
  }
@@ -18,12 +18,13 @@ var ServicesNotificationTriggerType;
18
18
  ServicesNotificationTriggerType["EVERY_APPROVAL"] = "every_approval";
19
19
  })(ServicesNotificationTriggerType || (exports.ServicesNotificationTriggerType = ServicesNotificationTriggerType = {}));
20
20
  let ServicesNotificationConfigs = class ServicesNotificationConfigs extends BaseModel_1.BaseModel {
21
- constructor(department_id, section_id = null, service_id, sub_service_id = null, trigger = ServicesNotificationTriggerType.FINAL_APPROVAL, is_active = true) {
21
+ constructor(department_id, section_id = null, service_id, sub_service_id = null, role_id, trigger = ServicesNotificationTriggerType.FINAL_APPROVAL, is_active = true) {
22
22
  super();
23
23
  this.department_id = department_id;
24
24
  this.section_id = section_id;
25
25
  this.service_id = service_id;
26
26
  this.sub_service_id = sub_service_id;
27
+ this.role_id = role_id;
27
28
  this.trigger = trigger;
28
29
  this.is_active = is_active;
29
30
  }
@@ -45,6 +46,10 @@ __decorate([
45
46
  (0, typeorm_1.Column)({ type: "integer", nullable: true }),
46
47
  __metadata("design:type", Object)
47
48
  ], ServicesNotificationConfigs.prototype, "sub_service_id", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ type: "integer", nullable: false }),
51
+ __metadata("design:type", Number)
52
+ ], ServicesNotificationConfigs.prototype, "role_id", void 0);
48
53
  __decorate([
49
54
  (0, typeorm_1.Column)({
50
55
  type: "enum",
@@ -60,5 +65,5 @@ __decorate([
60
65
  ], ServicesNotificationConfigs.prototype, "is_active", void 0);
61
66
  exports.ServicesNotificationConfigs = ServicesNotificationConfigs = __decorate([
62
67
  (0, typeorm_1.Entity)({ name: "services_notification_configs" }),
63
- __metadata("design:paramtypes", [Number, Object, Number, Object, String, Boolean])
68
+ __metadata("design:paramtypes", [Number, Object, Number, Object, Number, String, Boolean])
64
69
  ], ServicesNotificationConfigs);
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "name": "@platform-modules/foreign-ministry",
3
- "version": "1.3.130",
4
- "main": "dist/index.js",
5
- "types": "dist/index.d.ts",
6
- "scripts": {
7
- "build": "tsc",
8
- "dev": "ts-node src/scripts.ts"
9
- },
10
- "publishConfig": {
11
- "access": "public"
12
- },
13
- "dependencies": {
14
- "moment-timezone": "^0.6.0",
15
- "pg": "^8.16.0",
16
- "typeorm": "^0.3.17"
17
- },
18
- "devDependencies": {
19
- "@types/moment-timezone": "^0.5.30",
20
- "dotenv": "^16.5.0",
21
- "ts-node": "^10.9.2",
22
- "typescript": "^5.2.0"
23
- }
24
- }
1
+ {
2
+ "name": "@platform-modules/foreign-ministry",
3
+ "version": "1.3.131",
4
+ "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
6
+ "scripts": {
7
+ "build": "tsc",
8
+ "dev": "ts-node src/scripts.ts"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "dependencies": {
14
+ "moment-timezone": "^0.6.0",
15
+ "pg": "^8.16.0",
16
+ "typeorm": "^0.3.17"
17
+ },
18
+ "devDependencies": {
19
+ "@types/moment-timezone": "^0.5.30",
20
+ "dotenv": "^16.5.0",
21
+ "ts-node": "^10.9.2",
22
+ "typescript": "^5.2.0"
23
+ }
24
+ }
@@ -1,5 +1,6 @@
1
1
  import { Column, Entity } from "typeorm";
2
2
  import { BaseModel } from './BaseModel';
3
+ import { GatePassType } from "./GatePassRequestsModel";
3
4
 
4
5
  /**
5
6
  * Gate Pass Visitors Table
@@ -46,6 +47,44 @@ export class GatePassVisitors extends BaseModel {
46
47
  @Column({ type: 'varchar', length: 255, nullable: true })
47
48
  visitor_photo_file_name: string | null;
48
49
 
50
+ // Visit Details Fields (per-visitor; optional, fallback to request-level)
51
+ @Column({ type: 'date', nullable: true })
52
+ date: Date | null; // التاريخ (Date)
53
+
54
+ @Column({ type: 'int', nullable: true })
55
+ department_id: number | null; // الدائرة (Department)
56
+
57
+ @Column({ type: 'varchar', length: 255, nullable: true })
58
+ office_number: string | null; // رقم المكتب (Office Number)
59
+
60
+ @Column({ type: 'varchar', length: 255, nullable: true })
61
+ visiting_department: string | null; // قسم الزيارة (Visiting Department)
62
+
63
+ @Column({ type: 'varchar', length: 255, nullable: true })
64
+ person_to_be_interviewed: string | null; // الشخص المطلوب مقابلته (Person to be Interviewed)
65
+
66
+ @Column({ type: 'varchar', length: 255, nullable: true })
67
+ vehicle_type_and_color: string | null; // نوع المركبة ولونها (Vehicle Type and Color)
68
+
69
+ @Column({ type: 'varchar', length: 255, nullable: true })
70
+ plate_number_and_code: string | null; // رقم اللوحة والرمز (Plate Number and Code)
71
+
72
+ @Column({ type: 'text', nullable: true })
73
+ purpose_of_entry: string | null; // الغرض من الدخول (Purpose of Entry)
74
+
75
+ @Column({ type: 'date', nullable: true })
76
+ from_date: Date | null; // من (From)
77
+
78
+ @Column({ type: 'date', nullable: true })
79
+ to_date: Date | null; // الى (To)
80
+
81
+ // Store as varchar to avoid DB enum coupling (values: "Short-term" / "Long-term")
82
+ @Column({ type: 'varchar', length: 50, nullable: true })
83
+ gate_pass_type: GatePassType | null; // نوع ممر البوابة (Gate Pass Type)
84
+
85
+ @Column({ type: 'varchar', length: 255, nullable: true })
86
+ visiting_person_in_department: string | null; // زائر في القسم (Visiting Person in Department)
87
+
49
88
  // QR Code for Gate Pass
50
89
  @Column({ type: 'text', nullable: true })
51
90
  qr_code_url: string | null; // QR code URL for this visitor (data URL can be 6000+ characters)
@@ -1,25 +1,25 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
-
4
- @Entity({ name: "moodle_users" })
5
- export class MoodleUsers extends BaseModel {
6
- @Column({ type: "integer", nullable: false })
7
- user_id: number; // Foreign key to users table
8
-
9
- @Column({ type: "integer", nullable: false })
10
- moodle_user_id: number; // Moodle user ID from Moodle system
11
-
12
- @Column({ type: "varchar", length: 255, nullable: false })
13
- moodle_password: string; // Password for Moodle account
14
-
15
- constructor(
16
- user_id: number,
17
- moodle_user_id: number,
18
- moodle_password: string
19
- ) {
20
- super();
21
- this.user_id = user_id;
22
- this.moodle_user_id = moodle_user_id;
23
- this.moodle_password = moodle_password;
24
- }
25
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+
4
+ @Entity({ name: "moodle_users" })
5
+ export class MoodleUsers extends BaseModel {
6
+ @Column({ type: "integer", nullable: false })
7
+ user_id: number; // Foreign key to users table
8
+
9
+ @Column({ type: "integer", nullable: false })
10
+ moodle_user_id: number; // Moodle user ID from Moodle system
11
+
12
+ @Column({ type: "varchar", length: 255, nullable: false })
13
+ moodle_password: string; // Password for Moodle account
14
+
15
+ constructor(
16
+ user_id: number,
17
+ moodle_user_id: number,
18
+ moodle_password: string
19
+ ) {
20
+ super();
21
+ this.user_id = user_id;
22
+ this.moodle_user_id = moodle_user_id;
23
+ this.moodle_password = moodle_password;
24
+ }
25
+ }
@@ -20,6 +20,9 @@ export class ServicesNotificationConfigs extends BaseModel {
20
20
  @Column({ type: "integer", nullable: true })
21
21
  sub_service_id: number | null;
22
22
 
23
+ @Column({ type: "integer", nullable: false })
24
+ role_id: number;
25
+
23
26
  @Column({
24
27
  type: "enum",
25
28
  enum: ServicesNotificationTriggerType,
@@ -36,6 +39,7 @@ export class ServicesNotificationConfigs extends BaseModel {
36
39
  section_id: number | null = null,
37
40
  service_id: number,
38
41
  sub_service_id: number | null = null,
42
+ role_id: number,
39
43
  trigger: ServicesNotificationTriggerType = ServicesNotificationTriggerType.FINAL_APPROVAL,
40
44
  is_active: boolean = true
41
45
  ) {
@@ -44,6 +48,7 @@ export class ServicesNotificationConfigs extends BaseModel {
44
48
  this.section_id = section_id;
45
49
  this.service_id = service_id;
46
50
  this.sub_service_id = sub_service_id;
51
+ this.role_id = role_id;
47
52
  this.trigger = trigger;
48
53
  this.is_active = is_active;
49
54
  }