Compare commits

...

294 Commits

Author SHA1 Message Date
7e20807325 corrected the distinct by error 2025-10-11 15:57:53 +05:30
186486d934 Added the new API to get organizations for dropdown 2025-10-11 15:36:52 +05:30
d07f0311ae Optmized the work status master APIs 2025-10-11 13:52:20 +05:30
2f6031e62c revert e02636b6b66287a22fcfb34c150aece1b136cc68
revert Optmized the work status master APIs
2025-10-11 08:19:59 +00:00
e02636b6b6 Optmized the work status master APIs 2025-10-11 13:48:36 +05:30
bad784e147 Optimized the contact related msater APIs 2025-10-11 12:59:31 +05:30
886d0bb3b1 Clearing the employee profile cache when selecting the tenant 2025-10-10 18:32:01 +05:30
74dd9eeb8d organization Tenant Mapping is already existed then return error message 2025-10-10 17:53:23 +05:30
1939a63d9a Assigning the appilcation role to root employee of the any organization 2025-10-10 17:05:43 +05:30
c07db9f94d removed employee project cache when adding the subscription 2025-10-10 15:59:42 +05:30
53da15416a Removing all employees profile from cache for certain tenant 2025-10-10 15:46:56 +05:30
a809bdd469 Merge pull request 'Sloved issues of permissions not been assigned when updating the subscription' (#144) from Ashutosh_Bug#1461 into main
Reviewed-on: #144
2025-10-10 08:49:19 +00:00
bb2c098cb9 Sloved issues of permissions not been assigned when updating the subscription 2025-10-10 14:17:32 +05:30
bd3b70f4ea Merge pull request 'Added the RequestedAt and RequestedBy in attendance' (#143) from Ashutosh_Enhancement#1452 into main
Reviewed-on: #143
2025-10-10 07:06:25 +00:00
000cef3bb7 enhanced the get team based on project 2025-10-10 12:36:11 +05:30
522deae8f7 Added the RequestedAt and RequestedBy in attendance 2025-10-10 12:08:53 +05:30
9a8aa4f5ce Changed the index of reject button in expense controller 2025-10-09 16:52:34 +05:30
af92ab977b Added the get filter API 2025-10-09 16:47:06 +05:30
c06dc8ebe7 Selecting the default services in project allocation 2025-10-09 16:00:26 +05:30
8609db64d2 Made the serviceId is nullable in project allocation 2025-10-09 15:23:37 +05:30
e831f50505 Removed the logic to save the FCM from verify FCM API 2025-10-08 11:33:34 +05:30
ba88fbced6 Removed the FCM token from MPIN verify API 2025-10-08 11:27:30 +05:30
13d2e1cd7d Corrected the mistake of showing all images except selected project 2025-10-07 12:34:48 +05:30
26acfec408 Added the todays completed tasks 2025-10-06 18:33:37 +05:30
3bd38f3c68 Changed the logic in API to get Attendance logs by employee 2025-10-06 16:10:58 +05:30
2e29dc9946 Chnaged the check for persentages 2025-10-06 14:42:29 +05:30
db752a4678 Merge branch 'main' of https://git.marcoaiot.com/admin/marco.pms.api 2025-10-06 13:16:31 +05:30
245182eb07 Added the attendance persentage and task persentage 2025-10-06 13:15:48 +05:30
9daf76c6eb return all employees when allEmployee=true 2025-10-05 00:24:26 +05:30
c33afa58c3 Solved spelling mistake 2025-10-04 17:51:58 +05:30
4ceb5c3cb2 Changed the authontication logic for delete contact notes 2025-10-04 17:50:18 +05:30
d0dabf776b Added the condition to not get services object in project allocation 2025-10-04 17:26:08 +05:30
04223578ad Added the ExpenseUId in expenses tables 2025-10-04 16:56:04 +05:30
f94a7de4ab change email in complete system 2025-10-01 17:46:11 +05:30
eb3a65428e Modyfied the attendance report API 2025-10-01 15:09:51 +05:30
8ddb414e91 Added the organization type in assignd organization list 2025-09-30 18:08:07 +05:30
d8329f1fab Removed the tenant check from master services 2025-09-30 17:10:30 +05:30
d0912cca56 Merge pull request 'Organization_Management' (#142) from Organization_Management into main
Reviewed-on: #142
2025-09-30 09:05:14 +00:00
d957c692f1 Added new API to get monthly attendance report 2025-09-30 14:34:29 +05:30
40ca680f45 Added the Organization sub-menu in project menu in MenuStaticMaster 2025-09-30 12:42:29 +05:30
8dee7b0fa2 Merge branch 'main' of https://git.marcoaiot.com/admin/marco.pms.api into Organization_Management 2025-09-30 12:36:39 +05:30
1e1fe6692d Added the permission check in note create API 2025-09-30 12:34:58 +05:30
0df13975a7 Added logic to add hard coded menu if menu from mongodb connot be found 2025-09-30 12:30:04 +05:30
8fb5aa632d Removed the cache get logic from expenses get APIs 2025-09-30 12:26:10 +05:30
7e4d4b0f5b Chnaged the log to check if sprid in used wile searching 2025-09-30 11:40:43 +05:30
64bde99ab5 Corrected the check to add self organization 2025-09-30 10:18:15 +05:30
90851a3349 Added HasAdmin check when adding note for contact 2025-09-29 17:22:45 +05:30
2c0cd87227 Sloved the issue in get task list where user is getting the list of all tasks accept the task of selected project 2025-09-29 16:50:38 +05:30
c3670eaab9 Added Primary organization of tenant in get organization list 2025-09-29 14:48:42 +05:30
1cd8203d27 Added the PMC, Promotor and Primary organization of the tenant in list of assigned organization to project 2025-09-29 14:33:57 +05:30
5df66b79ca Added check to check the Designation in create contact API 2025-09-29 11:15:14 +05:30
31da8a4402 Added the AsNoTracking in GetCurrentEmployeeAsync and get permission Ids helper functions 2025-09-29 10:18:44 +05:30
27a2610388 Added the HasApplicationAccess in Employee VM 2025-09-29 10:08:14 +05:30
cd175c4fdf Added the services in organization details API 2025-09-29 09:42:21 +05:30
d6145ee0ba Added the forgin key for approver in attends table 2025-09-27 14:50:51 +05:30
04086ed7e0 Creating the application user in manage employee API through mobile 2025-09-27 14:18:42 +05:30
a9b4b79ee4 Added the service ID and Organization ID in get project allocation API 2025-09-27 10:33:42 +05:30
70092e5601 Added the created by and updated by in organization update API 2025-09-26 16:12:46 +05:30
33cd7113a7 Merge pull request 'Add new API to get organization details' (#141) from Ashutosh_Task_#1362 into Organization_Management
Reviewed-on: #141
2025-09-26 10:26:46 +00:00
1d4d61ef2c Add new API to get organization details 2025-09-26 15:53:38 +05:30
f93686c1df Removed the Activity from master menu 2025-09-26 14:59:24 +05:30
f2213db807 Added organizationId filter to the employee list for organization assiged to the project 2025-09-26 11:43:44 +05:30
eddbdde355 Merge pull request 'Added new API to get list of employees assigned to project and filtered by services and organizations' (#140) from Ashutosh_Task#1360 into Organization_Management
Reviewed-on: #140
2025-09-26 06:02:25 +00:00
0048281616 Added new API to get list of employees assigned to project and filtered by services and organizations 2025-09-26 11:30:28 +05:30
f248557704 Optimized the Organization APIs 2025-09-25 17:17:21 +05:30
18d590ccbe Added the promotor and PMC in project VM 2025-09-25 16:56:21 +05:30
4c6070fee5 Merge pull request 'Added the service Id in Query parameter to get infra details API' (#139) from Ashutosh_Enhancement_#1355 into Organization_Management
Reviewed-on: #139
2025-09-25 10:16:20 +00:00
0fb5c3935d Added the service Id in Query parameter to get infra details API 2025-09-25 15:45:47 +05:30
2f052174aa Changed the VM when creating and updating project 2025-09-25 12:37:57 +05:30
2258771229 Merge pull request 'Enhanced the Create and update project API' (#138) from Ashutosh_Enhancement#1347 into Organization_Management
Reviewed-on: #138
2025-09-25 06:50:39 +00:00
e4e49595e6 Enhanced the Create and update project API 2025-09-25 12:18:44 +05:30
44d2827dcc Added the global services ids list parameter in create tenant DTO 2025-09-25 09:54:08 +05:30
fef3db297c Mapping the tenant with organization when creating the organization 2025-09-24 19:43:45 +05:30
0d4d4c3754 Seprated the service ID in task list from filter 2025-09-24 19:35:16 +05:30
162d735d16 Added new API to get employee list 2025-09-24 19:20:21 +05:30
38e1f7a0fc Added no tracking in upate bucket API 2025-09-24 17:47:08 +05:30
fe1dfd7293 Getting the employee list of user's organization only 2025-09-24 17:23:32 +05:30
42da1f12cf Added the assigned by in organization mapping 2025-09-24 17:20:09 +05:30
c5da400e6b Enhanced the manage employe API 2025-09-24 13:06:51 +05:30
a405cfec13 If team meamber not found send empty 2025-09-23 13:24:19 +05:30
bc3e927777 Solved the typo 2025-09-23 13:17:58 +05:30
c304b615f7 Fixed the spelling mistake 2025-09-23 13:15:11 +05:30
8d64e9702d Added the get filter API in image gallery 2025-09-23 13:05:23 +05:30
98acbb66d6 Merge pull request 'Added the new parameter of service ids in image gallery filter' (#137) from Ashutosh_Enhancement_#1297 into Organization_Management
Reviewed-on: #137
2025-09-23 06:26:27 +00:00
81d1137939 Added the new parameter of service ids in image gallery filter 2025-09-23 11:55:29 +05:30
0c6f5e0df0 Merge pull request 'Added the filter and pagenation in get task list API' (#136) from Ashutosh_Enhancement_#1293 into Organization_Management
Reviewed-on: #136
2025-09-23 06:15:47 +00:00
f45bc29a44 Added the filter and pagenation in get task list API 2025-09-23 11:34:14 +05:30
ef84ba34da Addedd the tenant ID in employee profile cache 2025-09-21 18:10:25 +05:30
bd421d45aa Added the Jobrole in attendance 2025-09-21 16:37:15 +05:30
777a72c71f Filtered the employees in attendance by organization 2025-09-21 16:11:23 +05:30
264c9466c9 Chnaged the logic check if tenant and organization have any relation 2025-09-21 15:37:55 +05:30
a1f6552347 Added OrganizationID in JWT token 2025-09-21 11:44:38 +05:30
06c5457981 Added the new API to get detailed list of services and enhanced the get work-items list to filter by service 2025-09-21 11:36:09 +05:30
0ba4ccf45c Added the logic to filter by service Id 2025-09-20 19:25:33 +05:30
84e2f840b4 distinct the organization in Get Assigned Organizations To Project API 2025-09-20 18:37:08 +05:30
34b89c4718 Solved the rebase issues 2025-09-20 18:06:37 +05:30
d0745e8688 Merge pull request 'Firebase_Implementation' (#135) from Firebase_Implementation into main
Reviewed-on: #135
2025-09-20 12:11:54 +00:00
7d85cb5f4c Added the serviceId in project allocation 2025-09-20 17:05:30 +05:30
9b59a4d6b6 Added the organization filter in get project allocation API 2025-09-20 14:58:32 +05:30
7e0322c859 Chnage the keyword modefied to modified 2025-09-20 12:44:39 +05:30
05bfa48115 added the TenantStatus and Industry in get tenant list API 2025-09-20 12:30:37 +05:30
091d73958d Added the comma seprated project IDs to notification data 2025-09-20 12:25:48 +05:30
f45ada2be2 Changed the login endpoints 2025-09-20 12:06:27 +05:30
bcc416f47e Changed the Login Flow for auth controller and added the get tenant list and select tenant 2025-09-20 11:40:04 +05:30
ee1cb73fe5 Added the commit statement in assign organization to tenant API 2025-09-20 11:33:01 +05:30
eba1a70037 Added the data notification in delete employee API 2025-09-20 11:12:32 +05:30
2f03de97d6 Added the total pages, page number, tota count in response 2025-09-19 21:13:53 +05:30
a1ab143df5 Fixed the error of checking the updated date to uploaded date 2025-09-19 18:02:29 +05:30
64e6255458 Solved the rebase issuees 2025-09-19 17:51:27 +05:30
aa596b736d If service not exist in databse the not added in mapping 2025-09-19 16:56:31 +05:30
3884c74d9b First saving the project sevice mapping then the project org mapping 2025-09-19 16:46:41 +05:30
7f2b9f0ceb Merge pull request 'Added the API to get the organization list assigned to the project' (#134) from Ashutosh_Task#1246 into Organization_Management
Reviewed-on: #134
2025-09-19 10:36:49 +00:00
f633e11e97 Added the API to get the organization list assigned to the project 2025-09-19 16:04:32 +05:30
5fab8371ac Merge pull request 'Added the API to assign the organization to tenant' (#133) from Ashutosh_Task#1239 into Organization_Management
Reviewed-on: #133
2025-09-19 10:04:08 +00:00
2e0ea562fe Added the API to assign the organization to tenant 2025-09-19 15:31:07 +05:30
8c97c78408 Added the API to get organization type list 2025-09-19 14:53:55 +05:30
86102ef70d Merge pull request 'Added the API to get list of services according to the project and logged in employee' (#132) from Ashutosh_Task#1225 into Organization_Management
Reviewed-on: #132
2025-09-19 08:53:59 +00:00
009ac36e38 Changed the response message for get services API 2025-09-19 14:22:14 +05:30
d38bc4752a Added the API to get list of services according to the project and logged in employee 2025-09-19 14:15:41 +05:30
77db9a6bd9 Added the services in master menu list 2025-09-19 11:42:23 +05:30
d452faf6a9 Solved the misssig key word 2025-09-18 18:11:57 +05:30
2ce294904b Checking the project levelmpermission in project controller 2025-09-18 18:04:22 +05:30
1e66dd2017 Added the deassiged service from project API 2025-09-18 17:23:50 +05:30
aed6949187 Added IsActive In ProjectServiceMapping Table 2025-09-18 16:54:37 +05:30
b069e9f07d Changed the check of the add note API 2025-09-18 16:17:48 +05:30
d41c49af7b Removed the Document ID Uniqueness 2025-09-18 15:55:45 +05:30
a10b24523e Added the checks to check the Designation and Description in contact 2025-09-18 15:42:49 +05:30
efd8667774 Added the VM in assign organization to project 2025-09-18 15:18:33 +05:30
ac672d0cc2 Added the document ID in document controller firebase data notification 2025-09-18 15:04:41 +05:30
de883103d5 Added the assign organization to project API 2025-09-18 13:10:08 +05:30
bb31e33983 Merge branch 'main' of https://git.marcoaiot.com/admin/marco.pms.api into Organization_Management 2025-09-18 12:02:44 +05:30
51d86d7bfc Merge pull request 'Ashutosh_Subscription_Plan' (#131) from Ashutosh_Subscription_Plan into main
Reviewed-on: #131
2025-09-18 06:32:18 +00:00
2039d84918 Merge branch 'main' of https://git.marcoaiot.com/admin/marco.pms.api into Ashutosh_Subscription_Plan 2025-09-18 12:01:57 +05:30
0ecc07777f Resolved the multi-threading issue 2025-09-18 12:01:08 +05:30
0dd5633f2e Resolved the multi-threading issue 2025-09-18 11:53:05 +05:30
f8182494d2 Merge branch 'main' of https://git.marcoaiot.com/admin/marco.pms.api into Organization_Management 2025-09-18 11:38:31 +05:30
dbd551e08c Merge branch 'main' of https://git.marcoaiot.com/admin/marco.pms.api 2025-09-18 11:34:03 +05:30
d9e0c2ee57 Resloved the issue #1125 2025-09-18 11:33:59 +05:30
db0d464ab5 Merge branch 'main' of https://git.marcoaiot.com/admin/marco.pms.api into Organization_Management 2025-09-18 10:26:29 +05:30
55cae17ed1 Added the API og list organization 2025-09-18 10:25:59 +05:30
846b3ed6e3 Merge pull request 'Ashutosh_Get_All_Permission' (#130) from Ashutosh_Get_All_Permission into main
Reviewed-on: #130
2025-09-18 04:52:11 +00:00
3f8024421a Sending the data message to all employees asigned to the project 2025-09-18 10:07:05 +05:30
9d71a71a53 Sending the attendance data notification to all employees from the project 2025-09-18 09:56:39 +05:30
4a25158cc9 Added the Promoter and PMC in project 2025-09-17 18:09:58 +05:30
20b12cfcd4 Added the contactId in firebase for directory notification 2025-09-17 17:19:55 +05:30
0eb740fa25 Added the organization forgin key in tenant table and removed the tenantId from application user 2025-09-17 15:01:40 +05:30
5158153ee6 Added the forign key of organization in eployee table 2025-09-17 14:40:04 +05:30
4884bf5de0 Checking the manage infra permission when getting the infra 2025-09-17 13:17:38 +05:30
368fd37115 Removed the employee management from project-level permissions 2025-09-17 12:47:09 +05:30
68cd5acc9c Added the HasApplicationAccess parameter in employees table 2025-09-17 12:27:13 +05:30
30623d6bbc Added the create organization API 2025-09-17 12:01:22 +05:30
1e8c967d7a Added migration for Organization related permissions 2025-09-17 11:40:03 +05:30
cda8005b1b Added the Organization related permissions 2025-09-17 11:35:53 +05:30
8d97b2a687 Added the create global service API 2025-09-17 11:15:06 +05:30
061f287e8c Added the API to get global services 2025-09-17 11:01:34 +05:30
84baa3a147 Added the subscription list API in Market Controller 2025-09-16 18:17:43 +05:30
fae6d7bbe9 Added the CRUD operation for services, activity group, activity 2025-09-16 15:29:32 +05:30
0ef9d66cf1 Adding the models related to organizations 2025-09-16 15:27:44 +05:30
d9a1832e2e updated the get project-level permissions 2025-09-16 15:05:32 +05:30
122e7074b8 Added the GetAllPermissionFroProject API 2025-09-16 13:34:22 +05:30
cdc2afb688 Added the update bucket query 2025-09-16 11:36:38 +05:30
892facef40 Added the projectID and employeeID in document modification notification 2025-09-15 18:04:44 +05:30
0b150fed9a Checking the correct permission updating the notes 2025-09-15 17:04:18 +05:30
b17d1d30e5 taken the requried service from thread 2025-09-15 17:01:29 +05:30
a0789f7f8e Corrected the spell mistake in firebase keywords 2025-09-15 16:31:43 +05:30
7d30831408 Removed the requried from base64 when getting any attachment 2025-09-15 16:24:47 +05:30
87ebee8005 Added the firebase notification in document controller 2025-09-12 18:02:58 +05:30
a88446ceb5 Added the firebase notification in directory controller 2025-09-12 16:31:39 +05:30
5717bb6dac Added the joining date parameter when creating or update employee using the mobiles 2025-09-12 12:46:07 +05:30
cf35b8c773 Added the IsAttachmentRequried parameter to ExpensesTypeMaster table 2025-09-12 12:38:26 +05:30
5105da7b54 Resloved the rebase 2025-09-12 09:46:39 +05:30
e1b045f852 Merge pull request 'Document_Manager' (#129) from Document_Manager into main
Reviewed-on: #129
2025-09-11 04:12:00 +00:00
f75c31b3ce Added the check for checking uniquness of document ID 2025-09-10 11:52:13 +05:30
01f214a60b Added the TotalRecords parameter to get contact list API response 2025-09-10 10:27:24 +05:30
935f5345b9 Solved the rebase issues 2025-09-09 16:38:24 +05:30
5263e89df6 Merge pull request 'Directory_Refactor' (#128) from Directory_Refactor into Document_Manager
Reviewed-on: #128
2025-09-09 11:03:45 +00:00
7324537a90 Solved the rebase issues 2025-09-09 16:33:23 +05:30
caeac04d0d Added the logic to bypass the seat check condition 2025-09-09 15:29:26 +05:30
33ebee08db Merge pull request 'Mobile_Logger_Feature' (#127) from Mobile_Logger_Feature into Directory_Refactor
Reviewed-on: #127
2025-09-09 05:19:45 +00:00
d51d7da4f8 Merge branch 'Directory_Refactor' of https://git.marcoaiot.com/admin/marco.pms.api into Mobile_Logger_Feature 2025-09-09 10:49:13 +05:30
de08ceeb0d reduce the otp exprie time to 5 mins 2025-09-08 15:12:26 +05:30
ecabf52f2f splited the logic to get employee by projecr id 2025-09-08 15:09:25 +05:30
aa2a370467 getting the employee list filtered by tenant 2025-09-08 15:07:30 +05:30
73318060ec Added the distinct in get employee list 2025-09-08 14:58:16 +05:30
365439b2de only send employee with unique IDs when getting list 2025-09-08 14:49:14 +05:30
06db1adc52 Added the debug logs in log controller 2025-09-08 11:47:53 +05:30
4f77431541 Changed the folder name 2025-09-08 10:32:32 +05:30
1fd0837640 Solved the rebase error 2025-09-08 10:26:05 +05:30
672046d02e Added the contact note filter in get all contact notes API 2025-09-05 17:48:25 +05:30
48562235f5 Added the get filter APIs for contacts and contact notes 2025-09-04 16:57:37 +05:30
d507b9ede2 Intregating the project-level permissions in document controller 2025-09-04 14:52:25 +05:30
194764c9d6 Solving the rebase confilt 2025-09-04 12:42:44 +05:30
28caee40e3 Adding the overwriting the project-level permissions to tenant-level permission 2025-09-04 12:39:25 +05:30
4a13386546 Optimized the get employee list for project-level permission 2025-09-04 12:27:48 +05:30
b336bd3481 Added the API to get list of employee whom project-level is assigned 2025-09-04 12:19:27 +05:30
3a3e742296 Added the API to get modules for project level configuration 2025-09-03 18:08:43 +05:30
35ea41d1ce Added the file meta-data of file in details and get version API 2025-09-03 18:01:07 +05:30
0916abe464 Added the Manage project-level permissions API 2025-09-03 16:55:20 +05:30
961cc018cf Chnage response of get tag API 2025-09-03 16:05:35 +05:30
2e55d1e3c4 Added the get document tags API 2025-09-03 15:31:26 +05:30
c27b2a2ff1 Added the check to check the system defined types 2025-09-03 14:50:03 +05:30
cd489f45ae added the document categeory vm in document type 2025-09-03 13:15:15 +05:30
4c2b33472b Added the new condition while checking the document category or type by name 2025-09-03 12:51:07 +05:30
9b3324c27c Added the documents in mobile side menu 2025-09-03 11:46:14 +05:30
efc577f9a2 Corrected the equation to gt total number of pages 2025-09-03 11:06:22 +05:30
391d79af3e Created the structure for project-level-permissions APIs 2025-09-02 16:05:08 +05:30
830a9526dd Added the total page and count in list APis for documnets 2025-09-02 15:29:48 +05:30
067da422c2 Added the pagenantion to get version list API 2025-09-02 14:46:51 +05:30
c199e3e241 Added the end-point for maste APIs of document modules 2025-09-02 14:36:42 +05:30
1d50d4987a added the crud opration for document modules 2025-09-02 14:19:03 +05:30
de4d62ba78 added tags in documents details API 2025-09-01 20:56:25 +05:30
b6243f8100 Added the document category in details 2025-09-01 12:09:34 +05:30
727df6e828 Added the download permission to get persigned Url API 2025-08-30 10:27:42 +05:30
e34840fbb8 Added the entity Id in get list API 2025-08-29 18:27:35 +05:30
dd48e5071c Merge pull request 'Added the API to activate and deactivate the document' (#126) from Ashutosh_Task#1036 into Document_Manager
Reviewed-on: #126
2025-08-29 12:54:28 +00:00
242c345ce1 Added the API to activate and deactivate the document 2025-08-29 18:23:55 +05:30
2ca9dead1f Merge pull request 'Added the API to get document attachment details' (#125) from Ashutosh_Task#1029 into Document_Manager
Reviewed-on: #125
2025-08-29 11:48:16 +00:00
ec4756d888 Added the API to get document attachment details 2025-08-29 17:17:38 +05:30
03959f9b38 Merge pull request 'Added the API to get Pre-Signed Url by attachment ID' (#124) from Ashutosh_Task#1027 into Document_Manager
Reviewed-on: #124
2025-08-29 10:42:43 +00:00
ac69bcb339 Added the API to get Pre-Signed Url by attachment ID 2025-08-29 16:11:58 +05:30
a24db1716f Merge pull request 'Added the API to get old version list' (#123) from Ashutosh_Task#1026 into Document_Manager
Reviewed-on: #123
2025-08-29 10:14:48 +00:00
ec85fd8eb3 Added the API to get old version list 2025-08-29 15:44:15 +05:30
61f5b14fcc Merge pull request 'Added the API to verify or reject the document' (#122) from Ashutosh_Task#1025 into Document_Manager
Reviewed-on: #122
2025-08-29 07:41:07 +00:00
87cf37ca03 Added the API to verify or reject the document 2025-08-29 13:10:31 +05:30
0cdbd574db changing the documentDataId if attachment is not verified 2025-08-29 12:42:27 +05:30
72765fd491 Merge pull request 'Added the get filter for documents' (#121) from Ashutosh_Task#1013 into Document_Manager
Reviewed-on: #121
2025-08-29 06:56:16 +00:00
7e98429e10 Added the get filter for documents 2025-08-29 12:25:43 +05:30
759fa9324b Merge pull request 'Added the update document API' (#120) from Ashutosh_Task#1010 into Document_Manager
Reviewed-on: #120
2025-08-29 05:59:39 +00:00
d2af05b6a0 Added the update document API 2025-08-29 11:29:04 +05:30
6d207e8f7d Merge pull request 'Added the list document API' (#119) from Ashutosh_Task#1011 into Document_Manager
Reviewed-on: #119
2025-08-28 11:50:47 +00:00
cf2b07ee77 Added the list document API 2025-08-28 17:20:09 +05:30
08232ee34f Added uploaded by in response of upload document API 2025-08-28 15:13:44 +05:30
d57395efcd Merge pull request 'Added the upload document API' (#118) from Ashutosh_Task#1009 into Document_Manager
Reviewed-on: #118
2025-08-28 09:31:22 +00:00
75ae12a81e Added the upload document API 2025-08-28 15:00:16 +05:30
4c36cf266f Added Document Category and Document Type in master menu list 2025-08-28 14:31:55 +05:30
39ebc69da7 Merge branch 'main' of https://git.marcoaiot.com/admin/marco.pms.api into Document_Manager 2025-08-28 12:53:46 +05:30
8ceac5aa91 Merge pull request 'Added the get list of Document type API' (#117) from Ashutosh_Task#1019 into Document_Manager
Reviewed-on: #117
2025-08-28 07:19:30 +00:00
4161506def Added the get list of Document type API 2025-08-28 12:48:13 +05:30
a89a2f076f Merge pull request 'Added the Get Document Category list API' (#116) from Ashutosh_Task#1018 into Document_Manager
Reviewed-on: #116
2025-08-28 06:47:43 +00:00
eac77e23d4 Added the Get Document Category list API 2025-08-28 12:17:05 +05:30
535a9924cc Merge pull request 'Added the tables for document management' (#115) from Ashutosh_Task#980 into Document_Manager
Reviewed-on: #115
2025-08-28 05:55:42 +00:00
3dfdb2ab5d Added the tables for document management 2025-08-28 11:22:31 +05:30
da787cfe43 Removed the FCM token from login DTO and logic of adding FCM token to database from mobile login API 2025-08-23 11:17:28 +05:30
452f4a7e5a Removed the unnesseary notification 2025-08-21 11:23:17 +05:30
ca31c011e4 Addd code to remove duplicate FCM tokens 2025-08-20 17:11:16 +05:30
5ac1c2b798 Added the expiry date in FCM mapping table 2025-08-20 17:00:17 +05:30
cf51d4f37c Added the notification for expenses controller 2025-08-20 16:07:00 +05:30
2b6e8b7c8a Added proper keyword for firebase notification 2025-08-20 11:19:16 +05:30
4af6891821 Optimized the Directory notes API 2025-08-20 10:55:16 +05:30
455cbc5cd4 Added the firebase to project created and update API 2025-08-19 16:04:56 +05:30
f6ce8dd4f6 Changed the logic to check if logout done by mobile APP 2025-08-19 15:39:34 +05:30
5538c3ae25 Removing the FCM Token if employee is logout 2025-08-19 15:25:20 +05:30
38450dce70 Firebase notification is Implemented in project infra 2025-08-19 12:07:44 +05:30
23473b33f0 Added firebase notification for task allocation 2025-08-18 17:14:27 +05:30
7b1238e7d6 Sending the notification to team member when task is assigned 2025-08-16 11:51:30 +05:30
4655aa948b Chnaged the firebase service-account json 2025-08-14 15:05:32 +05:30
f4cb08f472 Merge branch 'main' of https://git.marcoaiot.com/admin/marco.pms.api into Firebase_Implementation 2025-08-14 14:45:13 +05:30
990b928a63 Added proper logs in firebase service 2025-08-14 11:46:40 +05:30
9a9876b7ca Chnaged the login notification body and title 2025-08-13 16:44:54 +05:30
884efdce61 Sending the data when marking the Attendance 2025-08-13 16:33:19 +05:30
ba5698f4b2 Fixed the typo 2025-08-13 16:04:30 +05:30
673102cb50 Changed the notification body and titile 2025-08-13 15:40:23 +05:30
2699439996 Made FCM token nullable for loginDTO 2025-08-13 15:21:35 +05:30
813bc70bda Added firebase in attendance record API 2025-08-13 15:15:14 +05:30
58b817be99 Added the firebase services 2025-08-13 11:52:44 +05:30
47a3d6035c Changed the Parameter DeviceToken to FcmToken 2025-08-13 10:41:35 +05:30
7f4f266dd0 Changed the notification body 2025-08-13 10:35:24 +05:30
5cf6885a93 Added the FCMTokenMapping model 2025-08-13 10:27:13 +05:30
48fb5fd449 Sending the notification after sending the response 2025-08-13 10:21:07 +05:30
b44fd6d49f Created the structure for set device token API 2025-08-12 14:09:16 +05:30
56977e3702 Added firebase nuget package 2025-08-12 12:00:59 +05:30
6f1a9cd892 solved the conflicts 2025-08-12 11:57:37 +05:30
44614f475b solve confilectes 2025-08-12 11:52:53 +05:30
7335ad23ce added the logs 2025-08-12 11:31:04 +05:30
c5385c0b06 Added logs in login-mobile 2025-08-12 10:54:40 +05:30
6017d87793 Taking token from model 2025-08-12 10:19:31 +05:30
f502adb6c6 added notofication in attendance 2025-08-12 10:15:24 +05:30
1b47fbdcf0 Testing the firebase notification added in login API 2025-08-12 10:03:28 +05:30
37c91d4432 resolving the rebase errors 2025-08-11 16:54:47 +05:30
0ba2874041 solving rebase 2025-08-11 16:52:19 +05:30
4bd3e59427 Sloving the rebase 2025-08-11 16:50:55 +05:30
4a78bb8074 Added updatelogs in update and delete bucket API 2025-08-11 16:37:41 +05:30
e7302ecd6c Added updatelogs in delete contact API 2025-08-11 14:40:49 +05:30
6688b76145 Added updatelogs in update contact API 2025-08-11 14:29:07 +05:30
759d152a9a Resolving the Rebase issues 2025-08-08 12:00:14 +05:30
ef41990d7f Optimized the get list Notes API 2025-08-08 11:47:18 +05:30
830accbe98 Optimized the assign bucket API and delete bucket API in Directory module 2025-08-07 15:16:15 +05:30
3980c14d72 Optimized the contact update API, Delete API , Bucket list API, Create Bucket API, Update Bucket API without implementing cache 2025-08-07 13:28:32 +05:30
9e15cf0447 Optimized the Create contact API in directory module 2025-07-29 15:00:23 +05:30
53a93542e9 Optimized the Get contact details API 2025-07-28 14:50:48 +05:30
019ef5d997 Optimized the contact list API in Directory Controller 2025-07-26 14:57:05 +05:30
373d80260f Removed demo objects for which is used for testing purpose 2025-06-24 10:10:03 +05:30
bb76047605 Implemeted an API to store logs from mobile Application 2025-06-23 17:09:39 +05:30
648b4f9ef0 Implemented firebase client and sended push notification to mobile app 2025-06-11 19:33:21 +05:30
218 changed files with 169668 additions and 3615 deletions

View File

@ -9,6 +9,7 @@ using Marco.Pms.Model.Expenses;
using Marco.Pms.Model.Forum;
using Marco.Pms.Model.Mail;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.OrganizationModel;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.Roles;
using Marco.Pms.Model.TenantModels;
@ -39,6 +40,8 @@ namespace Marco.Pms.DataAccess.Data
public DbSet<SubscriptionPlanDetails> SubscriptionPlanDetails { get; set; }
public DbSet<TenantSubscriptions> TenantSubscriptions { get; set; }
public DbSet<ApplicationUser> ApplicationUsers { get; set; }
public DbSet<ServiceMaster> ServiceMasters { get; set; }
public DbSet<ActivityGroupMaster> ActivityGroupMasters { get; set; }
public DbSet<ActivityMaster> ActivityMasters { get; set; }
public DbSet<Project> Projects { get; set; }
public DbSet<ProjectAllocation> ProjectAllocations { get; set; }
@ -59,6 +62,7 @@ namespace Marco.Pms.DataAccess.Data
public DbSet<Module> Modules { get; set; }
public DbSet<Feature> Features { get; set; }
public DbSet<FeaturePermission> FeaturePermissions { get; set; }
public DbSet<ProjectLevelPermissionMapping> ProjectLevelPermissionMappings { get; set; }
public DbSet<CurrencyMaster> CurrencyMaster { get; set; }
public DbSet<ApplicationRole> ApplicationRoles { get; set; }
public DbSet<JobRole> JobRoles { get; set; }
@ -108,6 +112,26 @@ namespace Marco.Pms.DataAccess.Data
public DbSet<StatusPermissionMapping> StatusPermissionMapping { get; set; }
public DbSet<ExpensesStatusMapping> ExpensesStatusMapping { get; set; }
public DbSet<FCMTokenMapping> FCMTokenMappings { get; set; }
public DbSet<EntityTypeMaster> EntityTypeMasters { get; set; }
public DbSet<DocumentTypeMaster> DocumentTypeMasters { get; set; }
public DbSet<DocumentCategoryMaster> DocumentCategoryMasters { get; set; }
public DbSet<DocumentTagMaster> DocumentTagMasters { get; set; }
public DbSet<DocumentAttachment> DocumentAttachments { get; set; }
public DbSet<AttachmentVersionMapping> AttachmentVersionMappings { get; set; }
public DbSet<AttachmentTagMapping> AttachmentTagMappings { get; set; }
public DbSet<GlobalServiceMaster> GlobalServiceMasters { get; set; }
public DbSet<GlobalActivityGroupMaster> GlobalActivityGroupMasters { get; set; }
public DbSet<GlobalActivityMaster> GlobalActivityMasters { get; set; }
public DbSet<Organization> Organizations { get; set; }
public DbSet<OrgTypeMaster> OrgTypeMasters { get; set; }
public DbSet<TenantOrgMapping> TenantOrgMappings { get; set; }
public DbSet<OrgServiceMapping> OrgServiceMappings { get; set; }
public DbSet<ProjectServiceMapping> ProjectServiceMappings { get; set; }
public DbSet<ProjectOrgMapping> ProjectOrgMappings { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
@ -124,6 +148,7 @@ namespace Marco.Pms.DataAccess.Data
.HasForeignKey(e => e.UserId)
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity<TenantStatus>().HasData(
new TenantStatus
{
@ -142,6 +167,21 @@ namespace Marco.Pms.DataAccess.Data
}
);
modelBuilder.Entity<Organization>().HasData(
new Organization
{
Id = Guid.Parse("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"),
Name = "MarcoBMS",
ContactPerson = "Admin",
Email = "admin@marcoaiot.com",
ContactNumber = "123456789",
Address = "2nd Floor, Fullora Building, Tejas CHS, behind Kothrud Stand, Tejas Society, Dahanukar Colony, Kothrud, Pune, Maharashtra 411038",
CreatedAt = DateTime.MinValue,
SPRID = 5400,
IsActive = true
}
);
modelBuilder.Entity<Tenant>().HasData(
new Tenant
{
@ -155,6 +195,7 @@ namespace Marco.Pms.DataAccess.Data
DomainName = "www.marcobms.org",
TenantStatusId = Guid.Parse("62b05792-5115-4f99-8ff5-e8374859b191"),
IndustryId = Guid.Parse("15436ee3-a650-469e-bfc2-59993f7514bb"),
OrganizationId = Guid.Parse("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"),
BillingAddress = "2nd Floor, Fullora Building, Tejas CHS, behind Kothrud Stand, Tejas Society, Dahanukar Colony, Kothrud, Pune, Maharashtra 411038",
OnBoardingDate = DateTime.MinValue,
IsSuperTenant = true,
@ -189,6 +230,7 @@ namespace Marco.Pms.DataAccess.Data
Status = "Completed"
}
);
modelBuilder.Entity<Project>().HasData(
new Project
{
@ -218,6 +260,7 @@ namespace Marco.Pms.DataAccess.Data
new Industry { Id = Guid.Parse("8a0d6134-2dbe-4e0a-b250-ff34cb7b9df0"), Name = "Education & Training" }
);
modelBuilder.Entity<TicketStatusMaster>().HasData(
new TicketStatusMaster
{
@ -265,6 +308,7 @@ namespace Marco.Pms.DataAccess.Data
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
modelBuilder.Entity<TicketTypeMaster>().HasData(
new TicketTypeMaster
{
@ -283,6 +327,7 @@ namespace Marco.Pms.DataAccess.Data
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
modelBuilder.Entity<TicketPriorityMaster>().HasData(
new TicketPriorityMaster
{
@ -330,6 +375,7 @@ namespace Marco.Pms.DataAccess.Data
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
modelBuilder.Entity<TicketTagMaster>().HasData(
new TicketTagMaster
{
@ -375,6 +421,7 @@ namespace Marco.Pms.DataAccess.Data
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
modelBuilder.Entity<WorkStatusMaster>().HasData(
new WorkStatusMaster
{
@ -618,6 +665,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Materials, equipment and supplies purchased for site operations.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -627,6 +675,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Vehicle fuel, logistics services and delivery of goods or personnel.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = false,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -636,6 +685,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Delivery of personnel.",
NoOfPersonsRequired = true,
IsActive = true,
IsAttachmentRequried = false,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -645,6 +695,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Site setup costs including equipment deployment and temporary infrastructure.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -654,6 +705,7 @@ namespace Marco.Pms.DataAccess.Data
Description = " Worker amenities like snacks, meals, safety gear, accommodation, medical support etc.",
NoOfPersonsRequired = true,
IsActive = true,
IsAttachmentRequried = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -663,6 +715,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Machinery servicing, electricity, water, and temporary office needs.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -672,6 +725,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Scheduled payments for external services or goods.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -681,6 +735,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Government fees, insurance, inspections and safety-related expenditures.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
@ -720,6 +775,205 @@ namespace Marco.Pms.DataAccess.Data
}
);
modelBuilder.Entity<EntityTypeMaster>().HasData(
new EntityTypeMaster
{
Id = Guid.Parse("c8fe7115-aa27-43bc-99f4-7b05fabe436e"),
Name = "Project Entity",
Description = "Emtities related to project."
},
new EntityTypeMaster
{
Id = Guid.Parse("dbb9555a-7a0c-40f2-a9ed-f0463f1ceed7"),
Name = "Employee Entity",
Description = "Employee related entitie",
}
);
modelBuilder.Entity<DocumentCategoryMaster>().HasData(
new DocumentCategoryMaster
{
Id = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
Name = "Project Documents",
Description = "Project documents are formal records that outline the plans, progress, and details necessary to execute and manage a project effectively.",
EntityTypeId = Guid.Parse("c8fe7115-aa27-43bc-99f4-7b05fabe436e"),
CreatedAt = new DateTime(2025, 9, 15, 12, 42, 3, 202, DateTimeKind.Utc),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new DocumentCategoryMaster
{
Id = Guid.Parse("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
Name = "Employee Documents",
Description = "Employment details along with legal IDs like passports or drivers licenses to verify identity and work authorization.",
EntityTypeId = Guid.Parse("dbb9555a-7a0c-40f2-a9ed-f0463f1ceed7"),
CreatedAt = new DateTime(2025, 9, 15, 12, 42, 3, 202, DateTimeKind.Utc),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
modelBuilder.Entity<DocumentTypeMaster>().HasData(
new DocumentTypeMaster
{
Id = Guid.Parse("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
Name = "Aadhaar card",
RegexExpression = "^[2-9][0-9]{11}$",
AllowedContentType = "application/pdf,image/jpeg",
MaxSizeAllowedInMB = 2,
IsValidationRequired = true,
IsMandatory = true,
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
IsSystem = true,
IsActive = true,
DocumentCategoryId = Guid.Parse("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new DocumentTypeMaster
{
Id = Guid.Parse("6344393b-9bb1-45f8-b620-9f6e279d012c"),
Name = "Pan Card",
RegexExpression = "^[A-Z]{5}[0-9]{4}[A-Z]{1}$",
AllowedContentType = "application/pdf,image/jpeg",
MaxSizeAllowedInMB = 2,
IsValidationRequired = true,
IsMandatory = true,
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
IsSystem = true,
IsActive = true,
DocumentCategoryId = Guid.Parse("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new DocumentTypeMaster
{
Id = Guid.Parse("2d1d7441-46a8-425e-9395-94d0956f8e91"),
Name = "Voter Card",
RegexExpression = "^[A-Z]{3}[0-9]{7}$",
AllowedContentType = "application/pdf,image/jpeg",
MaxSizeAllowedInMB = 2,
IsValidationRequired = true,
IsMandatory = true,
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
IsSystem = true,
IsActive = true,
DocumentCategoryId = Guid.Parse("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new DocumentTypeMaster
{
Id = Guid.Parse("16c40b80-c207-4a0c-a4d3-381414afe35a"),
Name = "Passport",
RegexExpression = "^[A-PR-WY][1-9]\\d\\s?\\d{4}[1-9]$",
AllowedContentType = "application/pdf,image/jpeg",
MaxSizeAllowedInMB = 2,
IsValidationRequired = true,
IsMandatory = true,
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
IsSystem = true,
IsActive = true,
DocumentCategoryId = Guid.Parse("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new DocumentTypeMaster
{
Id = Guid.Parse("f76d8215-d399-4f0e-b414-12e427f50be3"),
Name = "Bank Passbook",
RegexExpression = "^\\d{9,18}$",
AllowedContentType = "application/pdf,image/jpeg",
MaxSizeAllowedInMB = 2,
IsValidationRequired = true,
IsMandatory = true,
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
IsSystem = true,
IsActive = true,
DocumentCategoryId = Guid.Parse("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new DocumentTypeMaster
{
Id = Guid.Parse("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
Name = "Bill of Quantities (BOQ)",
AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
MaxSizeAllowedInMB = 1,
IsValidationRequired = false,
IsMandatory = false,
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
IsSystem = true,
IsActive = true,
DocumentCategoryId = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new DocumentTypeMaster
{
Id = Guid.Parse("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
Name = "Work Order",
AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
MaxSizeAllowedInMB = 1,
IsValidationRequired = false,
IsMandatory = false,
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
IsSystem = true,
IsActive = true,
DocumentCategoryId = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new DocumentTypeMaster
{
Id = Guid.Parse("07ca7182-9ac0-4407-b988-59901170cb86"),
Name = "Letter of Agreement",
AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
MaxSizeAllowedInMB = 1,
IsValidationRequired = false,
IsMandatory = false,
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
IsSystem = true,
IsActive = true,
DocumentCategoryId = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new DocumentTypeMaster
{
Id = Guid.Parse("846e89a9-5735-45ec-a21d-c97f85a94ada"),
Name = "Health and Safety Document",
AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
MaxSizeAllowedInMB = 1,
IsValidationRequired = false,
IsMandatory = false,
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
IsSystem = true,
IsActive = true,
DocumentCategoryId = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new DocumentTypeMaster
{
Id = Guid.Parse("7cc41c91-23cb-442b-badd-f932138d149f"),
Name = "Standard Operating Procedure (SOP)",
AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
MaxSizeAllowedInMB = 1,
IsValidationRequired = false,
IsMandatory = false,
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
IsSystem = true,
IsActive = true,
DocumentCategoryId = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new DocumentTypeMaster
{
Id = Guid.Parse("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
Name = "Drawings",
AllowedContentType = "application/pdf,image/vnd.dwg,application/acad",
MaxSizeAllowedInMB = 20,
IsValidationRequired = false,
IsMandatory = false,
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
IsSystem = true,
IsActive = true,
DocumentCategoryId = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
modelBuilder.Entity<SubscriptionStatus>().HasData(
new SubscriptionStatus
{
@ -738,6 +992,19 @@ namespace Marco.Pms.DataAccess.Data
}
);
modelBuilder.Entity<OrgTypeMaster>().HasData(
new OrgTypeMaster
{
Id = Guid.Parse("5ee49bcd-b6d3-482f-9aaf-484afe04abec"),
Name = "Service Provider"
},
new OrgTypeMaster
{
Id = Guid.Parse("a283356a-9b02-4029-afb7-e65c703efdd4"),
Name = "Sub-Contractor"
}
);
modelBuilder.Entity<Module>().HasData(
new Module
{
@ -777,10 +1044,14 @@ namespace Marco.Pms.DataAccess.Data
// Employee Module
new Feature { Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), Description = "Manage Employee", Name = "Employee Management", ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), IsActive = true },
new Feature { Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), Description = "Attendance", Name = "Attendance Management", ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), IsActive = true },
new Feature { Id = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), Description = "Manage Document", Name = "Document Management", ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), IsActive = true },
// Master Module
new Feature { Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), Description = "Global Masters", Name = "Masters", ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), IsActive = true },
new Feature { Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), Description = "Managing all directory related rights", Name = "Directory Management", ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), IsActive = true },
new Feature { Id = new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"), Description = "Managing all organization related rights", Name = "Organization Management", ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), IsActive = true },
// Tenant Module
new Feature { Id = new Guid("2f3509b7-160d-410a-b9b6-daadd96c986d"), Description = "Managing all tenant related rights", Name = "Tenant Management", ModuleId = new Guid("f482a079-4dec-4f2d-9867-6baf2a4f23d9"), IsActive = true }
);
@ -817,6 +1088,14 @@ namespace Marco.Pms.DataAccess.Data
new FeaturePermission { Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), IsEnabled = true, Name = "View Masters", Description = "Grants a user read-only access to foundational or reference data within the system. \"Masters\" typically refer to predefined lists, categories, or templates that are used throughout the application to standardize information and maintain consistency" },
new FeaturePermission { Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), IsEnabled = true, Name = "Manage Masters", Description = "Grants a user the authority to create, modify, and delete foundational or reference data within the system. These \"masters\" are typically the core lists, categories, and configurations that other data and functionalities rely upon, such as departments, job titles, product categories" },
//Document Management Feature
new FeaturePermission { Id = new Guid("71189504-f1c8-4ca5-8db6-810497be2854"), FeatureId = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), IsEnabled = true, Name = "View Document", Description = "Grants a user the authority to view all documents related to employees and projects" },
new FeaturePermission { Id = new Guid("3f6d1f67-6fa5-4b7c-b17b-018d4fe4aab8"), FeatureId = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), IsEnabled = true, Name = "Upload Document", Description = "Grants a user the authority to upload the document" },
new FeaturePermission { Id = new Guid("c423fd81-6273-4b9d-bb5e-76a0fb343833"), FeatureId = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), IsEnabled = true, Name = "Mofify Document", Description = "Grants a user the authority to modify document" },
new FeaturePermission { Id = new Guid("40863a13-5a66-469d-9b48-135bc5dbf486"), FeatureId = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), IsEnabled = true, Name = "Delete Document", Description = "Grants a user the authority to delete the document" },
new FeaturePermission { Id = new Guid("404373d0-860f-490e-a575-1c086ffbce1d"), FeatureId = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), IsEnabled = true, Name = "Download Document", Description = "Grants a user the authority to download the document" },
new FeaturePermission { Id = new Guid("13a1f30f-38d1-41bf-8e7a-b75189aab8e0"), FeatureId = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), IsEnabled = true, Name = "Verify Document", Description = "Grants a user the authority to verify the document" },
// Directory Management Feature
new FeaturePermission { Id = new Guid("4286a13b-bb40-4879-8c6d-18e9e393beda"), FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), IsEnabled = true, Name = "Directory Admin", Description = "Full control over all directories, including the ability to manage permissions for all directories in the system." },
new FeaturePermission { Id = new Guid("62668630-13ce-4f52-a0f0-db38af2230c5"), FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), IsEnabled = true, Name = "Directory Manager", Description = "Full control over directories they created or have been assigned. Can also manage permissions for those directories." },
@ -829,7 +1108,12 @@ namespace Marco.Pms.DataAccess.Data
new FeaturePermission { Id = new Guid("1f4bda08-1873-449a-bb66-3e8222bd871b"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Review", Description = "Allows a user to examine submitted expenses for accuracy, completeness, and policy compliance before they are approved or rejected." },
new FeaturePermission { Id = new Guid("eaafdd76-8aac-45f9-a530-315589c6deca"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Approve", Description = "Allows a user to authorize or reject submitted expenses, making them officially accepted or declined within the system." },
new FeaturePermission { Id = new Guid("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Process", Description = "Allows a user to handle post-approval actions such as recording payments, updating financial records, or marking expenses as reimbursed or settled." },
new FeaturePermission { Id = new Guid("bdee29a2-b73b-402d-8dd1-c4b1f81ccbc3"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Manage", Description = "Allows a user to configure and control system settings, such as managing expense types, payment modes, permissions, and overall workflow rules." }
new FeaturePermission { Id = new Guid("bdee29a2-b73b-402d-8dd1-c4b1f81ccbc3"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Manage", Description = "Allows a user to configure and control system settings, such as managing expense types, payment modes, permissions, and overall workflow rules." },
// Organization Management Feature
new FeaturePermission { Id = new Guid("068cb3c1-49c5-4746-9f29-1fce16e820ac"), FeatureId = new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"), IsEnabled = true, Name = "Add Organization", Description = "Allow user to create new organization" },
new FeaturePermission { Id = new Guid("c1ae1363-ab8a-4bd9-a9d1-8c2c6083873a"), FeatureId = new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"), IsEnabled = true, Name = "Edit Organization", Description = "Allow the user to update the basic information of the organization" },
new FeaturePermission { Id = new Guid("7a6cf830-0008-4e03-b31d-0d050cb634f4"), FeatureId = new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"), IsEnabled = true, Name = "View Organization", Description = "Allow the user to view information of the organization" }
);

View File

@ -62,7 +62,6 @@ namespace Marco.Pms.DataAccess.Initializer
// State = "State",
// Postalcode = "1234567890",
// City = "City",
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26"),
IsRootUser = true,
}, "User@123").GetAwaiter().GetResult();
@ -78,13 +77,10 @@ namespace Marco.Pms.DataAccess.Initializer
Gender = "",
EmergencyPhoneNumber = "1234567890",
CurrentAddress = "",
AadharNumber = "1234567890",
ApplicationUserId = user.Id,
BirthDate = DateTime.MinValue,
PanNumber = "",
PermanentAddress = "",
PhoneNumber = "",
TenantId = user.TenantId
PhoneNumber = ""
};
_db.Employees.Add(emp);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_FCMTokenMApping_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "FCMTokenMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
EmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FcmToken = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_FCMTokenMappings", x => x.Id);
table.ForeignKey(
name: "FK_FCMTokenMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_FCMTokenMappings_TenantId",
table: "FCMTokenMappings",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "FCMTokenMappings");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Expriy_Date_In_FCMMapping_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "ExpiredAt",
table: "FCMTokenMappings",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ExpiredAt",
table: "FCMTokenMappings");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,488 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Document_Manager_Tables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DocumentTagMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DocumentTagMasters", x => x.Id);
table.ForeignKey(
name: "FK_DocumentTagMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "EntityTypeMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_EntityTypeMasters", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DocumentCategoryMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
EntityTypeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DocumentCategoryMasters", x => x.Id);
table.ForeignKey(
name: "FK_DocumentCategoryMasters_EntityTypeMasters_EntityTypeId",
column: x => x.EntityTypeId,
principalTable: "EntityTypeMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentCategoryMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DocumentTypeMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
RegexExpression = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
AllowedContentType = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
MaxSizeAllowedInMB = table.Column<double>(type: "double", nullable: false),
IsValidationRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsMandatory = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsSystem = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
DocumentCategoryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DocumentTypeMasters", x => x.Id);
table.ForeignKey(
name: "FK_DocumentTypeMasters_DocumentCategoryMasters_DocumentCategory~",
column: x => x.DocumentCategoryId,
principalTable: "DocumentCategoryMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentTypeMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DocumentAttachments",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
DocumentId = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UploadedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UploadedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
VerifiedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
IsVerified = table.Column<bool>(type: "tinyint(1)", nullable: true),
VerifiedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
EntityId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DocumentTypeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DocumentAttachments", x => x.Id);
table.ForeignKey(
name: "FK_DocumentAttachments_DocumentTypeMasters_DocumentTypeId",
column: x => x.DocumentTypeId,
principalTable: "DocumentTypeMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentAttachments_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_DocumentAttachments_Employees_UploadedById",
column: x => x.UploadedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentAttachments_Employees_VerifiedById",
column: x => x.VerifiedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_DocumentAttachments_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AttachmentTagMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DocumentTagId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AttachmentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_AttachmentTagMappings", x => x.Id);
table.ForeignKey(
name: "FK_AttachmentTagMappings_DocumentAttachments_AttachmentId",
column: x => x.AttachmentId,
principalTable: "DocumentAttachments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttachmentTagMappings_DocumentTagMasters_DocumentTagId",
column: x => x.DocumentTagId,
principalTable: "DocumentTagMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttachmentTagMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AttachmentVersionMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ParentAttachmentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Version = table.Column<int>(type: "int", nullable: false),
ChildAttachmentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_AttachmentVersionMappings", x => x.Id);
table.ForeignKey(
name: "FK_AttachmentVersionMappings_DocumentAttachments_ChildAttachmen~",
column: x => x.ChildAttachmentId,
principalTable: "DocumentAttachments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttachmentVersionMappings_DocumentAttachments_ParentAttachme~",
column: x => x.ParentAttachmentId,
principalTable: "DocumentAttachments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttachmentVersionMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DocumentAttachmentMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AttachmentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DocumentAttachmentMappings", x => x.Id);
table.ForeignKey(
name: "FK_DocumentAttachmentMappings_DocumentAttachments_AttachmentId",
column: x => x.AttachmentId,
principalTable: "DocumentAttachments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentAttachmentMappings_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentAttachmentMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "EntityTypeMasters",
columns: new[] { "Id", "Description", "Name" },
values: new object[,]
{
{ new Guid("c8fe7115-aa27-43bc-99f4-7b05fabe436e"), "Emtities related to project.", "Project Entity" },
{ new Guid("dbb9555a-7a0c-40f2-a9ed-f0463f1ceed7"), "Employee related entitie", "Employee Entity" }
});
migrationBuilder.InsertData(
table: "Features",
columns: new[] { "Id", "Description", "IsActive", "ModuleId", "Name" },
values: new object[] { new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), "Manage Document", true, new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), "Document Management" });
migrationBuilder.InsertData(
table: "DocumentCategoryMasters",
columns: new[] { "Id", "CreatedAt", "Description", "EntityTypeId", "Name", "TenantId" },
values: new object[,]
{
{ new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8157), "Employment details along with legal IDs like passports or drivers licenses to verify identity and work authorization.", new Guid("dbb9555a-7a0c-40f2-a9ed-f0463f1ceed7"), "Employee Documents", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8150), "Project documents are formal records that outline the plans, progress, and details necessary to execute and manage a project effectively.", new Guid("c8fe7115-aa27-43bc-99f4-7b05fabe436e"), "Project Documents", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.InsertData(
table: "FeaturePermissions",
columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" },
values: new object[,]
{
{ new Guid("13a1f30f-38d1-41bf-8e7a-b75189aab8e0"), "Grants a user the authority to verify the document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Verify Document" },
{ new Guid("3f6d1f67-6fa5-4b7c-b17b-018d4fe4aab8"), "Grants a user the authority to upload the document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Upload Document" },
{ new Guid("40863a13-5a66-469d-9b48-135bc5dbf486"), "Grants a user the authority to delete the document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Delete Document" },
{ new Guid("71189504-f1c8-4ca5-8db6-810497be2854"), "Grants a user the authority to view all documents related to employees and projects", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "View Document" },
{ new Guid("c423fd81-6273-4b9d-bb5e-76a0fb343833"), "Grants a user the authority to modify document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Mofify Document" }
});
migrationBuilder.InsertData(
table: "DocumentTypeMasters",
columns: new[] { "Id", "AllowedContentType", "CreatedAt", "DocumentCategoryId", "IsActive", "IsMandatory", "IsSystem", "IsValidationRequired", "MaxSizeAllowedInMB", "Name", "RegexExpression", "TenantId" },
values: new object[,]
{
{ new Guid("07ca7182-9ac0-4407-b988-59901170cb86"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8229), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Letter of Agreement", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8216), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Passport", "^[A-PR-WY][1-9]\\d\\s?\\d{4}[1-9]$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8222), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Bill of Quantities (BOQ)", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8212), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Voter Card", "^[A-Z]{3}[0-9]{7}$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8204), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Aadhaar card", "^[2-9][0-9]{11}$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"), "application/pdf,image/vnd.dwg,application/acad", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8238), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 20.0, "Drawings", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8209), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Pan Card", "^[A-Z]{5}[0-9]{4}[A-Z]{1}$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("7cc41c91-23cb-442b-badd-f932138d149f"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8235), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Standard Operating Procedure (SOP)", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8232), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Health and Safety Document", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8226), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Work Order", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8219), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Bank Passbook", "^\\d{9,18}$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.CreateIndex(
name: "IX_AttachmentTagMappings_AttachmentId",
table: "AttachmentTagMappings",
column: "AttachmentId");
migrationBuilder.CreateIndex(
name: "IX_AttachmentTagMappings_DocumentTagId",
table: "AttachmentTagMappings",
column: "DocumentTagId");
migrationBuilder.CreateIndex(
name: "IX_AttachmentTagMappings_TenantId",
table: "AttachmentTagMappings",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_AttachmentVersionMappings_ChildAttachmentId",
table: "AttachmentVersionMappings",
column: "ChildAttachmentId");
migrationBuilder.CreateIndex(
name: "IX_AttachmentVersionMappings_ParentAttachmentId",
table: "AttachmentVersionMappings",
column: "ParentAttachmentId");
migrationBuilder.CreateIndex(
name: "IX_AttachmentVersionMappings_TenantId",
table: "AttachmentVersionMappings",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachmentMappings_AttachmentId",
table: "DocumentAttachmentMappings",
column: "AttachmentId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachmentMappings_DocumentId",
table: "DocumentAttachmentMappings",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachmentMappings_TenantId",
table: "DocumentAttachmentMappings",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachments_DocumentTypeId",
table: "DocumentAttachments",
column: "DocumentTypeId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachments_TenantId",
table: "DocumentAttachments",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachments_UpdatedById",
table: "DocumentAttachments",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachments_UploadedById",
table: "DocumentAttachments",
column: "UploadedById");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachments_VerifiedById",
table: "DocumentAttachments",
column: "VerifiedById");
migrationBuilder.CreateIndex(
name: "IX_DocumentCategoryMasters_EntityTypeId",
table: "DocumentCategoryMasters",
column: "EntityTypeId");
migrationBuilder.CreateIndex(
name: "IX_DocumentCategoryMasters_TenantId",
table: "DocumentCategoryMasters",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_DocumentTagMasters_TenantId",
table: "DocumentTagMasters",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_DocumentTypeMasters_DocumentCategoryId",
table: "DocumentTypeMasters",
column: "DocumentCategoryId");
migrationBuilder.CreateIndex(
name: "IX_DocumentTypeMasters_TenantId",
table: "DocumentTypeMasters",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AttachmentTagMappings");
migrationBuilder.DropTable(
name: "AttachmentVersionMappings");
migrationBuilder.DropTable(
name: "DocumentAttachmentMappings");
migrationBuilder.DropTable(
name: "DocumentTagMasters");
migrationBuilder.DropTable(
name: "DocumentAttachments");
migrationBuilder.DropTable(
name: "DocumentTypeMasters");
migrationBuilder.DropTable(
name: "DocumentCategoryMasters");
migrationBuilder.DropTable(
name: "EntityTypeMasters");
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("13a1f30f-38d1-41bf-8e7a-b75189aab8e0"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("3f6d1f67-6fa5-4b7c-b17b-018d4fe4aab8"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("40863a13-5a66-469d-9b48-135bc5dbf486"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("71189504-f1c8-4ca5-8db6-810497be2854"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("c423fd81-6273-4b9d-bb5e-76a0fb343833"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"));
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,285 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Removed_DocumentAttachmentyMapping_And_Added : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DocumentAttachmentMappings");
migrationBuilder.AddColumn<Guid>(
name: "DocumentDataId",
table: "DocumentAttachments",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7895));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7887));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7995));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf,image/jpeg", new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7975) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7984));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf,image/jpeg", new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7971) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf,image/jpeg", new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7958) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(8008));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf,image/jpeg", new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7966) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(8004));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(8000));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7991));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf,image/jpeg", new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7980) });
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachments_DocumentDataId",
table: "DocumentAttachments",
column: "DocumentDataId");
migrationBuilder.AddForeignKey(
name: "FK_DocumentAttachments_Documents_DocumentDataId",
table: "DocumentAttachments",
column: "DocumentDataId",
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DocumentAttachments_Documents_DocumentDataId",
table: "DocumentAttachments");
migrationBuilder.DropIndex(
name: "IX_DocumentAttachments_DocumentDataId",
table: "DocumentAttachments");
migrationBuilder.DropColumn(
name: "DocumentDataId",
table: "DocumentAttachments");
migrationBuilder.CreateTable(
name: "DocumentAttachmentMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AttachmentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DocumentAttachmentMappings", x => x.Id);
table.ForeignKey(
name: "FK_DocumentAttachmentMappings_DocumentAttachments_AttachmentId",
column: x => x.AttachmentId,
principalTable: "DocumentAttachments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentAttachmentMappings_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentAttachmentMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8157));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8150));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8229));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8216) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8222));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8212) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8204) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8238));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8209) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8235));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8232));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8226));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8219) });
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachmentMappings_AttachmentId",
table: "DocumentAttachmentMappings",
column: "AttachmentId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachmentMappings_DocumentId",
table: "DocumentAttachmentMappings",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachmentMappings_TenantId",
table: "DocumentAttachmentMappings",
column: "TenantId");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,212 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_IsCurrentVersion_Field_In_Document_Attachment : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsCurrentVersion",
table: "DocumentAttachments",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1227));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1217));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1308));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1293));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1300));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1289));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1275));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1391));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1284));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1388));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1384));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1305));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1297));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsCurrentVersion",
table: "DocumentAttachments");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7895));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7887));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7995));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7975));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7984));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7971));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7958));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(8008));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7966));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(8004));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(8000));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7991));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7980));
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,237 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Modified_UpdatedAt_And_VerifiedAt_To_Nullable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "VerifiedAt",
table: "DocumentAttachments",
type: "datetime(6)",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime(6)");
migrationBuilder.AlterColumn<DateTime>(
name: "UpdatedAt",
table: "DocumentAttachments",
type: "datetime(6)",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime(6)");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(8988));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(8981));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9059));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9042));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9051));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9038));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9028));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9072));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9034));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9068));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9063));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9055));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9046));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "VerifiedAt",
table: "DocumentAttachments",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "UpdatedAt",
table: "DocumentAttachments",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true);
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1227));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1217));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1308));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1293));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1300));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1289));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1275));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1391));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1284));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1388));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1384));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1305));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1297));
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,211 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_New_Permission_To_Download_Document : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2627));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2617));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2718));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2700));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2710));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2695));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2684));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2731));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2690));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2727));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2722));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2714));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2705));
migrationBuilder.InsertData(
table: "FeaturePermissions",
columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" },
values: new object[] { new Guid("404373d0-860f-490e-a575-1c086ffbce1d"), "Grants a user the authority to download the document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Download Document" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("404373d0-860f-490e-a575-1c086ffbce1d"));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(8988));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(8981));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9059));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9042));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9051));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9038));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9028));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9072));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9034));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9068));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9063));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9055));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9046));
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,264 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Project_Level_Permssion_Mapping_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ProjectLevelPermissionMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
EmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ProjectId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PermissionId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ProjectLevelPermissionMappings", x => x.Id);
table.ForeignKey(
name: "FK_ProjectLevelPermissionMappings_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectLevelPermissionMappings_FeaturePermissions_Permission~",
column: x => x.PermissionId,
principalTable: "FeaturePermissions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectLevelPermissionMappings_Projects_ProjectId",
column: x => x.ProjectId,
principalTable: "Projects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectLevelPermissionMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6233));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6226));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6307));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6290));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6298));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6286));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6275));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6319));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6282));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6314));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6311));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6302));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6295));
migrationBuilder.CreateIndex(
name: "IX_ProjectLevelPermissionMappings_EmployeeId",
table: "ProjectLevelPermissionMappings",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_ProjectLevelPermissionMappings_PermissionId",
table: "ProjectLevelPermissionMappings",
column: "PermissionId");
migrationBuilder.CreateIndex(
name: "IX_ProjectLevelPermissionMappings_ProjectId",
table: "ProjectLevelPermissionMappings",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_ProjectLevelPermissionMappings_TenantId",
table: "ProjectLevelPermissionMappings",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ProjectLevelPermissionMappings");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2627));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2617));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2718));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2700));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2710));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2695));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2684));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2731));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2690));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2727));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2722));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2714));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2705));
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,268 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_IsAttachmentRequried_Parameter_In_ExpensesTypeMaster_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsAttachmentRequried",
table: "ExpensesTypeMaster",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 9, 12, 7, 6, 13, 429, DateTimeKind.Utc).AddTicks(3323));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 12, 7, 6, 13, 429, DateTimeKind.Utc).AddTicks(3316));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("1e2d697a-76b4-4be8-bc66-87144561a1a0"),
column: "IsAttachmentRequried",
value: true);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("2de53163-0dbd-404b-8e60-1b02e6b4886a"),
column: "IsAttachmentRequried",
value: false);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("4842fa61-64eb-4241-aebd-8282065af9f9"),
column: "IsAttachmentRequried",
value: true);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("52484820-1b54-4865-8f0f-baa2b1d339b9"),
column: "IsAttachmentRequried",
value: true);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("5e0c6227-d49d-41ff-9f1f-781f0aee2469"),
column: "IsAttachmentRequried",
value: true);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("77013784-9324-4d8b-bd36-d6f928e68942"),
column: "IsAttachmentRequried",
value: true);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("dd120bc4-ab0a-45ba-8450-5cd45ff221ca"),
column: "IsAttachmentRequried",
value: false);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("fc59eb90-98ea-481c-b421-54bfa9e42d8f"),
column: "IsAttachmentRequried",
value: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsAttachmentRequried",
table: "ExpensesTypeMaster");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6233));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6226));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6307));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6290));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6298));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6286));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6275));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6319));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6282));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6314));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6311));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6302));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6295));
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,757 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Tables_Related_To_Organizations : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "UnitOfMeasurement",
keyValue: null,
column: "UnitOfMeasurement",
value: "");
migrationBuilder.AlterColumn<string>(
name: "UnitOfMeasurement",
table: "ActivityMasters",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "ActivityName",
keyValue: null,
column: "ActivityName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ActivityName",
table: "ActivityMasters",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<Guid>(
name: "ActivityGroupId",
table: "ActivityMasters",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<bool>(
name: "IsSystem",
table: "ActivityMasters",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "GlobalServiceMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_GlobalServiceMasters", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Organizations",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Email = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ContactPerson = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Address = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ContactNumber = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
SPRID = table.Column<double>(type: "double", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Organizations", x => x.Id);
table.ForeignKey(
name: "FK_Organizations_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Organizations_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "OrgTypeMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_OrgTypeMasters", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ServiceMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsSystem = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceMasters", x => x.Id);
table.ForeignKey(
name: "FK_ServiceMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "GlobalActivityGroupMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ServiceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_GlobalActivityGroupMasters", x => x.Id);
table.ForeignKey(
name: "FK_GlobalActivityGroupMasters_GlobalServiceMasters_ServiceId",
column: x => x.ServiceId,
principalTable: "GlobalServiceMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "OrgServiceMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
OrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ServiceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_OrgServiceMappings", x => x.Id);
table.ForeignKey(
name: "FK_OrgServiceMappings_GlobalServiceMasters_ServiceId",
column: x => x.ServiceId,
principalTable: "GlobalServiceMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_OrgServiceMappings_Organizations_OrganizationId",
column: x => x.OrganizationId,
principalTable: "Organizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "TenantOrgMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
OrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
SPRID = table.Column<double>(type: "double", nullable: false),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
AssignedDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ReassignedDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_TenantOrgMappings", x => x.Id);
table.ForeignKey(
name: "FK_TenantOrgMappings_Organizations_OrganizationId",
column: x => x.OrganizationId,
principalTable: "Organizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_TenantOrgMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ActivityGroupMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ServiceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsSystem = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ActivityGroupMasters", x => x.Id);
table.ForeignKey(
name: "FK_ActivityGroupMasters_ServiceMasters_ServiceId",
column: x => x.ServiceId,
principalTable: "ServiceMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ActivityGroupMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ProjectServiceMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ServiceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ProjectId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PlannedStartDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
PlannedEndDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ActualStartDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ActualEndDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ProjectServiceMappings", x => x.Id);
table.ForeignKey(
name: "FK_ProjectServiceMappings_Projects_ProjectId",
column: x => x.ProjectId,
principalTable: "Projects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectServiceMappings_ServiceMasters_ServiceId",
column: x => x.ServiceId,
principalTable: "ServiceMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectServiceMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "GlobalActivityMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ActivityName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UnitOfMeasurement = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ActivityGroupId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GlobalActivityMasters", x => x.Id);
table.ForeignKey(
name: "FK_GlobalActivityMasters_GlobalActivityGroupMasters_ActivityGro~",
column: x => x.ActivityGroupId,
principalTable: "GlobalActivityGroupMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ProjectOrgMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
OrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ParentOrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ProjectServiceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
OrganizationTypeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AssignedDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CompletionDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ProjectOrgMappings", x => x.Id);
table.ForeignKey(
name: "FK_ProjectOrgMappings_OrgTypeMasters_OrganizationTypeId",
column: x => x.OrganizationTypeId,
principalTable: "OrgTypeMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectOrgMappings_Organizations_OrganizationId",
column: x => x.OrganizationId,
principalTable: "Organizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectOrgMappings_Organizations_ParentOrganizationId",
column: x => x.ParentOrganizationId,
principalTable: "Organizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectOrgMappings_ProjectServiceMappings_ProjectServiceId",
column: x => x.ProjectServiceId,
principalTable: "ProjectServiceMappings",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectOrgMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 9, 15, 12, 42, 3, 202, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 15, 12, 42, 3, 202, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc));
migrationBuilder.InsertData(
table: "OrgTypeMasters",
columns: new[] { "Id", "Name" },
values: new object[,]
{
{ new Guid("5ee49bcd-b6d3-482f-9aaf-484afe04abec"), "Service Provider" },
{ new Guid("743806fe-d991-4079-b223-e4e2da44f435"), "Tenant" },
{ new Guid("a283356a-9b02-4029-afb7-e65c703efdd4"), "Sub-Contractor" },
{ new Guid("b1877a3b-8832-47b1-bbe3-dc7e98672f49"), "PMC" }
});
migrationBuilder.InsertData(
table: "Organizations",
columns: new[] { "Id", "Address", "ContactNumber", "ContactPerson", "CreatedAt", "CreatedById", "Email", "IsActive", "Name", "SPRID", "UpdatedAt", "UpdatedById" },
values: new object[] { new Guid("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"), "2nd Floor, Fullora Building, Tejas CHS, behind Kothrud Stand, Tejas Society, Dahanukar Colony, Kothrud, Pune, Maharashtra 411038", "123456789", "Admin", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, "admin@marcoaiot.com", true, "MarcoBMS", 5400.0, null, null });
migrationBuilder.CreateIndex(
name: "IX_ActivityMasters_ActivityGroupId",
table: "ActivityMasters",
column: "ActivityGroupId");
migrationBuilder.CreateIndex(
name: "IX_ActivityGroupMasters_ServiceId",
table: "ActivityGroupMasters",
column: "ServiceId");
migrationBuilder.CreateIndex(
name: "IX_ActivityGroupMasters_TenantId",
table: "ActivityGroupMasters",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_GlobalActivityGroupMasters_ServiceId",
table: "GlobalActivityGroupMasters",
column: "ServiceId");
migrationBuilder.CreateIndex(
name: "IX_GlobalActivityMasters_ActivityGroupId",
table: "GlobalActivityMasters",
column: "ActivityGroupId");
migrationBuilder.CreateIndex(
name: "IX_Organizations_CreatedById",
table: "Organizations",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Organizations_UpdatedById",
table: "Organizations",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_OrgServiceMappings_OrganizationId",
table: "OrgServiceMappings",
column: "OrganizationId");
migrationBuilder.CreateIndex(
name: "IX_OrgServiceMappings_ServiceId",
table: "OrgServiceMappings",
column: "ServiceId");
migrationBuilder.CreateIndex(
name: "IX_ProjectOrgMappings_OrganizationId",
table: "ProjectOrgMappings",
column: "OrganizationId");
migrationBuilder.CreateIndex(
name: "IX_ProjectOrgMappings_OrganizationTypeId",
table: "ProjectOrgMappings",
column: "OrganizationTypeId");
migrationBuilder.CreateIndex(
name: "IX_ProjectOrgMappings_ParentOrganizationId",
table: "ProjectOrgMappings",
column: "ParentOrganizationId");
migrationBuilder.CreateIndex(
name: "IX_ProjectOrgMappings_ProjectServiceId",
table: "ProjectOrgMappings",
column: "ProjectServiceId");
migrationBuilder.CreateIndex(
name: "IX_ProjectOrgMappings_TenantId",
table: "ProjectOrgMappings",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ProjectServiceMappings_ProjectId",
table: "ProjectServiceMappings",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_ProjectServiceMappings_ServiceId",
table: "ProjectServiceMappings",
column: "ServiceId");
migrationBuilder.CreateIndex(
name: "IX_ProjectServiceMappings_TenantId",
table: "ProjectServiceMappings",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ServiceMasters_TenantId",
table: "ServiceMasters",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_TenantOrgMappings_OrganizationId",
table: "TenantOrgMappings",
column: "OrganizationId");
migrationBuilder.CreateIndex(
name: "IX_TenantOrgMappings_TenantId",
table: "TenantOrgMappings",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_ActivityMasters_ActivityGroupMasters_ActivityGroupId",
table: "ActivityMasters",
column: "ActivityGroupId",
principalTable: "ActivityGroupMasters",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ActivityMasters_ActivityGroupMasters_ActivityGroupId",
table: "ActivityMasters");
migrationBuilder.DropTable(
name: "ActivityGroupMasters");
migrationBuilder.DropTable(
name: "GlobalActivityMasters");
migrationBuilder.DropTable(
name: "OrgServiceMappings");
migrationBuilder.DropTable(
name: "ProjectOrgMappings");
migrationBuilder.DropTable(
name: "TenantOrgMappings");
migrationBuilder.DropTable(
name: "GlobalActivityGroupMasters");
migrationBuilder.DropTable(
name: "OrgTypeMasters");
migrationBuilder.DropTable(
name: "ProjectServiceMappings");
migrationBuilder.DropTable(
name: "Organizations");
migrationBuilder.DropTable(
name: "GlobalServiceMasters");
migrationBuilder.DropTable(
name: "ServiceMasters");
migrationBuilder.DropIndex(
name: "IX_ActivityMasters_ActivityGroupId",
table: "ActivityMasters");
migrationBuilder.DropColumn(
name: "ActivityGroupId",
table: "ActivityMasters");
migrationBuilder.DropColumn(
name: "IsSystem",
table: "ActivityMasters");
migrationBuilder.AlterColumn<string>(
name: "UnitOfMeasurement",
table: "ActivityMasters",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ActivityName",
table: "ActivityMasters",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6233));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6226));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6307));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6290));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6298));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6286));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6275));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6319));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6282));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6314));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6311));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6302));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6295));
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,77 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_IsActive_In_ServiceMaster : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "ServiceMasters",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "ActivityGroupMasters",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.InsertData(
table: "Features",
columns: new[] { "Id", "Description", "IsActive", "ModuleId", "Name" },
values: new object[] { new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"), "Managing all organization related rights", true, new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), "Organization Management" });
migrationBuilder.InsertData(
table: "FeaturePermissions",
columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" },
values: new object[,]
{
{ new Guid("068cb3c1-49c5-4746-9f29-1fce16e820ac"), "Allow user to create new organization", new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"), true, "Add Organization" },
{ new Guid("7a6cf830-0008-4e03-b31d-0d050cb634f4"), "Allow the user to view information of the organization", new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"), true, "View Organization" },
{ new Guid("c1ae1363-ab8a-4bd9-a9d1-8c2c6083873a"), "Allow the user to update the basic information of the organization", new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"), true, "Edit Organization" }
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("068cb3c1-49c5-4746-9f29-1fce16e820ac"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("7a6cf830-0008-4e03-b31d-0d050cb634f4"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("c1ae1363-ab8a-4bd9-a9d1-8c2c6083873a"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"));
migrationBuilder.DropColumn(
name: "IsActive",
table: "ServiceMasters");
migrationBuilder.DropColumn(
name: "IsActive",
table: "ActivityGroupMasters");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,136 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Updated_EMployee_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Employees_JobRoles_JobRoleId",
table: "Employees");
migrationBuilder.DropColumn(
name: "AadharNumber",
table: "Employees");
migrationBuilder.DropColumn(
name: "PanNumber",
table: "Employees");
migrationBuilder.DropColumn(
name: "RoleId",
table: "Employees");
migrationBuilder.AlterColumn<Guid>(
name: "JobRoleId",
table: "Employees",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "FirstName",
keyValue: null,
column: "FirstName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "FirstName",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<bool>(
name: "HasApplicationAccess",
table: "Employees",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddForeignKey(
name: "FK_Employees_JobRoles_JobRoleId",
table: "Employees",
column: "JobRoleId",
principalTable: "JobRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Employees_JobRoles_JobRoleId",
table: "Employees");
migrationBuilder.DropColumn(
name: "HasApplicationAccess",
table: "Employees");
migrationBuilder.AlterColumn<Guid>(
name: "JobRoleId",
table: "Employees",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<string>(
name: "FirstName",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "AadharNumber",
table: "Employees",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PanNumber",
table: "Employees",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<Guid>(
name: "RoleId",
table: "Employees",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_Employees_JobRoles_JobRoleId",
table: "Employees",
column: "JobRoleId",
principalTable: "JobRoles",
principalColumn: "Id");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,70 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Organization_In_Employee_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Organizations_Employees_CreatedById",
table: "Organizations");
migrationBuilder.DropForeignKey(
name: "FK_Organizations_Employees_UpdatedById",
table: "Organizations");
migrationBuilder.DropIndex(
name: "IX_Organizations_CreatedById",
table: "Organizations");
migrationBuilder.DropIndex(
name: "IX_Organizations_UpdatedById",
table: "Organizations");
migrationBuilder.AddColumn<Guid>(
name: "OrganizationId",
table: "Employees",
type: "char(36)",
nullable: false,
defaultValue: new Guid("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"),
collation: "ascii_general_ci");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "OrganizationId",
table: "Employees");
migrationBuilder.CreateIndex(
name: "IX_Organizations_CreatedById",
table: "Organizations",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Organizations_UpdatedById",
table: "Organizations",
column: "UpdatedById");
migrationBuilder.AddForeignKey(
name: "FK_Organizations_Employees_CreatedById",
table: "Organizations",
column: "CreatedById",
principalTable: "Employees",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Organizations_Employees_UpdatedById",
table: "Organizations",
column: "UpdatedById",
principalTable: "Employees",
principalColumn: "Id");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,39 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Organization_In_Employee_Table_As_Forgin_Key : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_Employees_OrganizationId",
table: "Employees",
column: "OrganizationId");
migrationBuilder.AddForeignKey(
name: "FK_Employees_Organizations_OrganizationId",
table: "Employees",
column: "OrganizationId",
principalTable: "Organizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Employees_Organizations_OrganizationId",
table: "Employees");
migrationBuilder.DropIndex(
name: "IX_Employees_OrganizationId",
table: "Employees");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_IsPrimary_Parameter_In_Employee_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsPrimary",
table: "Employees",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsPrimary",
table: "Employees");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,69 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Organization_In_Tenant_Table_As_Forgin_Key : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "TenantId",
table: "AspNetUsers");
migrationBuilder.AddColumn<Guid>(
name: "OrganizationId",
table: "Tenants",
type: "char(36)",
nullable: false,
defaultValue: new Guid("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"),
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "Id",
keyValue: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"),
column: "OrganizationId",
value: new Guid("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"));
migrationBuilder.CreateIndex(
name: "IX_Tenants_OrganizationId",
table: "Tenants",
column: "OrganizationId");
migrationBuilder.AddForeignKey(
name: "FK_Tenants_Organizations_OrganizationId",
table: "Tenants",
column: "OrganizationId",
principalTable: "Organizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Tenants_Organizations_OrganizationId",
table: "Tenants");
migrationBuilder.DropIndex(
name: "IX_Tenants_OrganizationId",
table: "Tenants");
migrationBuilder.DropColumn(
name: "OrganizationId",
table: "Tenants");
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "AspNetUsers",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,136 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Promoter_And_PMC_In_Project_Table_As_Forgin_Key : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Employees_Tenants_TenantId",
table: "Employees");
migrationBuilder.AddColumn<Guid>(
name: "PMCId",
table: "Projects",
type: "char(36)",
nullable: false,
defaultValue: new Guid("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"),
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PromoterId",
table: "Projects",
type: "char(36)",
nullable: false,
defaultValue: new Guid("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"),
collation: "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "TenantId",
table: "Employees",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.UpdateData(
table: "Projects",
keyColumn: "Id",
keyValue: new Guid("85bf587b-7ca9-4685-b77c-d817f5847e85"),
columns: new[] { "PMCId", "PromoterId" },
values: new object[] { new Guid("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"), new Guid("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea") });
migrationBuilder.CreateIndex(
name: "IX_Projects_PMCId",
table: "Projects",
column: "PMCId");
migrationBuilder.CreateIndex(
name: "IX_Projects_PromoterId",
table: "Projects",
column: "PromoterId");
migrationBuilder.AddForeignKey(
name: "FK_Employees_Tenants_TenantId",
table: "Employees",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Projects_Organizations_PMCId",
table: "Projects",
column: "PMCId",
principalTable: "Organizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Projects_Organizations_PromoterId",
table: "Projects",
column: "PromoterId",
principalTable: "Organizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Employees_Tenants_TenantId",
table: "Employees");
migrationBuilder.DropForeignKey(
name: "FK_Projects_Organizations_PMCId",
table: "Projects");
migrationBuilder.DropForeignKey(
name: "FK_Projects_Organizations_PromoterId",
table: "Projects");
migrationBuilder.DropIndex(
name: "IX_Projects_PMCId",
table: "Projects");
migrationBuilder.DropIndex(
name: "IX_Projects_PromoterId",
table: "Projects");
migrationBuilder.DropColumn(
name: "PMCId",
table: "Projects");
migrationBuilder.DropColumn(
name: "PromoterId",
table: "Projects");
migrationBuilder.AlterColumn<Guid>(
name: "TenantId",
table: "Employees",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_Employees_Tenants_TenantId",
table: "Employees",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_IsActive_In_ProjectServiceMapping_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "ProjectServiceMappings",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsActive",
table: "ProjectServiceMappings");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,85 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Removed_TenantId_From_MPIN_And_OTP : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_MPINDetails_Tenants_TenantId",
table: "MPINDetails");
migrationBuilder.DropForeignKey(
name: "FK_OTPDetails_Tenants_TenantId",
table: "OTPDetails");
migrationBuilder.DropIndex(
name: "IX_OTPDetails_TenantId",
table: "OTPDetails");
migrationBuilder.DropIndex(
name: "IX_MPINDetails_TenantId",
table: "MPINDetails");
migrationBuilder.DropColumn(
name: "TenantId",
table: "OTPDetails");
migrationBuilder.DropColumn(
name: "TenantId",
table: "MPINDetails");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "OTPDetails",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "MPINDetails",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_OTPDetails_TenantId",
table: "OTPDetails",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_MPINDetails_TenantId",
table: "MPINDetails",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_MPINDetails_Tenants_TenantId",
table: "MPINDetails",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_OTPDetails_Tenants_TenantId",
table: "OTPDetails",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,68 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Service_FK_In_ProjectAllocation : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "ServiceId",
table: "ProjectAllocations",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<string>(
name: "logoImage",
table: "Organizations",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Organizations",
keyColumn: "Id",
keyValue: new Guid("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"),
column: "logoImage",
value: null);
migrationBuilder.CreateIndex(
name: "IX_ProjectAllocations_ServiceId",
table: "ProjectAllocations",
column: "ServiceId");
migrationBuilder.AddForeignKey(
name: "FK_ProjectAllocations_ServiceMasters_ServiceId",
table: "ProjectAllocations",
column: "ServiceId",
principalTable: "ServiceMasters",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ProjectAllocations_ServiceMasters_ServiceId",
table: "ProjectAllocations");
migrationBuilder.DropIndex(
name: "IX_ProjectAllocations_ServiceId",
table: "ProjectAllocations");
migrationBuilder.DropColumn(
name: "ServiceId",
table: "ProjectAllocations");
migrationBuilder.DropColumn(
name: "logoImage",
table: "Organizations");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,84 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Assigned_By_In_Mapping_Tables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "AssignedById",
table: "TenantOrgMappings",
type: "char(36)",
nullable: false,
defaultValue: new Guid("08dd8b35-d98b-44f1-896d-12aec3f035aa"),
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "AssignedById",
table: "ProjectOrgMappings",
type: "char(36)",
nullable: false,
defaultValue: new Guid("08dd8b35-d98b-44f1-896d-12aec3f035aa"),
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_TenantOrgMappings_AssignedById",
table: "TenantOrgMappings",
column: "AssignedById");
migrationBuilder.CreateIndex(
name: "IX_ProjectOrgMappings_AssignedById",
table: "ProjectOrgMappings",
column: "AssignedById");
migrationBuilder.AddForeignKey(
name: "FK_ProjectOrgMappings_Employees_AssignedById",
table: "ProjectOrgMappings",
column: "AssignedById",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_TenantOrgMappings_Employees_AssignedById",
table: "TenantOrgMappings",
column: "AssignedById",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ProjectOrgMappings_Employees_AssignedById",
table: "ProjectOrgMappings");
migrationBuilder.DropForeignKey(
name: "FK_TenantOrgMappings_Employees_AssignedById",
table: "TenantOrgMappings");
migrationBuilder.DropIndex(
name: "IX_TenantOrgMappings_AssignedById",
table: "TenantOrgMappings");
migrationBuilder.DropIndex(
name: "IX_ProjectOrgMappings_AssignedById",
table: "ProjectOrgMappings");
migrationBuilder.DropColumn(
name: "AssignedById",
table: "TenantOrgMappings");
migrationBuilder.DropColumn(
name: "AssignedById",
table: "ProjectOrgMappings");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,40 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Deleted_Organization_Types : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "OrgTypeMasters",
keyColumn: "Id",
keyValue: new Guid("743806fe-d991-4079-b223-e4e2da44f435"));
migrationBuilder.DeleteData(
table: "OrgTypeMasters",
keyColumn: "Id",
keyValue: new Guid("b1877a3b-8832-47b1-bbe3-dc7e98672f49"));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "OrgTypeMasters",
columns: new[] { "Id", "Name" },
values: new object[,]
{
{ new Guid("743806fe-d991-4079-b223-e4e2da44f435"), "Tenant" },
{ new Guid("b1877a3b-8832-47b1-bbe3-dc7e98672f49"), "PMC" }
});
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,92 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Forgin_Key_For_Approver : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Attendes_Employees_EmployeeID",
table: "Attendes");
migrationBuilder.RenameColumn(
name: "EmployeeID",
table: "Attendes",
newName: "EmployeeId");
migrationBuilder.RenameColumn(
name: "ApprovedBy",
table: "Attendes",
newName: "ApprovedById");
migrationBuilder.RenameIndex(
name: "IX_Attendes_EmployeeID",
table: "Attendes",
newName: "IX_Attendes_EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_Attendes_ApprovedById",
table: "Attendes",
column: "ApprovedById");
migrationBuilder.AddForeignKey(
name: "FK_Attendes_Employees_ApprovedById",
table: "Attendes",
column: "ApprovedById",
principalTable: "Employees",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Attendes_Employees_EmployeeId",
table: "Attendes",
column: "EmployeeId",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Attendes_Employees_ApprovedById",
table: "Attendes");
migrationBuilder.DropForeignKey(
name: "FK_Attendes_Employees_EmployeeId",
table: "Attendes");
migrationBuilder.DropIndex(
name: "IX_Attendes_ApprovedById",
table: "Attendes");
migrationBuilder.RenameColumn(
name: "EmployeeId",
table: "Attendes",
newName: "EmployeeID");
migrationBuilder.RenameColumn(
name: "ApprovedById",
table: "Attendes",
newName: "ApprovedBy");
migrationBuilder.RenameIndex(
name: "IX_Attendes_EmployeeId",
table: "Attendes",
newName: "IX_Attendes_EmployeeID");
migrationBuilder.AddForeignKey(
name: "FK_Attendes_Employees_EmployeeID",
table: "Attendes",
column: "EmployeeID",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_ExpenceUID_In_Expense_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ExpenseUId",
table: "Expenses",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ExpenseUId",
table: "Expenses");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,70 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Requested_In_Attendance_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "ApprovedAt",
table: "Attendes",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "RequestedAt",
table: "Attendes",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "RequestedById",
table: "Attendes",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_Attendes_RequestedById",
table: "Attendes",
column: "RequestedById");
migrationBuilder.AddForeignKey(
name: "FK_Attendes_Employees_RequestedById",
table: "Attendes",
column: "RequestedById",
principalTable: "Employees",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Attendes_Employees_RequestedById",
table: "Attendes");
migrationBuilder.DropIndex(
name: "IX_Attendes_RequestedById",
table: "Attendes");
migrationBuilder.DropColumn(
name: "ApprovedAt",
table: "Attendes");
migrationBuilder.DropColumn(
name: "RequestedAt",
table: "Attendes");
migrationBuilder.DropColumn(
name: "RequestedById",
table: "Attendes");
}
}
}

View File

@ -20,18 +20,21 @@ namespace Marco.Pms.Helpers.CacheHelper
var mongoDB = client.GetDatabase(mongoUrl.DatabaseName); // Your MongoDB Database name
_collection = mongoDB.GetCollection<EmployeePermissionMongoDB>("EmployeeProfile");
}
public async Task<bool> AddApplicationRoleToCache(Guid employeeId, List<string> newRoleIds, List<string> newPermissionIds)
public async Task<bool> AddApplicationRoleToCache(Guid employeeId, List<string> newRoleIds, List<string> newPermissionIds, Guid tenantId)
{
// 2. Perform database queries concurrently for better performance.
var employeeIdString = employeeId.ToString();
var tenantIdString = tenantId.ToString();
// 5. Build a single, efficient update operation.
var filter = Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.Id, employeeIdString);
filter &= Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.TenantId, tenantIdString);
var update = Builders<EmployeePermissionMongoDB>.Update
.AddToSetEach(e => e.ApplicationRoleIds, newRoleIds)
.Set(r => r.ExpireAt, DateTime.UtcNow.Date.AddDays(1))
.Set(r => r.TenantId, tenantIdString)
.AddToSetEach(e => e.PermissionIds, newPermissionIds);
var options = new UpdateOptions { IsUpsert = true };
@ -44,14 +47,17 @@ namespace Marco.Pms.Helpers.CacheHelper
// The operation is successful if an existing document was modified OR a new one was created.
return result.IsAcknowledged && (result.ModifiedCount > 0 || result.UpsertedId != null);
}
public async Task<bool> AddProjectsToCache(Guid employeeId, List<Guid> projectIds)
public async Task<bool> AddProjectsToCache(Guid employeeId, List<Guid> projectIds, Guid tenantId)
{
var newprojectIds = projectIds.Select(p => p.ToString()).ToList();
var tenantIdString = tenantId.ToString();
var filter = Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.Id, employeeId.ToString());
filter &= Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.TenantId, tenantIdString);
var update = Builders<EmployeePermissionMongoDB>.Update
.Set(r => r.ExpireAt, DateTime.UtcNow.Date.AddDays(1))
.Set(r => r.TenantId, tenantIdString)
.AddToSetEach(e => e.ProjectIds, newprojectIds);
var result = await _collection.UpdateOneAsync(filter, update, new UpdateOptions { IsUpsert = true });
@ -62,10 +68,12 @@ namespace Marco.Pms.Helpers.CacheHelper
await InitializeCollectionAsync();
return true;
}
public async Task<List<Guid>> GetProjectsFromCache(Guid employeeId)
public async Task<List<Guid>> GetProjectsFromCache(Guid employeeId, Guid tenantId)
{
var filter = Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.Id, employeeId.ToString());
var tenantIdString = tenantId.ToString();
var filter = Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.Id, employeeId.ToString());
filter &= Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.TenantId, tenantIdString);
var result = await _collection
.Find(filter)
@ -79,10 +87,12 @@ namespace Marco.Pms.Helpers.CacheHelper
return projectIds;
}
public async Task<List<Guid>> GetPermissionsFromCache(Guid employeeId)
public async Task<List<Guid>> GetPermissionsFromCache(Guid employeeId, Guid tenantId)
{
var filter = Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.Id, employeeId.ToString());
var tenantIdString = tenantId.ToString();
var filter = Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.Id, employeeId.ToString());
filter &= Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.TenantId, tenantIdString);
var result = await _collection
.Find(filter)
@ -96,10 +106,13 @@ namespace Marco.Pms.Helpers.CacheHelper
return permissionIds;
}
public async Task<bool> ClearAllProjectIdsFromCache(Guid employeeId)
public async Task<bool> ClearAllProjectIdsFromCache(Guid employeeId, Guid tenantId)
{
var tenantIdString = tenantId.ToString();
var filter = Builders<EmployeePermissionMongoDB>.Filter
.Eq(e => e.Id, employeeId.ToString());
filter &= Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.TenantId, tenantIdString);
var update = Builders<EmployeePermissionMongoDB>.Update
.Set(e => e.ProjectIds, new List<string>());
@ -125,18 +138,25 @@ namespace Marco.Pms.Helpers.CacheHelper
return true;
}
public async Task<bool> ClearAllProjectIdsByPermissionIdFromCache(Guid permissionId)
public async Task<bool> ClearAllProjectIdsByPermissionIdFromCache(Guid permissionId, Guid tenantId)
{
var tenantIdString = tenantId.ToString();
var filter = Builders<EmployeePermissionMongoDB>.Filter.AnyEq(e => e.PermissionIds, permissionId.ToString());
filter &= Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.TenantId, tenantIdString);
var update = Builders<EmployeePermissionMongoDB>.Update.Set(e => e.ProjectIds, new List<string>());
var result = await _collection.UpdateManyAsync(filter, update).ConfigureAwait(false);
return result.IsAcknowledged && result.ModifiedCount > 0;
}
public async Task<bool> RemoveRoleIdFromCache(Guid employeeId, Guid roleId)
public async Task<bool> RemoveRoleIdFromCache(Guid employeeId, Guid roleId, Guid tenantId)
{
var tenantIdString = tenantId.ToString();
var filter = Builders<EmployeePermissionMongoDB>.Filter
.Eq(e => e.Id, employeeId.ToString());
filter &= Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.TenantId, tenantIdString);
var update = Builders<EmployeePermissionMongoDB>.Update
.Pull(e => e.ApplicationRoleIds, roleId.ToString());
@ -151,10 +171,13 @@ namespace Marco.Pms.Helpers.CacheHelper
return true;
}
public async Task<bool> ClearAllPermissionIdsByEmployeeIDFromCache(Guid employeeId)
public async Task<bool> ClearAllPermissionIdsByEmployeeIDFromCache(Guid employeeId, Guid tenantId)
{
var tenantIdString = tenantId.ToString();
var filter = Builders<EmployeePermissionMongoDB>.Filter
.Eq(e => e.Id, employeeId.ToString());
filter &= Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.TenantId, tenantIdString);
var update = Builders<EmployeePermissionMongoDB>.Update
.Set(e => e.PermissionIds, new List<string>());
@ -189,11 +212,56 @@ namespace Marco.Pms.Helpers.CacheHelper
return true;
}
public async Task<bool> ClearAllEmployeesFromCacheByEmployeeIds(List<string> employeeIds)
public async Task<bool> ClearAllEmployeesFromCacheByOnlyEmployeeId(Guid employeeId)
{
var employeeIdString = employeeId.ToString();
try
{
var filter = Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.Id, employeeIdString);
var result = await _collection.DeleteManyAsync(filter);
if (result.DeletedCount == 0)
return false;
return true;
}
catch (Exception ex)
{
_logger.LogError(ex, "Error occured while deleting employee profile");
return false;
}
}
public async Task<bool> ClearAllEmployeesFromCacheByTenantId(Guid tenantId)
{
var tenantIdString = tenantId.ToString();
try
{
var filter = Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.TenantId, tenantIdString);
var result = await _collection.DeleteManyAsync(filter);
if (result.DeletedCount == 0)
return false;
return true;
}
catch (Exception ex)
{
_logger.LogError(ex, "Error occured while deleting employee profile");
return false;
}
}
public async Task<bool> ClearAllEmployeesFromCacheByEmployeeIds(List<string> employeeIds, Guid tenantId)
{
var tenantIdString = tenantId.ToString();
try
{
var filter = Builders<EmployeePermissionMongoDB>.Filter.In(x => x.Id, employeeIds);
filter &= Builders<EmployeePermissionMongoDB>.Filter.Eq(e => e.TenantId, tenantIdString);
var result = await _collection.DeleteManyAsync(filter);

View File

@ -1,7 +1,9 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.MongoDBModels;
using Marco.Pms.Model.MongoDBModels.Masters;
using Marco.Pms.Model.MongoDBModels.Project;
using Marco.Pms.Model.OrganizationModel;
using Marco.Pms.Model.Projects;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
@ -55,7 +57,7 @@ namespace Marco.Pms.Helpers
var indexModel = new CreateIndexModel<ProjectMongoDB>(indexKeys, indexOptions);
await _projectCollection.Indexes.CreateOneAsync(indexModel);
}
public async Task<bool> UpdateProjectDetailsOnlyToCache(Project project, StatusMaster projectStatus)
public async Task<bool> UpdateProjectDetailsOnlyToCache(Project project, StatusMaster projectStatus, Organization promotor, Organization pmc)
{
// Build the update definition
var updates = Builders<ProjectMongoDB>.Update.Combine(
@ -67,6 +69,26 @@ namespace Marco.Pms.Helpers
Id = projectStatus.Id.ToString(),
Status = projectStatus.Status
}),
Builders<ProjectMongoDB>.Update.Set(r => r.Promoter, new OrganizationMongoDB
{
Id = promotor.Id.ToString(),
Name = promotor.Name,
ContactPerson = promotor.ContactPerson,
Email = promotor.Email,
Address = promotor.Address,
ContactNumber = promotor.ContactNumber,
SPRID = promotor.SPRID
}),
Builders<ProjectMongoDB>.Update.Set(r => r.PMC, new OrganizationMongoDB
{
Id = pmc.Id.ToString(),
Name = pmc.Name,
ContactPerson = pmc.ContactPerson,
Email = pmc.Email,
Address = promotor.Address,
ContactNumber = promotor.ContactNumber,
SPRID = promotor.SPRID
}),
Builders<ProjectMongoDB>.Update.Set(r => r.StartDate, project.StartDate),
Builders<ProjectMongoDB>.Update.Set(r => r.EndDate, project.EndDate),
Builders<ProjectMongoDB>.Update.Set(r => r.ContactPerson, project.ContactPerson)
@ -407,10 +429,19 @@ namespace Marco.Pms.Helpers
#region=================================================================== WorkItem Cache Helper ===================================================================
public async Task<List<WorkItemMongoDB>> GetWorkItemsByWorkAreaIdsFromCache(List<Guid> workAreaIds)
public async Task<List<WorkItemMongoDB>> GetWorkItemsByWorkAreaIdsFromCache(List<Guid> workAreaIds, List<Guid> serviceIds)
{
var stringWorkAreaIds = workAreaIds.Select(wa => wa.ToString()).ToList();
var filter = Builders<WorkItemMongoDB>.Filter.In(w => w.WorkAreaId, stringWorkAreaIds);
var filterBuilder = Builders<WorkItemMongoDB>.Filter;
var filter = filterBuilder.Empty;
filter &= filterBuilder.In(w => w.WorkAreaId, stringWorkAreaIds);
if (serviceIds.Any())
{
var stringServiceIds = serviceIds.Select(s => s.ToString()).ToList();
filter &= filterBuilder.In(w => w.ActivityMaster!.ActivityGroupMaster!.Service!.Id, stringServiceIds);
}
var workItems = await _taskCollection // replace with your actual collection name
.Find(filter)
@ -449,9 +480,17 @@ namespace Marco.Pms.Helpers
}
}
}
public async Task<List<WorkItemMongoDB>> GetWorkItemDetailsByWorkAreaFromCache(Guid workAreaId)
public async Task<List<WorkItemMongoDB>> GetWorkItemDetailsByWorkAreaFromCache(Guid workAreaId, List<Guid> serviceIds)
{
var filter = Builders<WorkItemMongoDB>.Filter.Eq(p => p.WorkAreaId, workAreaId.ToString());
var filterBuilder = Builders<WorkItemMongoDB>.Filter;
var filter = filterBuilder.Empty;
filter &= filterBuilder.Eq(p => p.WorkAreaId, workAreaId.ToString());
if (serviceIds.Any())
{
var stringServiceIds = serviceIds.Select(s => s.ToString()).ToList();
filter &= filterBuilder.In(w => w.ActivityMaster!.ActivityGroupMaster!.Service!.Id, stringServiceIds);
}
var options = new UpdateOptions { IsUpsert = true };
var workItems = await _taskCollection

View File

@ -1,4 +1,5 @@
using Marco.Pms.Model.MongoDBModels.Utility;
using Marco.Pms.Model.MongoDBModels;
using Marco.Pms.Model.MongoDBModels.Utility;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using MongoDB.Bson;
@ -24,10 +25,32 @@ namespace Marco.Pms.Helpers.Utility
#region =================================================================== Update Log Helper Functions ===================================================================
public async Task PushToUpdateLogsAsync(UpdateLogsObject oldObject, string collectionName)
{
try
{
var collection = _mongoDatabase.GetCollection<UpdateLogsObject>(collectionName);
await collection.InsertOneAsync(oldObject);
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception occured while saving object of update logs in collection: {Collection}", collectionName);
}
}
public async Task PushListToUpdateLogsAsync(List<UpdateLogsObject> oldObjects, string collectionName)
{
try
{
var collection = _mongoDatabase.GetCollection<UpdateLogsObject>(collectionName);
if (oldObjects.Any())
{
await collection.InsertManyAsync(oldObjects);
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception occured while saving list of update logs in collection: {Collection}", collectionName);
}
}
public async Task<List<UpdateLogsObject>> GetFromUpdateLogsByEntityIdAsync(Guid entityId, string collectionName)
{
@ -124,5 +147,86 @@ namespace Marco.Pms.Helpers.Utility
}
#endregion
#region =================================================================== NotificatioBody Helper Functions ===================================================================
public async Task AddNotificationAsync(NotificationMongoDB notification)
{
try
{
var collection = _mongoDatabase.GetCollection<NotificationMongoDB>("NotificatioBody");
var indexKeys = Builders<NotificationMongoDB>.IndexKeys
.Ascending(doc => doc.TenantId)
.Ascending(doc => doc.Name);
// Define index options with unique constraint
var indexOptions = new CreateIndexOptions { Unique = true };
// Create the index model
var indexModel = new CreateIndexModel<NotificationMongoDB>(indexKeys, indexOptions);
// Create the index on the collection (this operation is idempotent)
collection.Indexes.CreateOne(indexModel);
await collection.InsertOneAsync(notification);
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception occured while adding the Notification body {NotificationName} for tenant {TenantId}", notification.Name, notification.TenantId);
}
}
public async Task<NotificationMongoDB> GetNotificationBodyAsync(string name, Guid tenantId)
{
var rootTenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26");
NotificationMongoDB? result = null;
NotificationMongoDB? defaultNotification = new NotificationMongoDB
{
Name = "default",
Title = "Error: Something Went Wrong",
Body = " An unexpected error occurred. Please try again. If the problem persists, contact support",
Parameters = "",
TenantId = rootTenantId
};
var collection = _mongoDatabase.GetCollection<NotificationMongoDB>("NotificatioBody");
try
{
var filter = Builders<NotificationMongoDB>.Filter.And(
Builders<NotificationMongoDB>.Filter.Eq(n => n.Name, name),
Builders<NotificationMongoDB>.Filter.Eq(n => n.TenantId, tenantId)
);
result = await collection
.Find(filter)
.FirstOrDefaultAsync();
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception occured while fetching the Notification body {NotificationName} for tenant {TenantId}", name, tenantId);
}
if (result == null)
{
try
{
var filter = Builders<NotificationMongoDB>.Filter.And(
Builders<NotificationMongoDB>.Filter.Eq(n => n.Name, name),
Builders<NotificationMongoDB>.Filter.Eq(n => n.TenantId, rootTenantId)
);
result = await collection.Find(filter).FirstOrDefaultAsync();
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception occured while fetching the Notification body {NotificationName} for tenant {TenantId}", name, rootTenantId);
return defaultNotification;
}
}
return result;
}
#endregion
}
}

View File

@ -1,8 +1,8 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Dtos.Attendance;
using Marco.Pms.Model.Dtos.Attendance;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.AttendanceModule
{
@ -10,9 +10,11 @@ namespace Marco.Pms.Model.AttendanceModule
{
public Guid Id { get; set; }
public string Comment { get; set; } = string.Empty;
public Guid EmployeeID { get; set; }
public Guid EmployeeId { get; set; }
[ForeignKey("EmployeeId")]
[ValidateNever]
public Employee? Employee { get; set; }
public DateTime Date { get; set; }
public Guid ProjectID { get; set; }
@ -22,9 +24,17 @@ namespace Marco.Pms.Model.AttendanceModule
public bool IsApproved { get; set; }
public ATTENDANCE_MARK_TYPE Activity { get; set; }
public Guid? ApprovedBy { get; set; }
[ForeignKey("EmployeeID")]
public Guid? ApprovedById { get; set; }
[ForeignKey("ApprovedById")]
[ValidateNever]
public Employee? Approver { get; set; }
public DateTime? RequestedAt { get; set; }
public DateTime? ApprovedAt { get; set; }
public Guid? RequestedById { get; set; }
[ForeignKey("RequestedById")]
[ValidateNever]
public Employee? RequestedBy { get; set; }
}
}

View File

@ -1,8 +1,6 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Authentication
namespace Marco.Pms.Model.Authentication
{
public class MPINDetails : TenantRelation
public class MPINDetails
{
public Guid Id { get; set; }
public Guid UserId { get; set; }

View File

@ -1,8 +1,6 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Authentication
namespace Marco.Pms.Model.Authentication
{
public class OTPDetails : TenantRelation
public class OTPDetails
{
public Guid Id { get; set; }
public Guid UserId { get; set; }

View File

@ -1,6 +1,6 @@
using System.ComponentModel;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Directory
{

View File

@ -1,6 +1,6 @@
using System.ComponentModel;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Directory
{

View File

@ -0,0 +1,22 @@
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.DocumentManager
{
public class AttachmentTagMapping : TenantRelation
{
public Guid Id { get; set; }
public Guid DocumentTagId { get; set; }
[ValidateNever]
[ForeignKey("DocumentTagId")]
public DocumentTagMaster? DocumentTag { get; set; }
public Guid AttachmentId { get; set; }
[ValidateNever]
[ForeignKey("AttachmentId")]
public DocumentAttachment? Attachment { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.DocumentManager
{
public class AttachmentVersionMapping : TenantRelation
{
public Guid Id { get; set; }
public Guid ParentAttachmentId { get; set; }
[ValidateNever]
[ForeignKey("ParentAttachmentId")]
public DocumentAttachment? ParentAttachment { get; set; }
public int Version { get; set; } = 1;
public Guid ChildAttachmentId { get; set; }
[ValidateNever]
[ForeignKey("ChildAttachmentId")]
public DocumentAttachment? ChildAttachment { get; set; }
}
}

View File

@ -0,0 +1,48 @@
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.DocumentManager
{
public class DocumentAttachment : TenantRelation
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? DocumentId { get; set; }
public string Description { get; set; } = string.Empty;
public bool IsCurrentVersion { get; set; } = true;
public DateTime UploadedAt { get; set; }
public Guid UploadedById { get; set; } // References the employee who uploaded the document
[ValidateNever]
[ForeignKey("UploadedById")]
public Employee? UploadedBy { get; set; }
public DateTime? UpdatedAt { get; set; }
public Guid? UpdatedById { get; set; } // References the employee who updates the document
[ValidateNever]
[ForeignKey("UpdatedById")]
public Employee? UpdatedBy { get; set; }
public DateTime? VerifiedAt { get; set; }
public bool? IsVerified { get; set; }
public Guid? VerifiedById { get; set; } // Associates the document with a specific employee, if applicable
[ValidateNever]
[ForeignKey("VerifiedById")]
public Employee? VerifiedBy { get; set; }
public Guid EntityId { get; set; } // Associates the document with a specific project, if applicable
public Guid DocumentTypeId { get; set; }
[ValidateNever]
[ForeignKey("DocumentTypeId")]
public DocumentTypeMaster? DocumentType { get; set; }
public Guid DocumentDataId { get; set; }
[ValidateNever]
[ForeignKey("DocumentDataId")]
public Document? Document { get; set; }
public bool IsActive { get; set; } = true;
}
}

View File

@ -0,0 +1,17 @@
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.DocumentManager
{
public class DocumentAttachmentMapping : TenantRelation
{
public Guid Id { get; set; }
public Guid AttachmentId { get; set; }
[ValidateNever]
[ForeignKey("AttachmentId")]
public DocumentAttachment? Attachment { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using Marco.Pms.Model.Master;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.DocumentManager
{
public class DocumentCategoryMaster : TenantRelation
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public Guid EntityTypeId { get; set; }
[ValidateNever]
[ForeignKey("EntityTypeId")]
public EntityTypeMaster? EntityTypeMaster { get; set; }
public DateTime CreatedAt { get; set; }
}
}

View File

@ -0,0 +1,11 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.DocumentManager
{
public class DocumentTagMaster : TenantRelation
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,26 @@
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.DocumentManager
{
public class DocumentTypeMaster : TenantRelation
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? RegexExpression { get; set; }
public string AllowedContentType { get; set; } = string.Empty;
public double MaxSizeAllowedInMB { get; set; } = 2;
public bool IsValidationRequired { get; set; } = true;
public bool IsMandatory { get; set; } = true;
public bool IsSystem { get; set; } = false;
public bool IsActive { get; set; } = true;
public Guid DocumentCategoryId { get; set; }
[ValidateNever]
[ForeignKey("DocumentCategoryId")]
public DocumentCategoryMaster? DocumentCategory { get; set; }
public DateTime CreatedAt { get; set; }
}
}

View File

@ -2,8 +2,9 @@
{
public class CreateActivityMasterDto
{
public string? ActivityName { get; set; }
public string? UnitOfMeasurement { get; set; }
public required Guid ActivityGroupId { get; set; }
public required string ActivityName { get; set; }
public required string UnitOfMeasurement { get; set; }
public List<CreateCheckListDto>? CheckList { get; set; }
}
}

View File

@ -3,7 +3,7 @@
public class CreateCheckListDto
{
public Guid? Id { get; set; }
public string? Description { get; set; }
public bool IsMandatory { get; set; }
public required string Description { get; set; }
public required bool IsMandatory { get; set; }
}
}

View File

@ -2,7 +2,7 @@
{
public class CreateWorkStatusMasterDto
{
public string? Name { get; set; }
public string? Description { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
}
}

View File

@ -3,7 +3,7 @@
public class UpdateWorkStatusMasterDto
{
public Guid Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
}
}

View File

@ -19,6 +19,7 @@ namespace Marco.Pms.Model.Dtos.Attendance
public ATTENDANCE_MARK_TYPE Action { get; set; }
public FileUploadModel? Image { get; set; }
public string DeviceToken { get; set; } = string.Empty;
}
public enum ATTENDANCE_MARK_TYPE

View File

@ -2,7 +2,7 @@
{
public class LoginDto
{
public string? Username { get; set; }
public string? Password { get; set; }
public required string Username { get; set; }
public required string Password { get; set; }
}
}

View File

@ -1,6 +1,8 @@
namespace Marco.Pms.Model.Dtos.Authentication
{
public class LogoutDto
{ public string? RefreshToken { get; set; }
{
public required string RefreshToken { get; set; }
public string? FcmToken { get; set; }
}
}

View File

@ -2,7 +2,7 @@
{
public class RefreshTokenDto
{
public string? Token { get; set; }
public string? RefreshToken { get; set; }
public required string Token { get; set; }
public required string RefreshToken { get; set; }
}
}

View File

@ -2,8 +2,8 @@
{
public class VerifyMPINDto
{
public Guid EmployeeId { get; set; }
public string? MPIN { get; set; }
public string? MPINToken { get; set; }
public required Guid EmployeeId { get; set; }
public required string MPIN { get; set; }
public required string MPINToken { get; set; }
}
}

View File

@ -4,6 +4,7 @@
{
public string? Label { get; set; }
public string? EmailAddress { get; set; }
public bool IsPrimary { get; set; } = false;
}
}

View File

@ -4,5 +4,6 @@
{
public string? Label { get; set; }
public string? PhoneNumber { get; set; }
public bool IsPrimary { get; set; } = false;
}
}

View File

@ -0,0 +1,10 @@
namespace Marco.Pms.Model.Dtos.DocumentManager
{
public class CreateDocumentCategoryDto
{
public Guid? Id { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
public required Guid EntityTypeId { get; set; }
}
}

View File

@ -0,0 +1,14 @@
namespace Marco.Pms.Model.Dtos.DocumentManager
{
public class CreateDocumentTypeDto
{
public Guid? Id { get; set; }
public required string Name { get; set; } = string.Empty;
public string? RegexExpression { get; set; }
public required string AllowedContentType { get; set; }
public required double MaxSizeAllowedInMB { get; set; } = 2;
public bool IsValidationRequired { get; set; }
public bool IsMandatory { get; set; }
public required Guid DocumentCategoryId { get; set; }
}
}

View File

@ -0,0 +1,26 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Dtos.DocumentManager
{
public class DocumentAttachmentDto
{
public required string Name { get; set; }
public string? DocumentId { get; set; }
public required string Description { get; set; }
public required Guid EntityId { get; set; }
public required Guid DocumentTypeId { get; set; } // References the type of the document
public required FileUploadModel Attachment { get; set; }
public List<DocumentTagDto>? Tags { get; set; }
}
public class UpdateDocumentAttachmentDto
{
public required Guid Id { get; set; }
public required string Name { get; set; }
public string? DocumentId { get; set; }
public required string Description { get; set; }
public FileUploadModel? Attachment { get; set; }
public List<DocumentTagDto>? Tags { get; set; }
}
}

View File

@ -0,0 +1,8 @@
namespace Marco.Pms.Model.Dtos.DocumentManager
{
public class DocumentTagDto
{
public required string Name { get; set; }
public required bool IsActive { get; set; }
}
}

View File

@ -3,42 +3,38 @@
public class CreateUserDto
{
public Guid? Id { get; set; }
public string? FirstName { get; set; }
public required string FirstName { get; set; }
public string? LastName { get; set; }
public string? MiddleName { get; set; }
public string? Email { get; set; }
public string? Gender { get; set; }
public string? BirthDate { get; set; }
public string? JoiningDate { get; set; }
public required string Gender { get; set; }
public required DateTime BirthDate { get; set; }
public required DateTime JoiningDate { get; set; }
public string? PermanentAddress { get; set; }
public string? CurrentAddress { get; set; }
public string? PhoneNumber { get; set; }
public required string PermanentAddress { get; set; }
public required string CurrentAddress { get; set; }
public required string PhoneNumber { get; set; }
public string? EmergencyPhoneNumber { get; set; }
public string? EmergencyContactPerson { get; set; }
public string? AadharNumber { get; set; }
public string? PanNumber { get; set; }
//public IFormFile? Photo { get; set; } // To store the captured photo
//public List<IFormFile>? Documents { get; set; }
public Guid? JobRoleId { get; set; }
// public int TenantId { get; set; }
public Guid JobRoleId { get; set; }
public required Guid OrganizationId { get; set; }
public required bool HasApplicationAccess { get; set; }
}
public class MobileUserManageDto
{
public Guid? Id { get; set; }
public string FirstName { get; set; } = string.Empty;
public string? LastName { get; set; }
public string PhoneNumber { get; set; } = string.Empty;
public string? Gender { get; set; }
public required string FirstName { get; set; }
public required string LastName { get; set; }
public required string PhoneNumber { get; set; }
public string? Email { get; set; }
public required DateTime JoiningDate { get; set; }
public required string Gender { get; set; }
public Guid JobRoleId { get; set; }
public string? ProfileImage { get; set; }
public required Guid OrganizationId { get; set; }
public required bool HasApplicationAccess { get; set; }
}
}

View File

@ -0,0 +1,10 @@
namespace Marco.Pms.Model.Dtos.Master
{
public class ActivityGroupDto
{
public Guid? Id { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
public required Guid ServiceId { get; set; }
}
}

View File

@ -2,7 +2,7 @@
{
public class CreateContactCategoryDto
{
public string? Name { get; set; }
public string? Description { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
}
}

View File

@ -2,7 +2,7 @@
{
public class CreateContactTagDto
{
public string? Name { get; set; }
public string? Description { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
}
}

View File

@ -5,6 +5,7 @@
public Guid? Id { get; set; }
public required string Name { get; set; }
public required bool NoOfPersonsRequired { get; set; }
public required bool IsAttachmentRequried { get; set; }
public string? Description { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace Marco.Pms.Model.Dtos.Master
{
public class ServiceMasterDto
{
public Guid? Id { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
}
}

View File

@ -2,8 +2,8 @@
{
public class UpdateContactCategoryDto
{
public Guid Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public required Guid Id { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
}
}

View File

@ -3,7 +3,7 @@
public class UpdateContactTagDto
{
public Guid Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace Marco.Pms.Model.Dtos.Organization
{
public class AssignOrganizationDto
{
public required Guid ProjectId { get; set; }
public required Guid OrganizationId { get; set; }
public Guid? ParentOrganizationId { get; set; }
public required List<Guid> ServiceIds { get; set; }
public required Guid OrganizationTypeId { get; set; }
}
}

View File

@ -0,0 +1,13 @@
namespace Marco.Pms.Model.Dtos.Organization
{
public class CreateOrganizationDto
{
public required string Name { get; set; }
public required string Email { get; set; }
public required string ContactPerson { get; set; }
public required string Address { get; set; }
public required string ContactNumber { get; set; }
public string? logoImage { get; set; }
public List<Guid>? ServiceIds { get; set; }
}
}

View File

@ -0,0 +1,12 @@
namespace Marco.Pms.Model.Dtos.Organization
{
public class UpdateOrganizationDto
{
public required Guid Id { get; set; }
public required string Name { get; set; }
public required string ContactPerson { get; set; }
public required string Address { get; set; }
public required string ContactNumber { get; set; }
public List<Guid>? ServiceIds { get; set; }
}
}

View File

@ -0,0 +1,10 @@
namespace Marco.Pms.Model.Dtos.Projects
{
public class AssignServiceDto
{
public required Guid ProjectId { get; set; }
public required List<Guid> ServiceIds { get; set; }
public DateTime PlannedStartDate { get; set; }
public DateTime PlannedEndDate { get; set; }
}
}

View File

@ -7,17 +7,18 @@ namespace Marco.Pms.Model.Dtos.Project
{
[Required(ErrorMessage = "Project Name is required!")]
[DisplayName("Project Name")]
public string? Name { get; set; }
public required string Name { get; set; }
[DisplayName("Short Name")]
public string? ShortName { get; set; }
[DisplayName("Project Address")]
[Required(ErrorMessage = "Project Address is required!")]
public string? ProjectAddress { get; set; }
public required string ProjectAddress { get; set; }
[DisplayName("Contact Person")]
public string? ContactPerson { get; set; }
public required string ContactPerson { get; set; }
public DateTime? StartDate { get; set; }
@ -25,6 +26,8 @@ namespace Marco.Pms.Model.Dtos.Project
[DisplayName("Project Status")]
[Required(ErrorMessage = "Project Status is required!")]
public Guid ProjectStatusId { get; set; }
public required Guid ProjectStatusId { get; set; }
public required Guid PromoterId { get; set; }
public required Guid PMCId { get; set; }
}
}

View File

@ -0,0 +1,8 @@
namespace Marco.Pms.Model.Dtos.Projects
{
public class DeassignServiceDto
{
public required Guid ProjectId { get; set; }
public required List<Guid> ServiceIds { get; set; }
}
}

View File

@ -2,9 +2,10 @@
{
public class ProjectAllocationDot
{
public Guid EmpID { get; set; }
public Guid EmployeeId { get; set; }
public Guid JobRoleId { get; set; }
public Guid ProjectId { get; set; }
public Guid? ServiceId { get; set; }
public bool Status { get; set; }
}
@ -13,6 +14,7 @@
{
public Guid ProjectId { get; set; }
public Guid JobRoleId { get; set; }
public Guid? ServiceId { get; set; }
public bool Status { get; set; }
}
}

View File

@ -5,20 +5,20 @@ namespace Marco.Pms.Model.Dtos.Project
{
public class UpdateProjectDto
{
public Guid Id { get; set; }
public required Guid Id { get; set; }
[Required(ErrorMessage = "Project Name is required!")]
[DisplayName("Project Name")]
public string? Name { get; set; }
public required string Name { get; set; }
[DisplayName("Short Name")]
public string? ShortName { get; set; }
[DisplayName("Project Address")]
[Required(ErrorMessage = "Project Address is required!")]
public string? ProjectAddress { get; set; }
public required string ProjectAddress { get; set; }
[DisplayName("Contact Person")]
public string? ContactPerson { get; set; }
public required string ContactPerson { get; set; }
public DateTime? StartDate { get; set; }
@ -26,6 +26,8 @@ namespace Marco.Pms.Model.Dtos.Project
[DisplayName("Project Status")]
[Required(ErrorMessage = "Project Status is required!")]
public Guid ProjectStatusId { get; set; }
public required Guid ProjectStatusId { get; set; }
public required Guid PromoterId { get; set; }
public required Guid PMCId { get; set; }
}
}

View File

@ -17,5 +17,6 @@
public required string OrganizationSize { get; set; }
public required Guid IndustryId { get; set; }
public required string Reference { get; set; }
public List<Guid>? ServiceIds { get; set; }
}
}

Some files were not shown because too many files have changed in this diff Show More