def determine_job_type()

in functions/orchestration-helpers/scheduling/main.py [0:0]


def determine_job_type(old_value ,new_value):
    """
    Evaluates what type of event was triggered in firestore: CREATE, UPDATE or DELETE

    Args:
        old value: old firestore value coming in trigger info
        new value:  new firestore value coming in trigger info

    Returns:
        type of event
    """
    if new_value and not old_value:
        return 'CREATE'
    elif old_value and not new_value:
        return 'DELETE'
    elif old_value and new_value:
        return 'UPDATE'