Cycle Manager
g2p_programs.models.managers.cycle_manager
provides the class BaseCycleManager
define the interface
for this manager. DefaultCycleManager
is the default implementation of this class that should be used
in most of the cases.
- class g2p_programs.models.managers.cycle_manager.BaseCycleManager(*args: Any, **kwargs: Any)[source]
- class g2p_programs.models.managers.cycle_manager.DefaultCycleManager(*args: Any, **kwargs: Any)[source]
-
- check_eligibility(cycle, beneficiaries=None)[source]
- Parameters
cycle (
g2p_programs.models.cycle.G2PCycle
) – The cycle that is being verifiedbeneficiaries (list or None) – the beneficiaries that need to be verified. By Default the one with the state
draft
orenrolled
are verified.
- Returns
The list of eligible beneficiaries
- Return type
list
Validate the eligibility of each beneficiary for the cycle using the configured manager(s)
g2p_programs.models.managers.eligibility_manager.BaseEligibilityManager
. If there is multiple managers for eligibility, each of them are run using the filtered list of eligible beneficiaries from the previous one.The
state
of beneficiaries is updated to eitherenrolled
if they match the enrollment criteria ornot_eligible
in case they do not match them.
- cycle_duration = 'Cycle Duration'