Rapu Ture - Exploring the Rules

eligibily for Student Allowance basic grant

Student Allowance Boolean MONTH Person Formula Included used 0 times

Value type Boolean . Default value false Entity person


How is this calculated?

To calculate this variable, the following input is used


Formulas

This is the formula used to calculate the value of student_allowance__eligible_for_basic_grant

0001-01-01

This formula is used for scenarios from the date 0001-01-01 onwards. More info on formulas

def formula(persons, period, parameters):
    has_children = persons('student_allowance__has_a_supported_child', period)
    is_secondary_student = persons('student_allowance__is_secondary_student', period)
    is_tertiary_student = persons('student_allowance__is_tertiary_student', period)

    # NOTE: using the age at the start of the month
    # Age changes on a DAY, but this calculation only has a granularity of MONTH
    is_or_over_16 = persons('age', period.start) >= 16
    is_under_18 = persons('age', period.start) < 18
    is_or_over_18 = persons('age', period.start) >= 18

    is_married_or_partnered = persons('student_allowance__is_married_or_partnered', period)

    criteria_a = is_secondary_student * is_or_over_16 * is_under_18 * is_married_or_partnered * has_children
    criteria_b = is_tertiary_student * is_or_over_16 * is_under_18 * has_children
    criteria_c = (is_secondary_student + is_tertiary_student) * is_or_over_18

    student_allowance__eligible_for_certain_allowances = persons('student_allowance__eligible_for_certain_allowances', period)

    partner_or_person_receives_certain_allowances = invert(persons('student_allowance__partner_or_person_receiving_certain_allowances', period))

    return (criteria_a + criteria_b + criteria_c) * student_allowance__eligible_for_certain_allowances * partner_or_person_receives_certain_allowances