@platform-modules/foreign-ministry 1.3.88 → 1.3.90

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,7 +1,8 @@
1
1
  import { BaseModel } from './BaseModel';
2
2
  export declare class TelephoneDirectory extends BaseModel {
3
3
  id: number;
4
- category: "FM" | "Embassy";
4
+ select_type: "personal" | "department" | "organization";
5
+ category: "FM" | "Embassy" | "M&C" | "external";
5
6
  name: string;
6
7
  position: string;
7
8
  diplomatic_title: string;
@@ -22,5 +23,5 @@ export declare class TelephoneDirectory extends BaseModel {
22
23
  photo_url: string;
23
24
  service_id: number;
24
25
  sub_service_id: number;
25
- constructor(category?: "FM" | "Embassy", name?: string, position?: string, diplomatic_title?: string, embassy_id?: number | null, contextual_search?: string | null, email?: string, contact_number?: string, extension_number?: string, fax_number?: string, location?: string, department_id?: number, employee_id?: number, street?: string, city?: string, state?: string, zip_code?: string, country?: string, photo_url?: string, service_id?: number, sub_service_id?: number);
26
+ constructor(select_type?: "personal" | "department" | "organization", category?: "FM" | "Embassy" | "M&C" | "external", name?: string, position?: string, diplomatic_title?: string, embassy_id?: number | null, contextual_search?: string | null, email?: string, contact_number?: string, extension_number?: string, fax_number?: string, location?: string, department_id?: number, employee_id?: number, street?: string, city?: string, state?: string, zip_code?: string, country?: string, photo_url?: string, service_id?: number, sub_service_id?: number);
26
27
  }
@@ -13,8 +13,9 @@ exports.TelephoneDirectory = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
15
  let TelephoneDirectory = class TelephoneDirectory extends BaseModel_1.BaseModel {
16
- constructor(category, name, position, diplomatic_title, embassy_id, contextual_search, email, contact_number, extension_number, fax_number, location, department_id, employee_id, street, city, state, zip_code, country, photo_url, service_id, sub_service_id) {
16
+ constructor(select_type, category, name, position, diplomatic_title, embassy_id, contextual_search, email, contact_number, extension_number, fax_number, location, department_id, employee_id, street, city, state, zip_code, country, photo_url, service_id, sub_service_id) {
17
17
  super();
18
+ this.select_type = select_type || "personal";
18
19
  this.category = category || "FM";
19
20
  this.name = name || "";
20
21
  this.position = position || "";
@@ -44,11 +45,15 @@ __decorate([
44
45
  __metadata("design:type", Number)
45
46
  ], TelephoneDirectory.prototype, "id", void 0);
46
47
  __decorate([
47
- (0, typeorm_1.Column)({ type: "enum", enum: ["FM", "Embassy", "M&C"], nullable: false }),
48
+ (0, typeorm_1.Column)({ type: "enum", enum: ["personal", "department", "organization"], default: "personal", nullable: false }),
49
+ __metadata("design:type", String)
50
+ ], TelephoneDirectory.prototype, "select_type", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ type: "enum", enum: ["FM", "Embassy", "M&C", "external"], nullable: false }),
48
53
  __metadata("design:type", String)
49
54
  ], TelephoneDirectory.prototype, "category", void 0);
50
55
  __decorate([
51
- (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: false }),
56
+ (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
52
57
  __metadata("design:type", String)
53
58
  ], TelephoneDirectory.prototype, "name", void 0);
54
59
  __decorate([
@@ -129,5 +134,5 @@ __decorate([
129
134
  ], TelephoneDirectory.prototype, "sub_service_id", void 0);
130
135
  exports.TelephoneDirectory = TelephoneDirectory = __decorate([
131
136
  (0, typeorm_1.Entity)({ name: "telephone_directory" }),
132
- __metadata("design:paramtypes", [String, String, String, String, Object, Object, String, String, String, String, String, Number, Number, String, String, String, String, String, String, Number, Number])
137
+ __metadata("design:paramtypes", [String, String, String, String, String, Object, Object, String, String, String, String, String, Number, Number, String, String, String, String, String, String, Number, Number])
133
138
  ], TelephoneDirectory);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/foreign-ministry",
3
- "version": "1.3.88",
3
+ "version": "1.3.90",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -6,12 +6,16 @@ export class TelephoneDirectory extends BaseModel {
6
6
  @PrimaryGeneratedColumn()
7
7
  id: number;
8
8
 
9
+ // Select Type - determines validation rules
10
+ @Column({ type: "enum", enum: ["personal", "department", "organization"], default: "personal", nullable: false })
11
+ select_type: "personal" | "department" | "organization";
12
+
9
13
  // General Information
10
- @Column({ type: "enum", enum: ["FM", "Embassy","M&C"], nullable: false })
11
- category: "FM" | "Embassy"; // Mandatory - to differentiate FM and Embassy
14
+ @Column({ type: "enum", enum: ["FM", "Embassy", "M&C", "external"], nullable: false })
15
+ category: "FM" | "Embassy" | "M&C" | "external"; // external for department/organization types
12
16
 
13
- @Column({ type: "varchar", length: 255, nullable: false })
14
- name: string;
17
+ @Column({ type: "varchar", length: 255, nullable: true })
18
+ name: string; // Required for personal, optional for department/organization
15
19
 
16
20
  @Column({ type: "varchar", length: 255, nullable: true })
17
21
  position: string; // Position/Title
@@ -74,8 +78,9 @@ export class TelephoneDirectory extends BaseModel {
74
78
  @Column({ type: "int", nullable: true })
75
79
  sub_service_id: number;
76
80
 
77
- constructor(category?: "FM" | "Embassy", name?: string, position?: string, diplomatic_title?: string, embassy_id?: number | null, contextual_search?: string | null, email?: string, contact_number?: string, extension_number?: string, fax_number?: string, location?: string, department_id?: number, employee_id?: number, street?: string, city?: string, state?: string, zip_code?: string, country?: string, photo_url?: string, service_id?: number, sub_service_id?: number) {
81
+ constructor(select_type?: "personal" | "department" | "organization", category?: "FM" | "Embassy" | "M&C" | "external", name?: string, position?: string, diplomatic_title?: string, embassy_id?: number | null, contextual_search?: string | null, email?: string, contact_number?: string, extension_number?: string, fax_number?: string, location?: string, department_id?: number, employee_id?: number, street?: string, city?: string, state?: string, zip_code?: string, country?: string, photo_url?: string, service_id?: number, sub_service_id?: number) {
78
82
  super();
83
+ this.select_type = select_type || "personal";
79
84
  this.category = category || "FM";
80
85
  this.name = name || "";
81
86
  this.position = position || "";