@platform-modules/foreign-ministry 1.0.75 → 1.0.76
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.
- package/FINANCIAL_MODELS_SUMMARY.md +144 -0
- package/FINANCIAL_SERVICES_MODELS.md +236 -0
- package/dist/data-source.js +2 -10
- package/dist/index.d.ts +13 -4
- package/dist/index.js +13 -4
- package/dist/models/AllowanceRequestsModel.d.ts +9 -0
- package/dist/models/AllowanceRequestsModel.js +49 -0
- package/dist/models/AllowanceTypesModel.d.ts +8 -0
- package/dist/models/AllowanceTypesModel.js +43 -0
- package/dist/models/BankAccountChangeRequestsModel.d.ts +12 -0
- package/dist/models/BankAccountChangeRequestsModel.js +62 -0
- package/dist/models/FMServices.js +1 -1
- package/dist/models/FinancialApprovalsModel.d.ts +20 -0
- package/dist/models/FinancialApprovalsModel.js +76 -0
- package/dist/models/FinancialAttachmentsModel.d.ts +8 -0
- package/dist/models/FinancialAttachmentsModel.js +43 -0
- package/dist/models/FinancialChatsModel.d.ts +7 -0
- package/dist/models/{roleRightsModel.js → FinancialChatsModel.js} +19 -24
- package/dist/models/FinancialRequestsModel.d.ts +29 -0
- package/dist/models/FinancialRequestsModel.js +103 -0
- package/dist/models/FinancialSettingsModel.d.ts +8 -0
- package/dist/models/{userRolesModel.js → FinancialSettingsModel.js} +21 -31
- package/dist/models/FinancialWorkFlowModel.d.ts +16 -0
- package/dist/models/FinancialWorkFlowModel.js +61 -0
- package/dist/models/PayslipRequestsModel.d.ts +8 -0
- package/dist/models/PayslipRequestsModel.js +44 -0
- package/dist/models/ReimbursementRequestsModel.d.ts +14 -0
- package/dist/models/ReimbursementRequestsModel.js +73 -0
- package/dist/models/RequestTypeMasterModel.d.ts +12 -0
- package/dist/models/RequestTypeMasterModel.js +60 -0
- package/dist/models/SalaryCertificateRequestsModel.d.ts +7 -0
- package/dist/models/SalaryCertificateRequestsModel.js +39 -0
- package/dist/models/questionTagsModel.d.ts +6 -0
- package/dist/models/{PortalFeedbackModel.js → questionTagsModel.js} +12 -22
- package/dist/models/role.d.ts +7 -1
- package/dist/models/role.js +2 -2
- package/dist/models/user.d.ts +1 -5
- package/dist/models/user.js +2 -22
- package/package.json +1 -1
- package/src/data-source.ts +2 -10
- package/src/index.ts +13 -4
- package/src/models/AllowanceRequestsModel.ts +38 -0
- package/src/models/AllowanceTypesModel.ts +26 -0
- package/src/models/BankAccountChangeRequestsModel.ts +50 -0
- package/src/models/FMServices.ts +1 -1
- package/src/models/FinancialApprovalsModel.ts +57 -0
- package/src/models/FinancialAttachmentsModel.ts +30 -0
- package/src/models/FinancialChatsModel.ts +23 -0
- package/src/models/FinancialRequestsModel.ts +81 -0
- package/src/models/FinancialSettingsModel.ts +30 -0
- package/src/models/FinancialWorkFlowModel.ts +47 -0
- package/src/models/PayslipRequestsModel.ts +29 -0
- package/src/models/ReimbursementRequestsModel.ts +58 -0
- package/src/models/RequestTypeMasterModel.ts +38 -0
- package/src/models/SalaryCertificateRequestsModel.ts +24 -0
- package/src/models/role.ts +7 -1
- package/src/models/user.ts +0 -21
- package/dist/models/HolidaysModel.d.ts +0 -11
- package/dist/models/HolidaysModel.js +0 -59
- package/dist/models/PortalFeedbackModel.d.ts +0 -8
- package/dist/models/roleRightsModel.d.ts +0 -16
- package/dist/models/userRolesModel.d.ts +0 -18
- package/src/models/HolidaysModel.ts +0 -46
- package/src/models/PortalFeedbackModel.ts +0 -33
- package/src/models/roleRightsModel.ts +0 -31
- package/src/models/userRolesModel.ts +0 -38
|
@@ -0,0 +1,144 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# Financial Services Models - Created Successfully ✅
|
|
2
|
+
|
|
3
|
+
## 📋 Summary
|
|
4
|
+
|
|
5
|
+
13 Financial Service database models have been created in `shared_models/src/models/`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🗂️ Core Tables
|
|
10
|
+
|
|
11
|
+
### 1. **FinancialRequestsModel.ts** (Main/Parent Table)
|
|
12
|
+
- Common fields for all financial requests
|
|
13
|
+
- Uses `id` (auto-increment) as unique identifier
|
|
14
|
+
- Includes: employee details, request_type, status, etc.
|
|
15
|
+
- **Enum:** `FinancialRequestStatus` (Draft, Submitted, Pending, In Progress, Approved, Rejected, Completed, Cancelled)
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 📑 Request Type Specific Tables (One-to-One with FinancialRequests)
|
|
20
|
+
|
|
21
|
+
### 2. **PayslipRequestsModel.ts** (FM001)
|
|
22
|
+
- Financial Request ID (FK - Unique)
|
|
23
|
+
- Payslip month & year
|
|
24
|
+
- Generation status & URL
|
|
25
|
+
- Generated by user ID & date
|
|
26
|
+
|
|
27
|
+
### 3. **SalaryCertificateRequestsModel.ts** (FM002)
|
|
28
|
+
- Financial Request ID (FK - Unique)
|
|
29
|
+
- Certificate purpose, addressee details
|
|
30
|
+
- Language preference (English/Arabic)
|
|
31
|
+
- Include salary/allowances flags
|
|
32
|
+
- Generation status & URL
|
|
33
|
+
|
|
34
|
+
### 4. **AllowanceRequestsModel.ts** (FM003)
|
|
35
|
+
- Financial Request ID (FK - Unique)
|
|
36
|
+
- Allowance type ID & name
|
|
37
|
+
- Requested amount & effective date
|
|
38
|
+
- Justification
|
|
39
|
+
- Recurring/frequency options
|
|
40
|
+
- Approved amount & date
|
|
41
|
+
|
|
42
|
+
### 5. **ReimbursementRequestsModel.ts** (FM004)
|
|
43
|
+
- Financial Request ID (FK - Unique)
|
|
44
|
+
- Reimbursement type (free text - user enters directly)
|
|
45
|
+
- Claimed amount & expense date
|
|
46
|
+
- Expense description
|
|
47
|
+
- Vendor name & invoice number
|
|
48
|
+
- Approved amount & verification details
|
|
49
|
+
- Payment processing status
|
|
50
|
+
|
|
51
|
+
### 6. **BankAccountChangeRequestsModel.ts** (FM005)
|
|
52
|
+
- Financial Request ID (FK - Unique)
|
|
53
|
+
- Old bank details (optional)
|
|
54
|
+
- New bank details (required)
|
|
55
|
+
- IBAN, branch, SWIFT code
|
|
56
|
+
- Reason for change
|
|
57
|
+
- HR verification & payroll update status
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 🔄 Supporting Tables (One-to-Many with FinancialRequests)
|
|
62
|
+
|
|
63
|
+
### 7. **FinancialChatsModel.ts**
|
|
64
|
+
- Financial Request ID (FK)
|
|
65
|
+
- Content & sender user ID
|
|
66
|
+
- Sender role (Employee, Manager, Finance, HR)
|
|
67
|
+
|
|
68
|
+
### 8. **FinancialApprovalsModel.ts**
|
|
69
|
+
- Financial Request ID (FK)
|
|
70
|
+
- Approval level & approver details
|
|
71
|
+
- Comment & action date
|
|
72
|
+
- SLA days & overdue flag
|
|
73
|
+
- **Enum:** `FinancialApprovalStatus` (Pending, Approved, Rejected, Skipped)
|
|
74
|
+
|
|
75
|
+
### 9. **FinancialWorkFlowModel.ts**
|
|
76
|
+
- Financial Request ID (FK)
|
|
77
|
+
- Financial Approval ID (FK - optional)
|
|
78
|
+
- Activity description & status
|
|
79
|
+
- Performed by user ID & date
|
|
80
|
+
- **Enum:** `FinancialWorkFlowStatus` (Completed, Not Yet Started, Pending, In Progress)
|
|
81
|
+
|
|
82
|
+
### 10. **FinancialAttachmentsModel.ts**
|
|
83
|
+
- Financial Request ID (FK)
|
|
84
|
+
- File URL, name, type, size
|
|
85
|
+
- Uploaded by user ID
|
|
86
|
+
- Attachment category (Receipt, Invoice, BankStatement, Payslip, Certificate, Supporting)
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## ⚙️ Configuration/Master Tables
|
|
91
|
+
|
|
92
|
+
### 11. **RequestTypeMasterModel.ts**
|
|
93
|
+
- Request code (FM001, FM002, etc.) - Unique
|
|
94
|
+
- Request name & description
|
|
95
|
+
- Specific table name
|
|
96
|
+
- Icon, SLA days, display order
|
|
97
|
+
- Active status
|
|
98
|
+
|
|
99
|
+
### 12. **FinancialSettingsModel.ts**
|
|
100
|
+
- Request type ID & code
|
|
101
|
+
- Approval level & role details
|
|
102
|
+
- Mandatory flag
|
|
103
|
+
- SLA days per level
|
|
104
|
+
- Active status
|
|
105
|
+
|
|
106
|
+
### 13. **AllowanceTypesModel.ts**
|
|
107
|
+
- Allowance code (HOUSING, TRANSPORT, EDUCATION) - Unique
|
|
108
|
+
- Allowance name & description
|
|
109
|
+
- Default amount & max limit
|
|
110
|
+
- Active status
|
|
111
|
+
|
|
112
|
+
### ~~14. ReimbursementCategoriesModel.ts~~ ❌ REMOVED
|
|
113
|
+
- **Not needed** - Users will directly enter reimbursement type and description
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 📊 Relationships
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
FinancialRequests (1) ←──→ (1) PayslipRequests
|
|
121
|
+
←──→ (1) SalaryCertificateRequests
|
|
122
|
+
←──→ (1) AllowanceRequests
|
|
123
|
+
←──→ (1) ReimbursementRequests
|
|
124
|
+
←──→ (1) BankAccountChangeRequests
|
|
125
|
+
|
|
126
|
+
←──→ (Many) FinancialChats
|
|
127
|
+
←──→ (Many) FinancialApprovals
|
|
128
|
+
←──→ (Many) FinancialWorkFlow
|
|
129
|
+
←──→ (Many) FinancialAttachments
|
|
130
|
+
|
|
131
|
+
RequestTypeMaster (1) ←──→ (Many) FinancialRequests
|
|
132
|
+
AllowanceTypes (1) ←──→ (Many) AllowanceRequests
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 🚀 Next Steps
|
|
138
|
+
|
|
139
|
+
### 1. **Compile Shared Models**
|
|
140
|
+
```bash
|
|
141
|
+
cd FM_Backend/shared_models
|
|
142
|
+
npm run build
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 2. **Update Data Source** (data-source.ts)
|
|
146
|
+
Import all new entities in the TypeORM configuration
|
|
147
|
+
|
|
148
|
+
### 3. **Run Migrations**
|
|
149
|
+
Generate and run TypeORM migrations to create the database tables
|
|
150
|
+
|
|
151
|
+
### 4. **Seed Master Data**
|
|
152
|
+
Populate:
|
|
153
|
+
- `request_type_master` (FM001-FM005)
|
|
154
|
+
- `financial_settings` (approval matrix)
|
|
155
|
+
- `allowance_types` (Housing, Transport, etc.)
|
|
156
|
+
- `reimbursement_categories` (Medical, Travel, etc.)
|
|
157
|
+
|
|
158
|
+
### 5. **Create Repositories**
|
|
159
|
+
Create repository files in `User_service/src/models/repositories/`:
|
|
160
|
+
- `financial-requests.repo.ts`
|
|
161
|
+
- `financial-approvals.repo.ts`
|
|
162
|
+
- `financial-workflows.repo.ts`
|
|
163
|
+
- etc.
|
|
164
|
+
|
|
165
|
+
### 6. **Create Services**
|
|
166
|
+
Create service files in `User_service/src/controllers/`:
|
|
167
|
+
- `financial-requests.service.ts`
|
|
168
|
+
- `financial-approvals.service.ts`
|
|
169
|
+
- etc.
|
|
170
|
+
|
|
171
|
+
### 7. **Add API Routes**
|
|
172
|
+
Add routes in `User_service/src/routes/api-gateway.ts`
|
|
173
|
+
|
|
174
|
+
### 8. **Create Joi Validation Schemas**
|
|
175
|
+
Add validation in `User_service/src/helpers/utils/validate-schemas.ts`
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 📝 Request Codes
|
|
180
|
+
|
|
181
|
+
| Code | Request Type | Table Name |
|
|
182
|
+
|-------|-----------------------------------|-----------------------------------|
|
|
183
|
+
| FM001 | Request for Pay slip | payslip_requests |
|
|
184
|
+
| FM002 | Request for Salary Certificate | salary_certificate_requests |
|
|
185
|
+
| FM003 | Request for Allowance | allowance_requests |
|
|
186
|
+
| FM004 | Request for Reimbursement | reimbursement_requests |
|
|
187
|
+
| FM005 | Request for Bank Account Change | bank_account_change_requests |
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## ✅ Status
|
|
192
|
+
|
|
193
|
+
**All models created and exported successfully!**
|
|
194
|
+
|
|
195
|
+
- ✅ 13 TypeScript model files created
|
|
196
|
+
- ✅ All exported in `index.ts`
|
|
197
|
+
- ✅ No linter errors
|
|
198
|
+
- ✅ Ready for compilation and use
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 📚 Usage Example
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
import {
|
|
206
|
+
FinancialRequests,
|
|
207
|
+
PayslipRequests,
|
|
208
|
+
FinancialApprovals,
|
|
209
|
+
FinancialRequestStatus,
|
|
210
|
+
FinancialApprovalStatus
|
|
211
|
+
} from '@platform-modules/foreign-ministry';
|
|
212
|
+
|
|
213
|
+
// Create a payslip request
|
|
214
|
+
const financialRequest = new FinancialRequests(
|
|
215
|
+
101, // user_id
|
|
216
|
+
'EMP1234', // employee_id
|
|
217
|
+
'John Doe', // employee_name
|
|
218
|
+
'john@example.com',// email_address
|
|
219
|
+
'+966501234567', // contact_number
|
|
220
|
+
1, // request_type_id
|
|
221
|
+
'FM001' // request_code
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
await save(financialRequest); // id will be auto-generated
|
|
225
|
+
|
|
226
|
+
const payslipRequest = new PayslipRequests(
|
|
227
|
+
financialRequest.id, // FK to financial_requests
|
|
228
|
+
'2025-01',
|
|
229
|
+
2025
|
|
230
|
+
);
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
Created: $(date)
|
|
236
|
+
|
package/dist/data-source.js
CHANGED
|
@@ -49,10 +49,6 @@ const MessageReadStatusModel_1 = require("./models/MessageReadStatusModel");
|
|
|
49
49
|
const ShifttimesModel_1 = require("./models/ShifttimesModel");
|
|
50
50
|
const AttendanceModel_1 = require("./models/AttendanceModel");
|
|
51
51
|
const UserShiftModel_1 = require("./models/UserShiftModel");
|
|
52
|
-
const HolidaysModel_1 = require("./models/HolidaysModel");
|
|
53
|
-
const userRolesModel_1 = require("./models/userRolesModel");
|
|
54
|
-
const roleRightsModel_1 = require("./models/roleRightsModel");
|
|
55
|
-
const PortalFeedbackModel_1 = require("./models/PortalFeedbackModel");
|
|
56
52
|
exports.AppDataSource = new typeorm_1.DataSource({
|
|
57
53
|
type: 'postgres',
|
|
58
54
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -60,7 +56,7 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
60
56
|
username: process.env.DB_USER || 'postgres',
|
|
61
57
|
password: process.env.DB_PASS || 'postgres',
|
|
62
58
|
database: process.env.DB_NAME || 'common_models',
|
|
63
|
-
synchronize:
|
|
59
|
+
synchronize: false, // auto-create tables (disable in prod)
|
|
64
60
|
logging: false,
|
|
65
61
|
entities: [
|
|
66
62
|
user_1.User,
|
|
@@ -106,10 +102,6 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
106
102
|
MessageReadStatusModel_1.MessageReadStatus,
|
|
107
103
|
ShifttimesModel_1.ShiftDetails,
|
|
108
104
|
AttendanceModel_1.AttendanceDetails,
|
|
109
|
-
UserShiftModel_1.UserShift
|
|
110
|
-
HolidaysModel_1.Holidays,
|
|
111
|
-
userRolesModel_1.UserRole,
|
|
112
|
-
roleRightsModel_1.RoleRights,
|
|
113
|
-
PortalFeedbackModel_1.PortalFeedback
|
|
105
|
+
UserShiftModel_1.UserShift
|
|
114
106
|
],
|
|
115
107
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,16 @@ 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/
|
|
46
|
-
export * from './models/
|
|
47
|
-
export * from './models/
|
|
48
|
-
export * from './models/
|
|
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';
|
package/dist/index.js
CHANGED
|
@@ -58,7 +58,16 @@ __exportStar(require("./models/ShifttimesModel"), exports);
|
|
|
58
58
|
__exportStar(require("./models/AttendanceModel"), exports);
|
|
59
59
|
__exportStar(require("./models/contactInfoModel"), exports);
|
|
60
60
|
__exportStar(require("./models/UserShiftModel"), exports);
|
|
61
|
-
__exportStar(require("./models/
|
|
62
|
-
__exportStar(require("./models/
|
|
63
|
-
__exportStar(require("./models/
|
|
64
|
-
__exportStar(require("./models/
|
|
61
|
+
__exportStar(require("./models/FinancialRequestsModel"), exports);
|
|
62
|
+
__exportStar(require("./models/PayslipRequestsModel"), exports);
|
|
63
|
+
__exportStar(require("./models/SalaryCertificateRequestsModel"), exports);
|
|
64
|
+
__exportStar(require("./models/AllowanceRequestsModel"), exports);
|
|
65
|
+
__exportStar(require("./models/ReimbursementRequestsModel"), exports);
|
|
66
|
+
__exportStar(require("./models/BankAccountChangeRequestsModel"), exports);
|
|
67
|
+
__exportStar(require("./models/FinancialChatsModel"), exports);
|
|
68
|
+
__exportStar(require("./models/FinancialApprovalsModel"), exports);
|
|
69
|
+
__exportStar(require("./models/FinancialWorkFlowModel"), exports);
|
|
70
|
+
__exportStar(require("./models/FinancialAttachmentsModel"), exports);
|
|
71
|
+
__exportStar(require("./models/RequestTypeMasterModel"), exports);
|
|
72
|
+
__exportStar(require("./models/FinancialSettingsModel"), exports);
|
|
73
|
+
__exportStar(require("./models/AllowanceTypesModel"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare class AllowanceRequests extends BaseModel {
|
|
3
|
+
financial_request_id: number;
|
|
4
|
+
allowance_type_id: number;
|
|
5
|
+
allowance_amount: number;
|
|
6
|
+
approved_allowance_amount: number;
|
|
7
|
+
currency: string;
|
|
8
|
+
constructor(financial_request_id: number, allowance_type_id: number, allowance_amount: number, approved_allowance_amount: number, currency: string);
|
|
9
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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.AllowanceRequests = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let AllowanceRequests = class AllowanceRequests extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(financial_request_id, allowance_type_id, allowance_amount, approved_allowance_amount, currency) {
|
|
17
|
+
super();
|
|
18
|
+
this.financial_request_id = financial_request_id;
|
|
19
|
+
this.allowance_type_id = allowance_type_id;
|
|
20
|
+
this.allowance_amount = allowance_amount;
|
|
21
|
+
this.approved_allowance_amount = approved_allowance_amount;
|
|
22
|
+
this.currency = currency;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.AllowanceRequests = AllowanceRequests;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: 'int', unique: true }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], AllowanceRequests.prototype, "financial_request_id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: 'int' }),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], AllowanceRequests.prototype, "allowance_type_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 2 }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], AllowanceRequests.prototype, "allowance_amount", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 2, nullable: true }),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], AllowanceRequests.prototype, "approved_allowance_amount", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], AllowanceRequests.prototype, "currency", void 0);
|
|
46
|
+
exports.AllowanceRequests = AllowanceRequests = __decorate([
|
|
47
|
+
(0, typeorm_1.Entity)({ name: 'allowance_requests' }),
|
|
48
|
+
__metadata("design:paramtypes", [Number, Number, Number, Number, String])
|
|
49
|
+
], AllowanceRequests);
|
|
@@ -0,0 +1,43 @@
|
|
|
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.AllowanceTypes = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let AllowanceTypes = class AllowanceTypes extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(allowance_code, allowance_name) {
|
|
17
|
+
super();
|
|
18
|
+
this.allowance_code = allowance_code;
|
|
19
|
+
this.allowance_name = allowance_name;
|
|
20
|
+
this.is_active = true;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.AllowanceTypes = AllowanceTypes;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, unique: true }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], AllowanceTypes.prototype, "allowance_code", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], AllowanceTypes.prototype, "allowance_name", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], AllowanceTypes.prototype, "description", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
38
|
+
__metadata("design:type", Boolean)
|
|
39
|
+
], AllowanceTypes.prototype, "is_active", void 0);
|
|
40
|
+
exports.AllowanceTypes = AllowanceTypes = __decorate([
|
|
41
|
+
(0, typeorm_1.Entity)({ name: 'allowance_types' }),
|
|
42
|
+
__metadata("design:paramtypes", [String, String])
|
|
43
|
+
], AllowanceTypes);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare class BankAccountChangeRequests extends BaseModel {
|
|
3
|
+
financial_request_id: number;
|
|
4
|
+
old_bank_name: string;
|
|
5
|
+
old_account_number: string;
|
|
6
|
+
new_bank_name: string;
|
|
7
|
+
new_account_number: string;
|
|
8
|
+
new_account_name: string;
|
|
9
|
+
new_branch_ifsc_code: string;
|
|
10
|
+
reason_for_change: string;
|
|
11
|
+
constructor(financial_request_id: number, new_bank_name: string, new_account_number: string, new_account_name: string, new_branch_ifsc_code: string, reason_for_change: string);
|
|
12
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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.BankAccountChangeRequests = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let BankAccountChangeRequests = class BankAccountChangeRequests extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(financial_request_id, new_bank_name, new_account_number, new_account_name, new_branch_ifsc_code, reason_for_change) {
|
|
17
|
+
super();
|
|
18
|
+
this.financial_request_id = financial_request_id;
|
|
19
|
+
this.new_bank_name = new_bank_name;
|
|
20
|
+
this.new_account_number = new_account_number;
|
|
21
|
+
this.new_account_name = new_account_name;
|
|
22
|
+
this.new_branch_ifsc_code = new_branch_ifsc_code;
|
|
23
|
+
this.reason_for_change = reason_for_change;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.BankAccountChangeRequests = BankAccountChangeRequests;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: 'int', unique: true }),
|
|
29
|
+
__metadata("design:type", Number)
|
|
30
|
+
], BankAccountChangeRequests.prototype, "financial_request_id", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], BankAccountChangeRequests.prototype, "old_bank_name", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], BankAccountChangeRequests.prototype, "old_account_number", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100 }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], BankAccountChangeRequests.prototype, "new_bank_name", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50 }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], BankAccountChangeRequests.prototype, "new_account_number", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], BankAccountChangeRequests.prototype, "new_account_name", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], BankAccountChangeRequests.prototype, "new_branch_ifsc_code", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ type: 'text' }),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], BankAccountChangeRequests.prototype, "reason_for_change", void 0);
|
|
59
|
+
exports.BankAccountChangeRequests = BankAccountChangeRequests = __decorate([
|
|
60
|
+
(0, typeorm_1.Entity)({ name: 'bank_account_change_requests' }),
|
|
61
|
+
__metadata("design:paramtypes", [Number, String, String, String, String, String])
|
|
62
|
+
], BankAccountChangeRequests);
|
|
@@ -35,7 +35,7 @@ __decorate([
|
|
|
35
35
|
__metadata("design:type", String)
|
|
36
36
|
], FMServices.prototype, "description", void 0);
|
|
37
37
|
__decorate([
|
|
38
|
-
(0, typeorm_1.Column)({ nullable:
|
|
38
|
+
(0, typeorm_1.Column)({ nullable: false }),
|
|
39
39
|
__metadata("design:type", String)
|
|
40
40
|
], FMServices.prototype, "logo_url", void 0);
|
|
41
41
|
exports.FMServices = FMServices = __decorate([
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare enum FinancialApprovalStatus {
|
|
3
|
+
PENDING = "Pending",
|
|
4
|
+
APPROVED = "Approved",
|
|
5
|
+
REJECTED = "Rejected",
|
|
6
|
+
SKIPPED = "Skipped"
|
|
7
|
+
}
|
|
8
|
+
export declare class FinancialApprovals extends BaseModel {
|
|
9
|
+
financial_request_id: number;
|
|
10
|
+
level: number;
|
|
11
|
+
approver_user_id: number;
|
|
12
|
+
approver_role_id: number;
|
|
13
|
+
approver_name: string;
|
|
14
|
+
comment: string;
|
|
15
|
+
approval_status: FinancialApprovalStatus;
|
|
16
|
+
action_date: Date;
|
|
17
|
+
sla_days: number;
|
|
18
|
+
is_overdue: boolean;
|
|
19
|
+
constructor(financial_request_id: number, level: number, approver_role_id: number, approval_status: FinancialApprovalStatus);
|
|
20
|
+
}
|