Interface RequirementRuleService
- All Known Implementing Classes:
RequirementRuleServiceImpl
public interface RequirementRuleService
-
Method Summary
Modifier and TypeMethodDescriptionboolean
confirmRequirementAdjustements
(EntityList requirements) send the user a confirmation question if the Requirements should actually be updatedfilterOpenRequirements
(EntityList requirements) filter out all Requirements that aren't opengetValidRegistrations
(Entity event) Return all registrations for given event entity which have status 'registered' or 'booked'getValidSchoolings
(Entity courseOfStudy) Return all schooling entites which are linked with given course of study and have an empty end date or in futurevoid
linkRequirementRules
(EntityList sourceEntities, EntityList requirementPackages) Connect all the requirement rules with given single source entity.void
linkRequirementRulesForSingleEntity
(Entity sourceEntity, EntityList requirementPackages) void
removeRequirementPackage
(EntityList sources, Entity requirementPackage) removes Requirement_packages from Requirements that were generated on sources.
-
Method Details
-
linkRequirementRules
Connect all the requirement rules with given single source entity. A requirement entity is created for each rule in the given requirement packages. If a rule is present in multiple packages only a single requirement entity is created. Each requirement entity knows from which package it originated.- Parameters:
sourceEntities
- Entities of model 'Schooling' or 'Registration'requirementPackages
- the requirement packages from which to load the rules to be used
-
linkRequirementRulesForSingleEntity
- Parameters:
sourceEntity
- Single entity of model 'Schooling' or 'Registration'requirementPackages
- the Requirement_packages from which to load the rules to be used
-
getValidSchoolings
Return all schooling entites which are linked with given course of study and have an empty end date or in future- Parameters:
courseOfStudy
- Source course of study entity- Returns:
- EntityList with valid schooling entities
-
getValidRegistrations
Return all registrations for given event entity which have status 'registered' or 'booked'- Parameters:
event
- Source event entity- Returns:
- EntityList with valid registration entities
-
removeRequirementPackage
removes Requirement_packages from Requirements that were generated on sources. If the Requirements have any other status than 'open' a confirmation is sent to the user before anything else is done. Afterwards the Requirement_package is removed from Requirement_relRequirement_package. If that Requirement_package is the last one on the Requirement, it is deleted.- Parameters:
sources
- the sources from which to load RequirementsrequirementPackage
- the Requirement to remove
-
filterOpenRequirements
filter out all Requirements that aren't open- Parameters:
requirements
- the Requirements to filter- Returns:
- a list of Requirements with any status other than 'open'
-
confirmRequirementAdjustements
send the user a confirmation question if the Requirements should actually be updated- Parameters:
requirements
- the Requirements to list in the question- Returns:
- the answer from the user
-