
INSERT INTO [FrontEnd].[Routes]
           ([Route]
           ,[ModuleName]
           ,[ModulePath]
           ,[RequiredRole]
       )
     VALUES
           (
		   '!/casters-shift-report(/:productionDate)(/:shiftId)'
           , 'casters-shift-report'
		   , 'custom-screens/casters-shift-report/'
           , 'castersShiftReportPDF_read'
           
		   )



INSERT INTO [FrontEnd].[Menu]
           ([Parent]
           ,[Name]
           ,[RouteID]
           ,[SortOrder]
           ,[Enabled]
           ,[Visible]
           ,[RequiredRole]
           ,[Group]
          )
     VALUES
           (
		   (select top 1 Id from FrontEnd.menu where Name = 'Caster' and Parent is null)
		   ,'Casters Shift Report'
           ,@@IDENTITY
           ,(select Max(SortOrder)+1 from FrontEnd.Menu where Parent = (select Id from frontend.Menu where [Name] = 'Caster'))
           ,1
           ,1
           ,'castersShiftReportPDF_read'
           ,NULL
         )
GO

-------------------
--	Profiles
-------------------
	USE [IHBoxSystem]
	GO

	DECLARE @ModuleId INT

	INSERT INTO [SECURITY].[Modules]([Code],[Name])
	VALUES('casters_shift_report','Casters Shift Report')

	SET @ModuleId = @@IDENTITY


	INSERT INTO [SECURITY].ModuleActions(ModuleId,Code,[Name],[Role])
	VALUES (@ModuleId,'read','Read','castersShiftReportPDF_read')