﻿------------------------------------------- Ali 2023-11-30 ------------------------------------------------------

  INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) 
VALUES(1379,N'مسح بيانات الهاتف ',N'Can Reset Device Id',6,2)
GO
------------------------------------------- End 2023-11-30 ------------------------------------------------------
------------------------------------------- Hammad 2023-11-30 ------------------------------------------------------
CREATE TABLE [dbo].[WF_LoanRequestSplitDetail](
	[LoanRequestSplitDetailCode] [int] IDENTITY(1,1) NOT NULL,
	[LoanRequestId] [bigint] NOT NULL,
	[LoanPercentage] [float] NOT NULL,
	[CalculateNumber] [int] NOT NULL,
	[IsInstallment] [bit] NOT NULL,
	[MaxInstallmentsCount] [int] NOT NULL,
	[InstallmentsCount] [int] NOT NULL,
	[Period] [int] NOT NULL,
	[PYear] [int] NOT NULL,
 CONSTRAINT [PK_WF_LoanRequestSplitDetail] PRIMARY KEY CLUSTERED 
(
	[LoanRequestSplitDetailCode] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[WF_LoanRequestSplitDetail] ADD  CONSTRAINT [DF_WF_LoanRequestSplitDetail_IsInstallment]  DEFAULT ((0)) FOR [IsInstallment]
GO

ALTER TABLE [dbo].[WF_LoanRequestSplitDetail]  WITH CHECK ADD  CONSTRAINT [FK_WF_LoanRequestSplitDetail_WF_LoanRequest] FOREIGN KEY([LoanRequestId])
REFERENCES [dbo].[WF_LoanRequest] ([LoanRequestId])
GO

ALTER TABLE [dbo].[WF_LoanRequestSplitDetail] CHECK CONSTRAINT [FK_WF_LoanRequestSplitDetail_WF_LoanRequest]
GO

------------------------------------------- End 2023-11-30 ------------------------------------------------------
------------------------------------------- Mostafa 2023-11-30 ------------------------------------------------------
INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(702,N'Course Plan Registration For Others',N'ادارة المسجلين في خطة الدورة التدريبية',662,N'/Training/CoursePlanRegistrarsManagement',N'Index','fa fa-user',N'get',1,1,1)
Go
INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(702,20)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(24069,N'ادارة المسجلين في خطة الدورة التدريبية',N'Course Plan Registrars Management',702,1)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(24070,N'تحويل المسجلين في خطة الدورة التدريبية',N'Transfer Course Plan Registrars Management',702,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(24071,N'خذف المسجلين في خطة الدورة التدريبية',N'Delete Course Plan Registrars Management',702,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(24072,N'عرض المسجلين في خطة الدورة التدريبية',N'View Course Plan Registrars Management',702,2)
--************************************************************
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1354,N'Training',N'CoursePlanRegistrarsManagement',N'Index',0,N'get',24069)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1355,N'Training',N'CoursePlanRegistrarsManagement',N'ChangeCoursePlanRegistrationStatus',2,N'post',24070)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1356,N'Training',N'CoursePlanRegistrarsManagement',N'DeleteCoursePlanRegistrarsManagement',2,N'post',24071)
GO
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1357,N'Training',N'CoursePlanRegistrarsManagement',N'GetByCoursePlan_Read',0,N'post',24072)
GO
--************************************************************
GO
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES (914, NULL, NULL, N'CoursePlanRegistration', N'ChangeCoursePlanRegistrationStatus', N'Post')
--************************************************************
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES (1142, 914, 24070, NULL)
GO
--************************************************************

------------------------------------------- End 2023-11-30 ------------------------------------------------------
------------------------------------------- Negm  2023-11-30 ------------------------------------------------------

update WF_RequestType set IsApi = 1 where RequestTypeId in ( 14, 16, 18, 19, 25,26,30,31, 42, 12, 15)
Go
------------------------------------------- End 2023-11-30 ------------------------------------------------------
------------------------------------------- Negm  2023-12-03 ------------------------------------------------------

  update SecurityPrivilegeEndPointsDetails  set SecurityPrivilegeId= 3399 where id = 377

------------------------------------------- End 2023-12-03 ------------------------------------------------------
------------------------------------------- End 2023-12-04 ------------------------------------------------------

update EmailTemplateType set [Arabic_Name]=N'تغير حالة التسجيل في الخطه الدورة التدريبة' where EmailTemplateTypeCode=379
------------------------------------------- End 2023-12-04 ------------------------------------------------------
------------------------------------------- Ali 2023-12-05 ------------------------------------------------------

INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(1026,N' Social Care Type',N'انواع الرعاية الاجتماعية',28,N'/WorkFlow/SocialCareType',N'Index','fa fa-thumb-tack',N'get',31,1,1)
Go

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(1026,1)
Go

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(15429,N'انواع الرعاية الاجتماعية',N' Social Care Type',1026,1)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(15430,N'عرض انواع الرعاية الاجتماعية',N'View  Social Care Type',1026,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(15431,N'إضافة انواع الرعاية الاجتماعية',N'Add  Social Care Type',1026,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(15432,N'تعديل انواع الرعاية الاجتماعية',N'Edit  Social Care Type',1026,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(15433,N'حذف انواع الرعاية الاجتماعية',N'Delete  Social Care Type',1026,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(15434,N'حفظ انواع الرعاية الاجتماعية',N'Save  Social Care Type',1026,2)
Go

-- SSTAuthorizationActionFilterBefore (script only not added in db Check it and run if you want) 

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1358,N'WorkFlow',N'SocialCareType',N'Index',0,N'get',15429)

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1359,N'WorkFlow',N'SocialCareType',N'SocialCareType_Read',0,N'post',15430)

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1360,N'WorkFlow',N'SocialCareType',N'Save',1,N'get',15431)

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1361,N'WorkFlow',N'SocialCareType',N'Save',2,N'get',15432)

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1362,N'WorkFlow',N'SocialCareType',N'Delete',0,N'post',15433)

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1363,N'WorkFlow',N'SocialCareType',N'Save',0,N'post',15434)

-- Api security privilege End Point (script only not added in db Check it and run if you want) 

INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(915,NULL, NULL,N'SocialCareType',N'GetSocialCareTypeSearch',N'post')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(916,NULL, NULL,N'SocialCareType',N'GetSocialCareType',N'Get')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(917,NULL, NULL,N'SocialCareType',N'Put',N'Put')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(918,NULL, NULL,N'SocialCareType',N'post',N'post')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(919,NULL, NULL,N'SocialCareType',N'Delete',N'Delete')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(920,NULL, NULL,N'SocialCareType',N'Get',N'Get')
Go
-- Api security privilege End Point Detail (script only not added in db Check it and run if you want) 

INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1143,915,15430, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1144,916,15430, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1145,917,15434, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1146,918,15434, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1147,919,15433, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1148,920,15432, NULL)
Go

------------------------------------------- End 2023-12-05 ------------------------------------------------------
------------------------------------------- Mostafa 2023-12-06 ------------------------------------------------------
INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(703,N'Managing Training Course Plans',N'ادارة خطط الدورات التدريبية',662,NULL,NULL,' fa fa-cogs',NULL,1,1,1)

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(703,20)
Go

update [SystemMenu] set [ParentID]=703 where [SystemMenuCode] in (667,701,668,669,702)
------------------------------------------- End 2023-12-06 ------------------------------------------------------
