@platform-modules/foreign-ministry 1.3.262 → 1.3.266

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.
@@ -65,6 +65,9 @@ const SalaryCertificateRequestsModel_1 = require("./models/SalaryCertificateRequ
65
65
  const AllowanceRequestsModel_1 = require("./models/AllowanceRequestsModel");
66
66
  const ReimbursementRequestsModel_1 = require("./models/ReimbursementRequestsModel");
67
67
  const BankAccountChangeRequestsModel_1 = require("./models/BankAccountChangeRequestsModel");
68
+ const AnnualTravelTicketRequestModel_1 = require("./models/AnnualTravelTicketRequestModel");
69
+ const AnnualTravelTicketPriceConfigurationModel_1 = require("./models/AnnualTravelTicketPriceConfigurationModel");
70
+ const AnnualTravelTicketPriceConfigurationItemModel_1 = require("./models/AnnualTravelTicketPriceConfigurationItemModel");
68
71
  const FinancialChatsModel_1 = require("./models/FinancialChatsModel");
69
72
  const FinancialWorkFlowModel_1 = require("./models/FinancialWorkFlowModel");
70
73
  const FinancialAttachmentsModel_1 = require("./models/FinancialAttachmentsModel");
@@ -349,6 +352,9 @@ exports.AppDataSource = new typeorm_1.DataSource({
349
352
  AllowanceRequestsModel_1.AllowanceRequests,
350
353
  ReimbursementRequestsModel_1.ReimbursementRequests,
351
354
  BankAccountChangeRequestsModel_1.BankAccountChangeRequests,
355
+ AnnualTravelTicketRequestModel_1.AnnualTravelTicketRequests,
356
+ AnnualTravelTicketPriceConfigurationModel_1.AnnualTravelTicketPriceConfiguration,
357
+ AnnualTravelTicketPriceConfigurationItemModel_1.AnnualTravelTicketPriceConfigurationItem,
352
358
  FinancialChatsModel_1.FinancialChats,
353
359
  FinancialWorkFlowModel_1.FinancialWorkFlow,
354
360
  FinancialAttachmentsModel_1.FinancialAttachments,
package/dist/index.d.ts CHANGED
@@ -81,6 +81,8 @@ export * from './models/MissionBankAccountAttachmentModel';
81
81
  export * from './models/MissionBankAccountChatModel';
82
82
  export * from './models/MissionBankAccountWorkflowModel';
83
83
  export * from './models/AnnualTravelTicketRequestModel';
84
+ export * from './models/AnnualTravelTicketPriceConfigurationModel';
85
+ export * from './models/AnnualTravelTicketPriceConfigurationItemModel';
84
86
  export * from './models/AmbassadorSpecialAccountAmountRequestModel';
85
87
  export * from './models/StayAfterHoursRequestModel';
86
88
  export * from './models/StayAfterHoursApprovalModel';
package/dist/index.js CHANGED
@@ -98,6 +98,8 @@ __exportStar(require("./models/MissionBankAccountAttachmentModel"), exports);
98
98
  __exportStar(require("./models/MissionBankAccountChatModel"), exports);
99
99
  __exportStar(require("./models/MissionBankAccountWorkflowModel"), exports);
100
100
  __exportStar(require("./models/AnnualTravelTicketRequestModel"), exports);
101
+ __exportStar(require("./models/AnnualTravelTicketPriceConfigurationModel"), exports);
102
+ __exportStar(require("./models/AnnualTravelTicketPriceConfigurationItemModel"), exports);
101
103
  __exportStar(require("./models/AmbassadorSpecialAccountAmountRequestModel"), exports);
102
104
  __exportStar(require("./models/StayAfterHoursRequestModel"), exports);
103
105
  __exportStar(require("./models/StayAfterHoursApprovalModel"), exports);
@@ -0,0 +1,16 @@
1
+ import { BaseModel } from './BaseModel';
2
+ import { AnnualTravelTicketPriceConfiguration } from './AnnualTravelTicketPriceConfigurationModel';
3
+ /**
4
+ * Individual price slab within an annual travel ticket pricing configuration.
5
+ * age_from is inclusive and age_to is exclusive to allow adjacent ranges.
6
+ */
7
+ export declare class AnnualTravelTicketPriceConfigurationItem extends BaseModel {
8
+ configuration_id: number;
9
+ configuration: AnnualTravelTicketPriceConfiguration;
10
+ ticket_class: string | null;
11
+ age_from: number;
12
+ age_to: number;
13
+ price: number | string;
14
+ currency_code: string | null;
15
+ notes: string | null;
16
+ }
@@ -0,0 +1,59 @@
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.AnnualTravelTicketPriceConfigurationItem = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ const AnnualTravelTicketPriceConfigurationModel_1 = require("./AnnualTravelTicketPriceConfigurationModel");
16
+ /**
17
+ * Individual price slab within an annual travel ticket pricing configuration.
18
+ * age_from is inclusive and age_to is exclusive to allow adjacent ranges.
19
+ */
20
+ let AnnualTravelTicketPriceConfigurationItem = class AnnualTravelTicketPriceConfigurationItem extends BaseModel_1.BaseModel {
21
+ };
22
+ exports.AnnualTravelTicketPriceConfigurationItem = AnnualTravelTicketPriceConfigurationItem;
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
25
+ __metadata("design:type", Number)
26
+ ], AnnualTravelTicketPriceConfigurationItem.prototype, "configuration_id", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.ManyToOne)(() => AnnualTravelTicketPriceConfigurationModel_1.AnnualTravelTicketPriceConfiguration, (configuration) => configuration.price_slabs, { onDelete: 'CASCADE' }),
29
+ (0, typeorm_1.JoinColumn)({ name: 'configuration_id' }),
30
+ __metadata("design:type", AnnualTravelTicketPriceConfigurationModel_1.AnnualTravelTicketPriceConfiguration)
31
+ ], AnnualTravelTicketPriceConfigurationItem.prototype, "configuration", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
34
+ __metadata("design:type", Object)
35
+ ], AnnualTravelTicketPriceConfigurationItem.prototype, "ticket_class", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
38
+ __metadata("design:type", Number)
39
+ ], AnnualTravelTicketPriceConfigurationItem.prototype, "age_from", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
42
+ __metadata("design:type", Number)
43
+ ], AnnualTravelTicketPriceConfigurationItem.prototype, "age_to", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ type: 'decimal', precision: 12, scale: 2, nullable: false }),
46
+ __metadata("design:type", Object)
47
+ ], AnnualTravelTicketPriceConfigurationItem.prototype, "price", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ type: 'varchar', length: 10, nullable: true, default: 'OMR' }),
50
+ __metadata("design:type", Object)
51
+ ], AnnualTravelTicketPriceConfigurationItem.prototype, "currency_code", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
54
+ __metadata("design:type", Object)
55
+ ], AnnualTravelTicketPriceConfigurationItem.prototype, "notes", void 0);
56
+ exports.AnnualTravelTicketPriceConfigurationItem = AnnualTravelTicketPriceConfigurationItem = __decorate([
57
+ (0, typeorm_1.Entity)({ name: 'annual_travel_ticket_price_configuration_items' }),
58
+ (0, typeorm_1.Unique)(['configuration_id', 'ticket_class', 'age_from', 'age_to'])
59
+ ], AnnualTravelTicketPriceConfigurationItem);
@@ -0,0 +1,16 @@
1
+ import { BaseModel } from './BaseModel';
2
+ import { AnnualTravelTicketPriceConfigurationItem } from './AnnualTravelTicketPriceConfigurationItemModel';
3
+ /**
4
+ * Admin configuration for annual travel ticket pricing.
5
+ * One record per year (and optional service/sub-service pair), with multiple age slabs.
6
+ */
7
+ export declare class AnnualTravelTicketPriceConfiguration extends BaseModel {
8
+ service_id: number | null;
9
+ sub_service_id: number | null;
10
+ ticket_year: number;
11
+ configuration_name: string | null;
12
+ currency_code: string | null;
13
+ description: string | null;
14
+ is_active: boolean;
15
+ price_slabs?: AnnualTravelTicketPriceConfigurationItem[];
16
+ }
@@ -0,0 +1,58 @@
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.AnnualTravelTicketPriceConfiguration = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ const AnnualTravelTicketPriceConfigurationItemModel_1 = require("./AnnualTravelTicketPriceConfigurationItemModel");
16
+ /**
17
+ * Admin configuration for annual travel ticket pricing.
18
+ * One record per year (and optional service/sub-service pair), with multiple age slabs.
19
+ */
20
+ let AnnualTravelTicketPriceConfiguration = class AnnualTravelTicketPriceConfiguration extends BaseModel_1.BaseModel {
21
+ };
22
+ exports.AnnualTravelTicketPriceConfiguration = AnnualTravelTicketPriceConfiguration;
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
25
+ __metadata("design:type", Object)
26
+ ], AnnualTravelTicketPriceConfiguration.prototype, "service_id", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
29
+ __metadata("design:type", Object)
30
+ ], AnnualTravelTicketPriceConfiguration.prototype, "sub_service_id", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
33
+ __metadata("design:type", Number)
34
+ ], AnnualTravelTicketPriceConfiguration.prototype, "ticket_year", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
37
+ __metadata("design:type", Object)
38
+ ], AnnualTravelTicketPriceConfiguration.prototype, "configuration_name", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ type: 'varchar', length: 10, nullable: true, default: 'OMR' }),
41
+ __metadata("design:type", Object)
42
+ ], AnnualTravelTicketPriceConfiguration.prototype, "currency_code", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
45
+ __metadata("design:type", Object)
46
+ ], AnnualTravelTicketPriceConfiguration.prototype, "description", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ type: 'boolean', default: true, nullable: false }),
49
+ __metadata("design:type", Boolean)
50
+ ], AnnualTravelTicketPriceConfiguration.prototype, "is_active", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.OneToMany)(() => AnnualTravelTicketPriceConfigurationItemModel_1.AnnualTravelTicketPriceConfigurationItem, (item) => item.configuration),
53
+ __metadata("design:type", Array)
54
+ ], AnnualTravelTicketPriceConfiguration.prototype, "price_slabs", void 0);
55
+ exports.AnnualTravelTicketPriceConfiguration = AnnualTravelTicketPriceConfiguration = __decorate([
56
+ (0, typeorm_1.Entity)({ name: 'annual_travel_ticket_price_configurations' }),
57
+ (0, typeorm_1.Unique)(['service_id', 'sub_service_id', 'ticket_year'])
58
+ ], AnnualTravelTicketPriceConfiguration);
@@ -3,6 +3,13 @@ export declare enum AnnualTravelTicketPermanentResidence {
3
3
  SALALAH = "Salalah",
4
4
  MUSANDAM = "Musandam"
5
5
  }
6
+ export interface AnnualTravelTicketFamilyDetail {
7
+ person_name: string;
8
+ relation: string;
9
+ age: number;
10
+ age_category: string;
11
+ price: number | string;
12
+ }
6
13
  /** Aligns with mission bank account request lifecycle for shared workflow UI. */
7
14
  export declare enum AnnualTravelTicketRequestStatus {
8
15
  PENDING = "Pending",
@@ -21,20 +28,12 @@ export declare class AnnualTravelTicketRequests extends BaseModel {
21
28
  applicant_name: string;
22
29
  civil_id_or_passport_number: string;
23
30
  permanent_residence: AnnualTravelTicketPermanentResidence;
24
- /** Free-text family context (dependents covered by the request). */
25
- family_details: string | null;
26
- children_ticket_price: string | number | null;
27
- employee_spouse_ticket_price: string | number | null;
31
+ /** Traveler list with person name, relation, age, age category, and price. */
32
+ family_details: AnnualTravelTicketFamilyDetail[] | null;
28
33
  bank_account_number: string;
29
- travel_details: string;
30
- /** Calendar year this entitlement applies to (one ticket per person per year). */
31
- ticket_entitlement_year: number;
32
- /** Optional structured travelers (e.g. children) for age rules; JSON array. */
33
- children_travelers_json: Record<string, unknown>[] | null;
34
- /** Client confirms dependents match HR/profile before submit. */
35
- profile_children_synced_with_profile: boolean;
36
- /** Notes on unused ticket carry-forward (max 7 years; children until age 21). */
37
- carry_forward_notes: string | null;
34
+ travel_from: string;
35
+ travel_to: string;
36
+ date_of_travel: string;
38
37
  status: AnnualTravelTicketRequestStatus;
39
38
  workflow_execution_id: string | null;
40
39
  }
@@ -62,41 +62,25 @@ __decorate([
62
62
  __metadata("design:type", String)
63
63
  ], AnnualTravelTicketRequests.prototype, "permanent_residence", void 0);
64
64
  __decorate([
65
- (0, typeorm_1.Column)({ type: 'text', nullable: true }),
65
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
66
66
  __metadata("design:type", Object)
67
67
  ], AnnualTravelTicketRequests.prototype, "family_details", void 0);
68
- __decorate([
69
- (0, typeorm_1.Column)({ type: 'decimal', precision: 12, scale: 2, nullable: true }),
70
- __metadata("design:type", Object)
71
- ], AnnualTravelTicketRequests.prototype, "children_ticket_price", void 0);
72
- __decorate([
73
- (0, typeorm_1.Column)({ type: 'decimal', precision: 12, scale: 2, nullable: true }),
74
- __metadata("design:type", Object)
75
- ], AnnualTravelTicketRequests.prototype, "employee_spouse_ticket_price", void 0);
76
68
  __decorate([
77
69
  (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: false }),
78
70
  __metadata("design:type", String)
79
71
  ], AnnualTravelTicketRequests.prototype, "bank_account_number", void 0);
80
72
  __decorate([
81
- (0, typeorm_1.Column)({ type: 'text', nullable: false }),
73
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
82
74
  __metadata("design:type", String)
83
- ], AnnualTravelTicketRequests.prototype, "travel_details", void 0);
84
- __decorate([
85
- (0, typeorm_1.Column)({ type: 'int', nullable: false }),
86
- __metadata("design:type", Number)
87
- ], AnnualTravelTicketRequests.prototype, "ticket_entitlement_year", void 0);
88
- __decorate([
89
- (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
90
- __metadata("design:type", Object)
91
- ], AnnualTravelTicketRequests.prototype, "children_travelers_json", void 0);
75
+ ], AnnualTravelTicketRequests.prototype, "travel_from", void 0);
92
76
  __decorate([
93
- (0, typeorm_1.Column)({ type: 'boolean', default: false, nullable: false }),
94
- __metadata("design:type", Boolean)
95
- ], AnnualTravelTicketRequests.prototype, "profile_children_synced_with_profile", void 0);
77
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
78
+ __metadata("design:type", String)
79
+ ], AnnualTravelTicketRequests.prototype, "travel_to", void 0);
96
80
  __decorate([
97
- (0, typeorm_1.Column)({ type: 'text', nullable: true }),
98
- __metadata("design:type", Object)
99
- ], AnnualTravelTicketRequests.prototype, "carry_forward_notes", void 0);
81
+ (0, typeorm_1.Column)({ type: 'date', nullable: false }),
82
+ __metadata("design:type", String)
83
+ ], AnnualTravelTicketRequests.prototype, "date_of_travel", void 0);
100
84
  __decorate([
101
85
  (0, typeorm_1.Column)({
102
86
  type: 'enum',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/foreign-ministry",
3
- "version": "1.3.262",
3
+ "version": "1.3.266",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -62,14 +62,17 @@ import { Notification } from './models/NotificationModel';
62
62
  import { FinancialRequests } from './models/FinancialRequestsModel';
63
63
  import { FinancialApprovals } from './models/FinancialApprovalsModel';
64
64
  import { FinancialSettings } from './models/FinancialSettingsModel';
65
- import { PayslipRequests } from './models/PayslipRequestsModel';
66
- import { SalaryCertificateRequests } from './models/SalaryCertificateRequestsModel';
67
- import { AllowanceRequests } from './models/AllowanceRequestsModel';
68
- import { ReimbursementRequests } from './models/ReimbursementRequestsModel';
69
- import { BankAccountChangeRequests } from './models/BankAccountChangeRequestsModel';
70
- import { FinancialChats } from './models/FinancialChatsModel';
71
- import { FinancialWorkFlow } from './models/FinancialWorkFlowModel';
72
- import { FinancialAttachments } from './models/FinancialAttachmentsModel';
65
+ import { PayslipRequests } from './models/PayslipRequestsModel';
66
+ import { SalaryCertificateRequests } from './models/SalaryCertificateRequestsModel';
67
+ import { AllowanceRequests } from './models/AllowanceRequestsModel';
68
+ import { ReimbursementRequests } from './models/ReimbursementRequestsModel';
69
+ import { BankAccountChangeRequests } from './models/BankAccountChangeRequestsModel';
70
+ import { AnnualTravelTicketRequests } from './models/AnnualTravelTicketRequestModel';
71
+ import { AnnualTravelTicketPriceConfiguration } from './models/AnnualTravelTicketPriceConfigurationModel';
72
+ import { AnnualTravelTicketPriceConfigurationItem } from './models/AnnualTravelTicketPriceConfigurationItemModel';
73
+ import { FinancialChats } from './models/FinancialChatsModel';
74
+ import { FinancialWorkFlow } from './models/FinancialWorkFlowModel';
75
+ import { FinancialAttachments } from './models/FinancialAttachmentsModel';
73
76
  import { RequestTypeMaster } from './models/RequestTypeMasterModel';
74
77
  import { AllowanceTypes } from './models/AllowanceTypesModel';
75
78
  import { BankNames } from './models/BankNamesModel';
@@ -352,12 +355,15 @@ export const AppDataSource = new DataSource({
352
355
  FinancialApprovals,
353
356
  FinancialSettings,
354
357
  PayslipRequests,
355
- SalaryCertificateRequests,
356
- AllowanceRequests,
357
- ReimbursementRequests,
358
- BankAccountChangeRequests,
359
- FinancialChats,
360
- FinancialWorkFlow,
358
+ SalaryCertificateRequests,
359
+ AllowanceRequests,
360
+ ReimbursementRequests,
361
+ BankAccountChangeRequests,
362
+ AnnualTravelTicketRequests,
363
+ AnnualTravelTicketPriceConfiguration,
364
+ AnnualTravelTicketPriceConfigurationItem,
365
+ FinancialChats,
366
+ FinancialWorkFlow,
361
367
  FinancialAttachments,
362
368
  RequestTypeMaster,
363
369
  WorkflowTask,
package/src/index.ts CHANGED
@@ -81,6 +81,8 @@ export * from './models/MissionBankAccountAttachmentModel';
81
81
  export * from './models/MissionBankAccountChatModel';
82
82
  export * from './models/MissionBankAccountWorkflowModel';
83
83
  export * from './models/AnnualTravelTicketRequestModel';
84
+ export * from './models/AnnualTravelTicketPriceConfigurationModel';
85
+ export * from './models/AnnualTravelTicketPriceConfigurationItemModel';
84
86
  export * from './models/AmbassadorSpecialAccountAmountRequestModel';
85
87
  export * from './models/StayAfterHoursRequestModel';
86
88
  export * from './models/StayAfterHoursApprovalModel';
@@ -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
+ }
@@ -1,15 +1,23 @@
1
- import { Column, Entity } from 'typeorm';
2
- import { BaseModel } from './BaseModel';
3
-
4
- export enum AnnualTravelTicketPermanentResidence {
5
- SALALAH = 'Salalah',
6
- MUSANDAM = 'Musandam',
7
- }
8
-
9
- /** Aligns with mission bank account request lifecycle for shared workflow UI. */
10
- export enum AnnualTravelTicketRequestStatus {
11
- PENDING = 'Pending',
12
- ASSIGNED = 'Assigned',
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum AnnualTravelTicketPermanentResidence {
5
+ SALALAH = 'Salalah',
6
+ MUSANDAM = 'Musandam',
7
+ }
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
+
17
+ /** Aligns with mission bank account request lifecycle for shared workflow UI. */
18
+ export enum AnnualTravelTicketRequestStatus {
19
+ PENDING = 'Pending',
20
+ ASSIGNED = 'Assigned',
13
21
  IN_PROGRESS = 'In Progress',
14
22
  APPROVED = 'Approved',
15
23
  REJECTED = 'Rejected',
@@ -39,44 +47,28 @@ export class AnnualTravelTicketRequests extends BaseModel {
39
47
  @Column({ type: 'varchar', length: 120, nullable: false })
40
48
  civil_id_or_passport_number: string;
41
49
 
42
- @Column({ type: 'enum', enum: AnnualTravelTicketPermanentResidence, nullable: false })
43
- permanent_residence: AnnualTravelTicketPermanentResidence;
44
-
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;
54
-
55
- @Column({ type: 'varchar', length: 100, nullable: false })
56
- bank_account_number: string;
57
-
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;
68
-
69
- /** Client confirms dependents match HR/profile before submit. */
70
- @Column({ type: 'boolean', default: false, nullable: false })
71
- profile_children_synced_with_profile: boolean;
72
-
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;
76
-
77
- @Column({
78
- type: 'enum',
79
- enum: AnnualTravelTicketRequestStatus,
50
+ @Column({ type: 'enum', enum: AnnualTravelTicketPermanentResidence, nullable: false })
51
+ permanent_residence: AnnualTravelTicketPermanentResidence;
52
+
53
+ /** Traveler list with person name, relation, age, age category, and price. */
54
+ @Column({ type: 'jsonb', nullable: true })
55
+ family_details: AnnualTravelTicketFamilyDetail[] | null;
56
+
57
+ @Column({ type: 'varchar', length: 100, nullable: false })
58
+ bank_account_number: string;
59
+
60
+ @Column({ type: 'varchar', length: 255, nullable: false })
61
+ travel_from: string;
62
+
63
+ @Column({ type: 'varchar', length: 255, nullable: false })
64
+ travel_to: string;
65
+
66
+ @Column({ type: 'date', nullable: false })
67
+ date_of_travel: string;
68
+
69
+ @Column({
70
+ type: 'enum',
71
+ enum: AnnualTravelTicketRequestStatus,
80
72
  default: AnnualTravelTicketRequestStatus.PENDING,
81
73
  nullable: false,
82
74
  })