@platform-modules/foreign-ministry 1.0.76 → 1.0.78

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.
Files changed (75) hide show
  1. package/.env +2 -2
  2. package/dist/data-source.js +12 -2
  3. package/dist/index.d.ts +5 -13
  4. package/dist/index.js +5 -13
  5. package/dist/models/FMServices.js +1 -1
  6. package/dist/models/HelpContentMappedCategoriesModel.d.ts +6 -0
  7. package/dist/models/HelpContentMappedCategoriesModel.js +34 -0
  8. package/dist/models/HelpContentMappedTagsModel.d.ts +6 -0
  9. package/dist/models/HelpContentMappedTagsModel.js +34 -0
  10. package/dist/models/HelpContentTagsModel.d.ts +5 -0
  11. package/dist/models/HelpContentTagsModel.js +29 -0
  12. package/dist/models/HolidaysModel.d.ts +11 -0
  13. package/dist/models/HolidaysModel.js +59 -0
  14. package/dist/models/NotificationModel.d.ts +18 -0
  15. package/dist/models/NotificationModel.js +79 -0
  16. package/dist/models/PortalFeedbackModel.d.ts +8 -0
  17. package/dist/models/{FinancialChatsModel.js → PortalFeedbackModel.js} +24 -19
  18. package/dist/models/role.d.ts +1 -7
  19. package/dist/models/role.js +2 -2
  20. package/dist/models/roleRightsModel.d.ts +16 -0
  21. package/dist/models/roleRightsModel.js +44 -0
  22. package/dist/models/user.d.ts +5 -1
  23. package/dist/models/user.js +22 -2
  24. package/dist/models/userRolesModel.d.ts +18 -0
  25. package/dist/models/{FinancialSettingsModel.js → userRolesModel.js} +31 -21
  26. package/package.json +1 -1
  27. package/src/data-source.ts +12 -2
  28. package/src/index.ts +5 -13
  29. package/src/models/FMServices.ts +1 -1
  30. package/src/models/HolidaysModel.ts +46 -0
  31. package/src/models/NotificationModel.ts +68 -0
  32. package/src/models/PortalFeedbackModel.ts +33 -0
  33. package/src/models/role.ts +1 -7
  34. package/src/models/roleRightsModel.ts +31 -0
  35. package/src/models/user.ts +21 -0
  36. package/src/models/userRolesModel.ts +38 -0
  37. package/FINANCIAL_MODELS_SUMMARY.md +0 -144
  38. package/FINANCIAL_SERVICES_MODELS.md +0 -236
  39. package/dist/models/AllowanceRequestsModel.d.ts +0 -9
  40. package/dist/models/AllowanceRequestsModel.js +0 -49
  41. package/dist/models/AllowanceTypesModel.d.ts +0 -8
  42. package/dist/models/AllowanceTypesModel.js +0 -43
  43. package/dist/models/BankAccountChangeRequestsModel.d.ts +0 -12
  44. package/dist/models/BankAccountChangeRequestsModel.js +0 -62
  45. package/dist/models/FinancialApprovalsModel.d.ts +0 -20
  46. package/dist/models/FinancialApprovalsModel.js +0 -76
  47. package/dist/models/FinancialAttachmentsModel.d.ts +0 -8
  48. package/dist/models/FinancialAttachmentsModel.js +0 -43
  49. package/dist/models/FinancialChatsModel.d.ts +0 -7
  50. package/dist/models/FinancialRequestsModel.d.ts +0 -29
  51. package/dist/models/FinancialRequestsModel.js +0 -103
  52. package/dist/models/FinancialSettingsModel.d.ts +0 -8
  53. package/dist/models/FinancialWorkFlowModel.d.ts +0 -16
  54. package/dist/models/FinancialWorkFlowModel.js +0 -61
  55. package/dist/models/PayslipRequestsModel.d.ts +0 -8
  56. package/dist/models/PayslipRequestsModel.js +0 -44
  57. package/dist/models/ReimbursementRequestsModel.d.ts +0 -14
  58. package/dist/models/ReimbursementRequestsModel.js +0 -73
  59. package/dist/models/RequestTypeMasterModel.d.ts +0 -12
  60. package/dist/models/RequestTypeMasterModel.js +0 -60
  61. package/dist/models/SalaryCertificateRequestsModel.d.ts +0 -7
  62. package/dist/models/SalaryCertificateRequestsModel.js +0 -39
  63. package/src/models/AllowanceRequestsModel.ts +0 -38
  64. package/src/models/AllowanceTypesModel.ts +0 -26
  65. package/src/models/BankAccountChangeRequestsModel.ts +0 -50
  66. package/src/models/FinancialApprovalsModel.ts +0 -57
  67. package/src/models/FinancialAttachmentsModel.ts +0 -30
  68. package/src/models/FinancialChatsModel.ts +0 -23
  69. package/src/models/FinancialRequestsModel.ts +0 -81
  70. package/src/models/FinancialSettingsModel.ts +0 -30
  71. package/src/models/FinancialWorkFlowModel.ts +0 -47
  72. package/src/models/PayslipRequestsModel.ts +0 -29
  73. package/src/models/ReimbursementRequestsModel.ts +0 -58
  74. package/src/models/RequestTypeMasterModel.ts +0 -38
  75. package/src/models/SalaryCertificateRequestsModel.ts +0 -24
@@ -1,4 +1,14 @@
1
1
  "use strict";
2
+ /** *
3
+ @author
4
+ Amnet Digital
5
+ @date
6
+ 2024-05-20
7
+ @Model
8
+ Role
9
+ @usage
10
+ Userrole Information will store
11
+ */
2
12
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
13
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
14
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -9,36 +19,36 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
19
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
20
  };
11
21
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.FinancialSettings = void 0;
22
+ exports.UserRole = void 0;
13
23
  const typeorm_1 = require("typeorm");
14
24
  const BaseModel_1 = require("./BaseModel");
15
- let FinancialSettings = class FinancialSettings extends BaseModel_1.BaseModel {
16
- constructor(service_id, approval_level, approver_role_id) {
25
+ let UserRole = class UserRole extends BaseModel_1.BaseModel {
26
+ constructor(role_id, user_id, department_id, section_id) {
17
27
  super();
18
- this.service_id = service_id;
19
- this.approval_level = approval_level;
20
- this.approver_role_id = approver_role_id;
21
- this.is_active = true;
28
+ this.role_id = role_id;
29
+ this.user_id = user_id;
30
+ this.department_id = department_id;
31
+ this.section_id = section_id;
22
32
  }
23
33
  };
24
- exports.FinancialSettings = FinancialSettings;
34
+ exports.UserRole = UserRole;
25
35
  __decorate([
26
- (0, typeorm_1.Column)({ type: 'int' }),
36
+ (0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
27
37
  __metadata("design:type", Number)
28
- ], FinancialSettings.prototype, "service_id", void 0);
38
+ ], UserRole.prototype, "role_id", void 0);
29
39
  __decorate([
30
- (0, typeorm_1.Column)({ type: 'int' }),
40
+ (0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
31
41
  __metadata("design:type", Number)
32
- ], FinancialSettings.prototype, "approval_level", void 0);
42
+ ], UserRole.prototype, "user_id", void 0);
33
43
  __decorate([
34
- (0, typeorm_1.Column)({ type: 'int' }),
44
+ (0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
35
45
  __metadata("design:type", Number)
36
- ], FinancialSettings.prototype, "approver_role_id", void 0);
46
+ ], UserRole.prototype, "department_id", void 0);
37
47
  __decorate([
38
- (0, typeorm_1.Column)({ type: 'boolean', default: true }),
39
- __metadata("design:type", Boolean)
40
- ], FinancialSettings.prototype, "is_active", void 0);
41
- exports.FinancialSettings = FinancialSettings = __decorate([
42
- (0, typeorm_1.Entity)({ name: 'financial_settings' }),
43
- __metadata("design:paramtypes", [Number, Number, Number])
44
- ], FinancialSettings);
48
+ (0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
49
+ __metadata("design:type", Number)
50
+ ], UserRole.prototype, "section_id", void 0);
51
+ exports.UserRole = UserRole = __decorate([
52
+ (0, typeorm_1.Entity)({ name: 'user_role' }),
53
+ __metadata("design:paramtypes", [Number, Number, Number, Number])
54
+ ], UserRole);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/foreign-ministry",
3
- "version": "1.0.76",
3
+ "version": "1.0.78",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -50,6 +50,11 @@ import { MessageReadStatus } from './models/MessageReadStatusModel';
50
50
  import { ShiftDetails } from './models/ShifttimesModel';
51
51
  import { AttendanceDetails } from './models/AttendanceModel';
52
52
  import { UserShift } from './models/UserShiftModel';
53
+ import { Holidays } from './models/HolidaysModel';
54
+ import { UserRole } from './models/userRolesModel';
55
+ import { RoleRights } from './models/roleRightsModel';
56
+ import { PortalFeedback } from './models/PortalFeedbackModel';
57
+ import { Notification } from './models/NotificationModel';
53
58
 
54
59
 
55
60
  export const AppDataSource = new DataSource({
@@ -59,7 +64,7 @@ export const AppDataSource = new DataSource({
59
64
  username: process.env.DB_USER || 'postgres',
60
65
  password: process.env.DB_PASS || 'postgres',
61
66
  database: process.env.DB_NAME || 'common_models',
62
- synchronize: false, // auto-create tables (disable in prod)
67
+ synchronize: true, // auto-create tables (disable in prod)
63
68
  logging: false,
64
69
  entities: [
65
70
  User,
@@ -105,6 +110,11 @@ export const AppDataSource = new DataSource({
105
110
  MessageReadStatus,
106
111
  ShiftDetails,
107
112
  AttendanceDetails,
108
- UserShift
113
+ UserShift,
114
+ Holidays,
115
+ UserRole,
116
+ RoleRights,
117
+ PortalFeedback,
118
+ Notification
109
119
  ],
110
120
  });
package/src/index.ts CHANGED
@@ -42,16 +42,8 @@ export * from './models/ShifttimesModel';
42
42
  export * from './models/AttendanceModel';
43
43
  export * from './models/contactInfoModel';
44
44
  export * from './models/UserShiftModel';
45
- export * from './models/FinancialRequestsModel';
46
- export * from './models/PayslipRequestsModel';
47
- export * from './models/SalaryCertificateRequestsModel';
48
- export * from './models/AllowanceRequestsModel';
49
- export * from './models/ReimbursementRequestsModel';
50
- export * from './models/BankAccountChangeRequestsModel';
51
- export * from './models/FinancialChatsModel';
52
- export * from './models/FinancialApprovalsModel';
53
- export * from './models/FinancialWorkFlowModel';
54
- export * from './models/FinancialAttachmentsModel';
55
- export * from './models/RequestTypeMasterModel';
56
- export * from './models/FinancialSettingsModel';
57
- export * from './models/AllowanceTypesModel';
45
+ export * from './models/HolidaysModel';
46
+ export * from './models/userRolesModel';
47
+ export * from './models/roleRightsModel';
48
+ export * from './models/PortalFeedbackModel';
49
+ export * from './models/NotificationModel';
@@ -14,7 +14,7 @@ export class FMServices extends BaseModel {
14
14
  @Column({ nullable: false })
15
15
  description: string;
16
16
 
17
- @Column({ nullable: false })
17
+ @Column({ nullable: true })
18
18
  logo_url: string;
19
19
 
20
20
  constructor(
@@ -0,0 +1,46 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'holidays' })
5
+ export class Holidays extends BaseModel {
6
+
7
+ @Column({ type: 'varchar', length: 200 })
8
+ title: string;
9
+
10
+ @Column({ type: 'date', name: 'holiday_date' })
11
+ holiday_date: Date;
12
+
13
+ @Column({ type: 'text', nullable: true })
14
+ description?: string;
15
+
16
+ @Column({ type: 'varchar', length: 200, nullable: true })
17
+ region?: string;
18
+
19
+ @Column({ type: 'boolean', name: 'is_optional', default: false })
20
+ is_optional: boolean;
21
+
22
+ @Column({ type: 'varchar', length: 30, name: 'holiday_type', default: 'Public' })
23
+ holiday_type: string;
24
+
25
+ @Column({ type: 'int', nullable: true })
26
+ year?: number;
27
+
28
+ constructor(
29
+ title: string,
30
+ holiday_date: Date,
31
+ description?: string,
32
+ region?: string,
33
+ is_optional: boolean = false,
34
+ holiday_type: string = 'Public',
35
+ year?: number
36
+ ) {
37
+ super();
38
+ this.title = title;
39
+ this.holiday_date = holiday_date;
40
+ this.description = description;
41
+ this.region = region;
42
+ this.is_optional = is_optional;
43
+ this.holiday_type = holiday_type;
44
+ this.year = year;
45
+ }
46
+ }
@@ -0,0 +1,68 @@
1
+
2
+ import { Column, Entity } from "typeorm";
3
+ import { BaseModel } from './BaseModel';
4
+
5
+ export enum NotificationType {
6
+ REQUEST_RAISED = 'request raised',
7
+ REMINDER = 'reminder',
8
+ IMPORT = 'import',
9
+ }
10
+
11
+ @Entity({ name: 'notification' })
12
+ export class Notification extends BaseModel {
13
+
14
+ @Column({
15
+ type: "enum",
16
+ enum: NotificationType,
17
+ nullable: false,
18
+ })
19
+ type: NotificationType;
20
+
21
+ @Column({ type: 'bigint', nullable: false })
22
+ user_id: number;
23
+
24
+ @Column({ type: 'bigint', nullable: true })
25
+ role_id: number;
26
+
27
+ @Column({ type: 'bigint', nullable: true })
28
+ department_id: number;
29
+
30
+ @Column({ type: 'bigint', nullable: true })
31
+ section_id: number;
32
+
33
+ @Column({ type: 'jsonb', nullable: true })
34
+ content: any;
35
+
36
+ @Column({ type: 'boolean', default: false })
37
+ is_read: boolean;
38
+
39
+ @Column({ type: 'bigint', nullable: true })
40
+ request_id: number;
41
+
42
+ @Column({ type: 'varchar', length: 500, nullable: true })
43
+ route_path: string;
44
+
45
+ constructor(
46
+ type: NotificationType,
47
+ user_id: number,
48
+ role_id: number,
49
+ department_id: number,
50
+ section_id: number,
51
+ content: any,
52
+ is_read: boolean,
53
+ request_id: number,
54
+ route_path: string
55
+ ) {
56
+ super();
57
+ this.type = type;
58
+ this.user_id = user_id;
59
+ this.role_id = role_id;
60
+ this.department_id = department_id;
61
+ this.section_id = section_id;
62
+ this.content = content;
63
+ this.is_read = is_read;
64
+ this.request_id = request_id;
65
+ this.route_path = route_path;
66
+ }
67
+ }
68
+
@@ -0,0 +1,33 @@
1
+
2
+ import { Column, Entity } from "typeorm";
3
+ import { BaseModel } from './BaseModel';
4
+ import { Rating } from './feedbackModel';
5
+
6
+ @Entity({ name: 'portal_feedback' })
7
+ export class PortalFeedback extends BaseModel {
8
+
9
+ @Column({ nullable: true })
10
+ comment: string;
11
+
12
+ @Column({
13
+ type: "enum",
14
+ enum: Rating,
15
+ nullable: true,
16
+ })
17
+ rating: Rating;
18
+
19
+ @Column({ nullable: true })
20
+ user_Id: number;
21
+
22
+ constructor(
23
+ comment: string,
24
+ rating: Rating,
25
+ user_Id: number,
26
+ ) {
27
+ super();
28
+ this.comment = comment,
29
+ this.rating = rating,
30
+ this.user_Id = user_Id
31
+ }
32
+ }
33
+
@@ -12,12 +12,6 @@ Userrole Information will store
12
12
  import { Column, Entity } from "typeorm";
13
13
  import { BaseModel } from './BaseModel';
14
14
 
15
- export interface Irole {
16
- name: string;
17
- id?: number;
18
- is_deleted?: boolean;
19
- created_by?: number;
20
- }
21
15
  @Entity({ name: 'role' })
22
16
  export class Role extends BaseModel {
23
17
 
@@ -28,7 +22,7 @@ export class Role extends BaseModel {
28
22
  is_deleted?: boolean;
29
23
 
30
24
 
31
- constructor(name: string,is_deleted:boolean,userId: number) {
25
+ constructor(name: string, is_deleted:boolean) {
32
26
  super();
33
27
  this.name = name
34
28
  this.is_deleted = is_deleted
@@ -0,0 +1,31 @@
1
+ /** *
2
+ @author
3
+ Amnet Digital
4
+ @date
5
+ 2024-05-20
6
+ @Model
7
+ Role
8
+ @usage
9
+ Userrole Information will store
10
+ */
11
+
12
+ import { Column, Entity } from "typeorm";
13
+ import { BaseModel } from './BaseModel';
14
+
15
+
16
+ @Entity({ name: 'role_rights' })
17
+ export class RoleRights extends BaseModel {
18
+
19
+ @Column({ type: 'bigint', nullable: true })
20
+ user_role_id: number;
21
+
22
+ @Column({ type: 'bigint', nullable: false })
23
+ service_id: number;
24
+
25
+
26
+ constructor(user_role_id: number, service_id: number) {
27
+ super();
28
+ this.user_role_id = user_role_id
29
+ this.service_id = service_id
30
+ }
31
+ }
@@ -106,6 +106,19 @@ export class User extends BaseModel {
106
106
  @Column({ nullable: true })
107
107
  qualification?: string;
108
108
 
109
+
110
+ @Column({ nullable: true })
111
+ father_name?: string;
112
+
113
+ @Column({ nullable: true })
114
+ spouse_name?: string;
115
+
116
+ @Column({ nullable: true })
117
+ children1_name?: string;
118
+
119
+ @Column({ nullable: true })
120
+ children2_name?: string;
121
+
109
122
  constructor(
110
123
  employee_id?: number,
111
124
  employee_name?: string,
@@ -141,6 +154,10 @@ export class User extends BaseModel {
141
154
  diplomatic_name?: string,
142
155
  civil_employee_id?: number,
143
156
  qualification?: string,
157
+ father_name?: string,
158
+ spouse_name?: string,
159
+ children1_name?: string,
160
+ children2_name?: string,
144
161
  ) {
145
162
  super();
146
163
  this.employee_id = employee_id;
@@ -177,5 +194,9 @@ export class User extends BaseModel {
177
194
  this.diplomatic_name = diplomatic_name;
178
195
  this.civil_employee_id = civil_employee_id;
179
196
  this.qualification = qualification;
197
+ this.father_name = father_name;
198
+ this.spouse_name = spouse_name;
199
+ this.children1_name = children1_name;
200
+ this.children2_name = children2_name;
180
201
  }
181
202
  }
@@ -0,0 +1,38 @@
1
+ /** *
2
+ @author
3
+ Amnet Digital
4
+ @date
5
+ 2024-05-20
6
+ @Model
7
+ Role
8
+ @usage
9
+ Userrole Information will store
10
+ */
11
+
12
+ import { Column, Entity } from "typeorm";
13
+ import { BaseModel } from './BaseModel';
14
+
15
+
16
+ @Entity({ name: 'user_role' })
17
+ export class UserRole extends BaseModel {
18
+
19
+ @Column({ type: 'bigint', nullable: false })
20
+ role_id: number;
21
+
22
+ @Column({ type: 'bigint', nullable: false })
23
+ user_id: number;
24
+
25
+ @Column({ type: 'bigint', nullable: true })
26
+ department_id: number;
27
+
28
+ @Column({ type: 'bigint', nullable: true })
29
+ section_id: number;
30
+
31
+ constructor(role_id: number, user_id: number, department_id: number, section_id: number) {
32
+ super();
33
+ this.role_id = role_id
34
+ this.user_id = user_id
35
+ this.department_id = department_id
36
+ this.section_id = section_id
37
+ }
38
+ }
@@ -1,144 +0,0 @@
1
- # ✅ Financial Service Models - COMPLETED
2
-
3
- ## 🎉 Successfully Created 13 Models
4
-
5
- ### ✨ Updates Made:
6
- - ❌ **Removed:** `ReimbursementCategoriesModel.ts` - Not needed (users enter type directly)
7
- - ✅ **Updated:** `ReimbursementRequestsModel.ts` - Changed to use free text `reimbursement_type` field
8
- - ✅ **Fixed:** Renamed all enums to avoid conflicts with Leave module
9
-
10
- ---
11
-
12
- ## 📦 Final Model List
13
-
14
- ### Core Request Tables (6):
15
- 1. ✅ **FinancialRequestsModel.ts** - Main parent table
16
- 2. ✅ **PayslipRequestsModel.ts** (FM001)
17
- 3. ✅ **SalaryCertificateRequestsModel.ts** (FM002)
18
- 4. ✅ **AllowanceRequestsModel.ts** (FM003)
19
- 5. ✅ **ReimbursementRequestsModel.ts** (FM004) - Uses free text, no category table
20
- 6. ✅ **BankAccountChangeRequestsModel.ts** (FM005)
21
-
22
- ### Supporting Tables (4):
23
- 7. ✅ **FinancialChatsModel.ts**
24
- 8. ✅ **FinancialApprovalsModel.ts**
25
- 9. ✅ **FinancialWorkFlowModel.ts**
26
- 10. ✅ **FinancialAttachmentsModel.ts**
27
-
28
- ### Configuration Tables (3):
29
- 11. ✅ **RequestTypeMasterModel.ts**
30
- 12. ✅ **FinancialSettingsModel.ts**
31
- 13. ✅ **AllowanceTypesModel.ts**
32
-
33
- ---
34
-
35
- ## 🔑 Simplified Structure
36
-
37
- - **Primary Key:** `id` (auto-increment integer)
38
- - **No `request_number` field** - Just use the `id` directly
39
- - **No `request_code` field** - Can be added in future if needed
40
-
41
- ---
42
-
43
- ## 🔧 Enum Names (Renamed to Avoid Conflicts)
44
-
45
- | Original Name | New Name | Values |
46
- |---------------|----------|---------|
47
- | RequestStatus | **FinancialRequestStatus** | Draft, Submitted, Pending, In Progress, Approved, Rejected, Completed, Cancelled |
48
- | ApprovalStatus | **FinancialApprovalStatus** | Pending, Approved, Rejected, Skipped |
49
- | WorkFlowStatus | **FinancialWorkFlowStatus** | Completed, Not Yet Started, Pending, In Progress |
50
-
51
- ---
52
-
53
- ## 📋 ReimbursementRequestsModel Structure
54
-
55
- ```typescript
56
- @Entity({ name: 'reimbursement_requests' })
57
- export class ReimbursementRequests {
58
- financial_request_id: number;
59
- reimbursement_type: string; // ✅ Free text field (user enters: Medical, Travel, etc.)
60
- claimed_amount: number;
61
- expense_date: Date;
62
- expense_description: string; // ✅ Detailed description
63
- vendor_name: string;
64
- invoice_number: string;
65
- approved_amount: number;
66
- rejection_reason: string;
67
- verified_by_user_id: number;
68
- verification_date: Date;
69
- payment_processed: boolean;
70
- payment_reference_number: string;
71
- payment_date: Date;
72
- }
73
- ```
74
-
75
- ---
76
-
77
- ## ✅ Validation Passed
78
-
79
- - ✅ No linter errors
80
- - ✅ All models exported in `index.ts`
81
- - ✅ No enum conflicts
82
- - ✅ Proper TypeScript types
83
- - ✅ All constructors defined
84
-
85
- ---
86
-
87
- ## 🚀 Ready for Next Steps
88
-
89
- 1. **Compile shared_models:**
90
- ```bash
91
- cd FM_Backend/shared_models
92
- npm run build
93
- ```
94
-
95
- 2. **Update Data Source** - Add entities to TypeORM config
96
-
97
- 3. **Create Repositories** - Implement CRUD operations
98
-
99
- 4. **Create Services** - Business logic layer
100
-
101
- 5. **Add API Routes** - REST endpoints
102
-
103
- 6. **Seed Master Data:**
104
- - Request types (FM001-FM005)
105
- - Financial settings (approval matrix)
106
- - Allowance types
107
-
108
- ---
109
-
110
- ## 📊 Database Tables
111
-
112
- Total: **13 tables**
113
-
114
- ```
115
- financial_requests ← Main table
116
- ├── payslip_requests ← One-to-One
117
- ├── salary_certificate_requests ← One-to-One
118
- ├── allowance_requests ← One-to-One
119
- ├── reimbursement_requests ← One-to-One (no category FK)
120
- ├── bank_account_change_requests ← One-to-One
121
- ├── financial_chats ← One-to-Many
122
- ├── financial_approvals ← One-to-Many
123
- ├── financial_work_flows ← One-to-Many
124
- └── financial_attachments ← One-to-Many
125
-
126
- request_type_master ← Master data
127
- financial_settings ← Configuration
128
- allowance_types ← Master data
129
- ```
130
-
131
- ---
132
-
133
- ## 🎯 Key Changes from Original Design
134
-
135
- 1. **Removed `reimbursement_categories` table** - Simplified to free text entry
136
- 2. **Renamed all enums** - Added "Financial" prefix to avoid conflicts
137
- 3. **Updated ReimbursementRequests** - Removed FK to categories, added free text field
138
-
139
- ---
140
-
141
- ✅ **ALL MODELS READY FOR USE!**
142
-
143
- Date: January 2025
144
-