class ProgramStageObjectBundleHook extends AbstractObjectBundleHook {

    @Override
    public <T extends IdentifiableObject> List<ErrorReport> validate( T object, ObjectBundle bundle )
    {
        if ( object == null || !object.getClass().isAssignableFrom( ProgramStage.class ) )
        {
            return new ArrayList<>();
        }

        ProgramStage programStage = ( ProgramStage ) object;

        List<ErrorReport> errors = new ArrayList<>();

        if ( programStage.getNextScheduleDate() != null )
        {
            DataElement nextScheduleDate = bundle.getPreheat().get( bundle.getPreheatIdentifier(), DataElement.class,
                programStage.getNextScheduleDate().getUid() );

            if ( !programStage.getDataElements().contains( programStage.getNextScheduleDate() )
                || nextScheduleDate == null || !nextScheduleDate.getValueType().equals( ValueType.DATE ) )
            {
                errors.add( new ErrorReport( ProgramStage.class, ErrorCode.E6001, programStage.getUid(),
                    programStage.getNextScheduleDate().getUid() ) );
            }
        }

        errors.addAll( validateProgramStageDataElementsAcl( programStage, bundle ) );

        return errors;
    }

    public  ProgramStageObjectBundleHook( AclService aclService );

}