@platform-modules/foreign-ministry 1.3.128 → 1.3.130

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.
@@ -163,6 +163,7 @@ const SecurityAttachmentsModel_1 = require("./models/SecurityAttachmentsModel");
163
163
  const SecurityChatsModel_1 = require("./models/SecurityChatsModel");
164
164
  const MissionTravelPassportExpiryNotificationConfigModel_1 = require("./models/MissionTravelPassportExpiryNotificationConfigModel");
165
165
  const ServicesNotificationConfigsModel_1 = require("./models/ServicesNotificationConfigsModel");
166
+ const MoodleUsersModel_1 = require("./models/MoodleUsersModel");
166
167
  exports.AppDataSource = new typeorm_1.DataSource({
167
168
  type: 'postgres',
168
169
  host: process.env.DB_HOST || 'localhost',
@@ -330,6 +331,7 @@ exports.AppDataSource = new typeorm_1.DataSource({
330
331
  SecurityAttachmentsModel_1.SecurityAttachment,
331
332
  SecurityChatsModel_1.SecurityChat,
332
333
  MissionTravelPassportExpiryNotificationConfigModel_1.MissionTravelPassportExpiryNotificationConfig,
333
- ServicesNotificationConfigsModel_1.ServicesNotificationConfigs
334
+ ServicesNotificationConfigsModel_1.ServicesNotificationConfigs,
335
+ MoodleUsersModel_1.MoodleUsers
334
336
  ],
335
337
  });
package/dist/index.d.ts CHANGED
@@ -259,3 +259,4 @@ export * from './models/EmployeeMilestoneDetailsModel';
259
259
  export * from './models/MissionTravelPassportExpiryNotificationConfigModel';
260
260
  export * from './models/ServicesNotificationConfigsModel';
261
261
  export { ServicesNotificationTriggerType } from './models/ServicesNotificationConfigsModel';
262
+ export * from './models/MoodleUsersModel';
package/dist/index.js CHANGED
@@ -321,3 +321,5 @@ __exportStar(require("./models/MissionTravelPassportExpiryNotificationConfigMode
321
321
  __exportStar(require("./models/ServicesNotificationConfigsModel"), exports);
322
322
  var ServicesNotificationConfigsModel_1 = require("./models/ServicesNotificationConfigsModel");
323
323
  Object.defineProperty(exports, "ServicesNotificationTriggerType", { enumerable: true, get: function () { return ServicesNotificationConfigsModel_1.ServicesNotificationTriggerType; } });
324
+ // Moodle Users Model
325
+ __exportStar(require("./models/MoodleUsersModel"), exports);
@@ -0,0 +1,7 @@
1
+ import { BaseModel } from "./BaseModel";
2
+ export declare class MoodleUsers extends BaseModel {
3
+ user_id: number;
4
+ moodle_user_id: number;
5
+ moodle_password: string;
6
+ constructor(user_id: number, moodle_user_id: number, moodle_password: string);
7
+ }
@@ -0,0 +1,39 @@
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.MoodleUsers = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ let MoodleUsers = class MoodleUsers extends BaseModel_1.BaseModel {
16
+ constructor(user_id, moodle_user_id, moodle_password) {
17
+ super();
18
+ this.user_id = user_id;
19
+ this.moodle_user_id = moodle_user_id;
20
+ this.moodle_password = moodle_password;
21
+ }
22
+ };
23
+ exports.MoodleUsers = MoodleUsers;
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: "integer", nullable: false }),
26
+ __metadata("design:type", Number)
27
+ ], MoodleUsers.prototype, "user_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: "integer", nullable: false }),
30
+ __metadata("design:type", Number)
31
+ ], MoodleUsers.prototype, "moodle_user_id", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: false }),
34
+ __metadata("design:type", String)
35
+ ], MoodleUsers.prototype, "moodle_password", void 0);
36
+ exports.MoodleUsers = MoodleUsers = __decorate([
37
+ (0, typeorm_1.Entity)({ name: "moodle_users" }),
38
+ __metadata("design:paramtypes", [Number, Number, String])
39
+ ], MoodleUsers);
@@ -6,7 +6,9 @@ export declare enum ServicesNotificationTriggerType {
6
6
  export declare class ServicesNotificationConfigs extends BaseModel {
7
7
  department_id: number;
8
8
  section_id: number | null;
9
+ service_id: number;
10
+ sub_service_id: number | null;
9
11
  trigger: ServicesNotificationTriggerType;
10
12
  is_active: boolean;
11
- constructor(department_id: number, section_id?: number | null, trigger?: ServicesNotificationTriggerType, 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);
12
14
  }
@@ -18,10 +18,12 @@ 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, trigger = ServicesNotificationTriggerType.FINAL_APPROVAL, is_active = true) {
21
+ constructor(department_id, section_id = null, service_id, sub_service_id = null, 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
+ this.service_id = service_id;
26
+ this.sub_service_id = sub_service_id;
25
27
  this.trigger = trigger;
26
28
  this.is_active = is_active;
27
29
  }
@@ -35,6 +37,14 @@ __decorate([
35
37
  (0, typeorm_1.Column)({ type: "integer", nullable: true }),
36
38
  __metadata("design:type", Object)
37
39
  ], ServicesNotificationConfigs.prototype, "section_id", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ type: "integer", nullable: false }),
42
+ __metadata("design:type", Number)
43
+ ], ServicesNotificationConfigs.prototype, "service_id", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ type: "integer", nullable: true }),
46
+ __metadata("design:type", Object)
47
+ ], ServicesNotificationConfigs.prototype, "sub_service_id", void 0);
38
48
  __decorate([
39
49
  (0, typeorm_1.Column)({
40
50
  type: "enum",
@@ -50,5 +60,5 @@ __decorate([
50
60
  ], ServicesNotificationConfigs.prototype, "is_active", void 0);
51
61
  exports.ServicesNotificationConfigs = ServicesNotificationConfigs = __decorate([
52
62
  (0, typeorm_1.Entity)({ name: "services_notification_configs" }),
53
- __metadata("design:paramtypes", [Number, Object, String, Boolean])
63
+ __metadata("design:paramtypes", [Number, Object, Number, Object, String, Boolean])
54
64
  ], ServicesNotificationConfigs);
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "name": "@platform-modules/foreign-ministry",
3
- "version": "1.3.128",
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.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
+ }
@@ -169,6 +169,7 @@ import { SecurityAttachment } from './models/SecurityAttachmentsModel';
169
169
  import { SecurityChat } from './models/SecurityChatsModel';
170
170
  import { MissionTravelPassportExpiryNotificationConfig } from './models/MissionTravelPassportExpiryNotificationConfigModel';
171
171
  import { ServicesNotificationConfigs } from './models/ServicesNotificationConfigsModel';
172
+ import { MoodleUsers } from './models/MoodleUsersModel';
172
173
 
173
174
 
174
175
  export const AppDataSource = new DataSource({
@@ -338,6 +339,7 @@ export const AppDataSource = new DataSource({
338
339
  SecurityAttachment,
339
340
  SecurityChat,
340
341
  MissionTravelPassportExpiryNotificationConfig,
341
- ServicesNotificationConfigs
342
+ ServicesNotificationConfigs,
343
+ MoodleUsers
342
344
  ],
343
345
  });
package/src/index.ts CHANGED
@@ -268,4 +268,6 @@ export * from './models/EmployeeMilestoneDetailsModel';
268
268
  // Notification Config Models
269
269
  export * from './models/MissionTravelPassportExpiryNotificationConfigModel';
270
270
  export * from './models/ServicesNotificationConfigsModel';
271
- export { ServicesNotificationTriggerType } from './models/ServicesNotificationConfigsModel';
271
+ export { ServicesNotificationTriggerType } from './models/ServicesNotificationConfigsModel';
272
+ // Moodle Users Model
273
+ export * from './models/MoodleUsersModel';
@@ -0,0 +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,40 +1,50 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
-
4
- export enum ServicesNotificationTriggerType {
5
- FINAL_APPROVAL = "final_approval",
6
- EVERY_APPROVAL = "every_approval"
7
- }
8
-
9
- @Entity({ name: "services_notification_configs" })
10
- export class ServicesNotificationConfigs extends BaseModel {
11
- @Column({ type: "integer", nullable: false })
12
- department_id: number;
13
-
14
- @Column({ type: "integer", nullable: true })
15
- section_id: number | null;
16
-
17
- @Column({
18
- type: "enum",
19
- enum: ServicesNotificationTriggerType,
20
- nullable: false,
21
- default: ServicesNotificationTriggerType.FINAL_APPROVAL
22
- })
23
- trigger: ServicesNotificationTriggerType;
24
-
25
- @Column({ type: "boolean", nullable: false, default: true })
26
- is_active: boolean;
27
-
28
- constructor(
29
- department_id: number,
30
- section_id: number | null = null,
31
- trigger: ServicesNotificationTriggerType = ServicesNotificationTriggerType.FINAL_APPROVAL,
32
- is_active: boolean = true
33
- ) {
34
- super();
35
- this.department_id = department_id;
36
- this.section_id = section_id;
37
- this.trigger = trigger;
38
- this.is_active = is_active;
39
- }
40
- }
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+
4
+ export enum ServicesNotificationTriggerType {
5
+ FINAL_APPROVAL = "final_approval",
6
+ EVERY_APPROVAL = "every_approval"
7
+ }
8
+
9
+ @Entity({ name: "services_notification_configs" })
10
+ export class ServicesNotificationConfigs extends BaseModel {
11
+ @Column({ type: "integer", nullable: false })
12
+ department_id: number;
13
+
14
+ @Column({ type: "integer", nullable: true })
15
+ section_id: number | null;
16
+
17
+ @Column({ type: "integer", nullable: false })
18
+ service_id: number;
19
+
20
+ @Column({ type: "integer", nullable: true })
21
+ sub_service_id: number | null;
22
+
23
+ @Column({
24
+ type: "enum",
25
+ enum: ServicesNotificationTriggerType,
26
+ nullable: false,
27
+ default: ServicesNotificationTriggerType.FINAL_APPROVAL
28
+ })
29
+ trigger: ServicesNotificationTriggerType;
30
+
31
+ @Column({ type: "boolean", nullable: false, default: true })
32
+ is_active: boolean;
33
+
34
+ constructor(
35
+ department_id: number,
36
+ section_id: number | null = null,
37
+ service_id: number,
38
+ sub_service_id: number | null = null,
39
+ trigger: ServicesNotificationTriggerType = ServicesNotificationTriggerType.FINAL_APPROVAL,
40
+ is_active: boolean = true
41
+ ) {
42
+ super();
43
+ this.department_id = department_id;
44
+ this.section_id = section_id;
45
+ this.service_id = service_id;
46
+ this.sub_service_id = sub_service_id;
47
+ this.trigger = trigger;
48
+ this.is_active = is_active;
49
+ }
50
+ }