Revisit usage of `can_renew?` and `not_valid_for_renewal?` helpers
Problem
Currently we have 2 helpers can_renew?
and not_valid_for_renewal?
which have a common set of checks and their naming is also confusing as to when each should be used.
Proposal
We should revisit the implementation and usage of the 2 helpers mentioned above and check -
- If there is a chance to merge the two.
- If we can extract out the common conditions to a separate helper.
- Rename these to better signify their use case.
Note: can_renew?
helper currently has the check of in_renewal_period?
which means that it will return false
when the subscription is not in renewal period. not_valid_for_renewal?
helper does not have this check. This is because the output of not_valid_for_renewal?
is also used on the frontend to determine whether to show / hide the Renew button. We need to show the Renew button in the additional actions even when the subscription is not in renewal period. We will need to rethink how to achieve this if we add the in_renewal_period?
check to not_valid_for_renewal?
i.e. if we decide to merge the checks from the 2 helpers.