@platform-modules/foreign-ministry 1.3.265 → 1.3.270

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.
@@ -0,0 +1,36 @@
1
+ import { Column, Entity, JoinColumn, ManyToOne, Unique } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+ import { AnnualTravelTicketPriceConfiguration } from './AnnualTravelTicketPriceConfigurationModel';
4
+
5
+ /**
6
+ * Individual price slab within an annual travel ticket pricing configuration.
7
+ * age_from is inclusive and age_to is exclusive to allow adjacent ranges.
8
+ */
9
+ @Entity({ name: 'annual_travel_ticket_price_configuration_items' })
10
+ @Unique(['configuration_id', 'ticket_class', 'age_from', 'age_to'])
11
+ export class AnnualTravelTicketPriceConfigurationItem extends BaseModel {
12
+ @Column({ type: 'int', nullable: false })
13
+ configuration_id: number;
14
+
15
+ @ManyToOne(() => AnnualTravelTicketPriceConfiguration, (configuration) => configuration.price_slabs, { onDelete: 'CASCADE' })
16
+ @JoinColumn({ name: 'configuration_id' })
17
+ configuration: AnnualTravelTicketPriceConfiguration;
18
+
19
+ @Column({ type: 'varchar', length: 100, nullable: true })
20
+ ticket_class: string | null;
21
+
22
+ @Column({ type: 'int', nullable: false })
23
+ age_from: number;
24
+
25
+ @Column({ type: 'int', nullable: false })
26
+ age_to: number;
27
+
28
+ @Column({ type: 'decimal', precision: 12, scale: 2, nullable: false })
29
+ price: number | string;
30
+
31
+ @Column({ type: 'varchar', length: 10, nullable: true, default: 'OMR' })
32
+ currency_code: string | null;
33
+
34
+ @Column({ type: 'text', nullable: true })
35
+ notes: string | null;
36
+ }
@@ -0,0 +1,35 @@
1
+ import { Column, Entity, OneToMany, Unique } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+ import { AnnualTravelTicketPriceConfigurationItem } from './AnnualTravelTicketPriceConfigurationItemModel';
4
+
5
+ /**
6
+ * Admin configuration for annual travel ticket pricing.
7
+ * One record per year (and optional service/sub-service pair), with multiple age slabs.
8
+ */
9
+ @Entity({ name: 'annual_travel_ticket_price_configurations' })
10
+ @Unique(['service_id', 'sub_service_id', 'ticket_year'])
11
+ export class AnnualTravelTicketPriceConfiguration extends BaseModel {
12
+ @Column({ type: 'int', nullable: true })
13
+ service_id: number | null;
14
+
15
+ @Column({ type: 'int', nullable: true })
16
+ sub_service_id: number | null;
17
+
18
+ @Column({ type: 'int', nullable: false })
19
+ ticket_year: number;
20
+
21
+ @Column({ type: 'varchar', length: 255, nullable: true })
22
+ configuration_name: string | null;
23
+
24
+ @Column({ type: 'varchar', length: 10, nullable: true, default: 'OMR' })
25
+ currency_code: string | null;
26
+
27
+ @Column({ type: 'text', nullable: true })
28
+ description: string | null;
29
+
30
+ @Column({ type: 'boolean', default: true, nullable: false })
31
+ is_active: boolean;
32
+
33
+ @OneToMany(() => AnnualTravelTicketPriceConfigurationItem, (item) => item.configuration)
34
+ price_slabs?: AnnualTravelTicketPriceConfigurationItem[];
35
+ }
@@ -6,6 +6,14 @@ export enum AnnualTravelTicketPermanentResidence {
6
6
  MUSANDAM = 'Musandam',
7
7
  }
8
8
 
9
+ export interface AnnualTravelTicketFamilyDetail {
10
+ person_name: string;
11
+ relation: string;
12
+ age: number;
13
+ age_category: string;
14
+ price: number | string;
15
+ }
16
+
9
17
  /** Aligns with mission bank account request lifecycle for shared workflow UI. */
10
18
  export enum AnnualTravelTicketRequestStatus {
11
19
  PENDING = 'Pending',
@@ -42,37 +50,21 @@ export class AnnualTravelTicketRequests extends BaseModel {
42
50
  @Column({ type: 'enum', enum: AnnualTravelTicketPermanentResidence, nullable: false })
43
51
  permanent_residence: AnnualTravelTicketPermanentResidence;
44
52
 
45
- /** Free-text family context (dependents covered by the request). */
46
- @Column({ type: 'text', nullable: true })
47
- family_details: string | null;
48
-
49
- @Column({ type: 'decimal', precision: 12, scale: 2, nullable: true })
50
- children_ticket_price: string | number | null;
51
-
52
- @Column({ type: 'decimal', precision: 12, scale: 2, nullable: true })
53
- employee_spouse_ticket_price: string | number | null;
53
+ /** Traveler list with person name, relation, age, age category, and price. */
54
+ @Column({ type: 'jsonb', nullable: true })
55
+ family_details: AnnualTravelTicketFamilyDetail[] | null;
54
56
 
55
57
  @Column({ type: 'varchar', length: 100, nullable: false })
56
58
  bank_account_number: string;
57
59
 
58
- @Column({ type: 'text', nullable: false })
59
- travel_details: string;
60
-
61
- /** Calendar year this entitlement applies to (one ticket per person per year). */
62
- @Column({ type: 'int', nullable: false })
63
- ticket_entitlement_year: number;
64
-
65
- /** Optional structured travelers (e.g. children) for age rules; JSON array. */
66
- @Column({ type: 'jsonb', nullable: true })
67
- children_travelers_json: Record<string, unknown>[] | null;
60
+ @Column({ type: 'varchar', length: 255, nullable: false })
61
+ travel_from: string;
68
62
 
69
- /** Client confirms dependents match HR/profile before submit. */
70
- @Column({ type: 'boolean', default: false, nullable: false })
71
- profile_children_synced_with_profile: boolean;
63
+ @Column({ type: 'varchar', length: 255, nullable: false })
64
+ travel_to: string;
72
65
 
73
- /** Notes on unused ticket carry-forward (max 7 years; children until age 21). */
74
- @Column({ type: 'text', nullable: true })
75
- carry_forward_notes: string | null;
66
+ @Column({ type: 'date', nullable: false })
67
+ date_of_travel: string;
76
68
 
77
69
  @Column({
78
70
  type: 'enum',
@@ -0,0 +1,45 @@
1
+ import { Column, Entity, JoinColumn, ManyToOne, OneToMany } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ /**
5
+ * Department/section/month evaluation window: which employees are excluded or re-included
6
+ * for that cycle (e.g. excluded in January, eligible again in May via a different month row).
7
+ */
8
+ @Entity({ name: 'evaluation_eligibility_settings' })
9
+ export class EvaluationEligibilitySetting extends BaseModel {
10
+ @Column({ name: 'department_id', type: 'int' })
11
+ departmentId: number;
12
+
13
+ @Column({ name: 'section_id', type: 'int' })
14
+ sectionId: number;
15
+
16
+ /** Calendar month 1–12 */
17
+ @Column({ type: 'int' })
18
+ month: number;
19
+
20
+ @Column({ name: 'evaluation_end_date', type: 'date' })
21
+ evaluationEndDate: Date;
22
+
23
+ @Column({ name: 'is_active', type: 'boolean', default: true })
24
+ isActive: boolean;
25
+
26
+ @OneToMany(() => EvaluationEligibilitySettingEmployee, (e) => e.setting)
27
+ employees?: EvaluationEligibilitySettingEmployee[];
28
+ }
29
+
30
+ @Entity({ name: 'evaluation_eligibility_setting_employees' })
31
+ export class EvaluationEligibilitySettingEmployee extends BaseModel {
32
+ @Column({ name: 'setting_id', type: 'int' })
33
+ settingId: number;
34
+
35
+ @ManyToOne(() => EvaluationEligibilitySetting, (s) => s.employees, { onDelete: 'CASCADE' })
36
+ @JoinColumn({ name: 'setting_id' })
37
+ setting: EvaluationEligibilitySetting;
38
+
39
+ @Column({ name: 'employee_id', type: 'int' })
40
+ employeeId: number;
41
+
42
+ /** When true, employee is excluded from evaluation for this setting’s month/department/section. */
43
+ @Column({ name: 'is_excluded_from_evaluation', type: 'boolean', default: true })
44
+ isExcludedFromEvaluation: boolean;
45
+ }
@@ -1,25 +0,0 @@
1
- import { Column, Entity } from 'typeorm';
2
- import { BaseModel } from './BaseModel';
3
-
4
- @Entity({ name: 'ineligible_for_evaluation' })
5
- export class IneligibleForEvaluation extends BaseModel {
6
- @Column({ name: 'employee_id', type: 'int' })
7
- employeeId: number;
8
-
9
- @Column({ type: 'varchar', length: 255 })
10
- leave_type: string;
11
-
12
- @Column({ type: 'boolean', default: true })
13
- is_active: boolean;
14
-
15
- @Column({ type: 'int' })
16
- year: number;
17
-
18
- constructor(employeeId: number, leave_type: string, is_active: boolean, year: number) {
19
- super();
20
- this.employeeId = employeeId;
21
- this.leave_type = leave_type;
22
- this.is_active = is_active;
23
- this.year = year;
24
- }
25
- }