handlers.due_date_tagger

class DueDateTagger(handlers.eventhandler.EventHandler):

Checks if a date is about to expire (e.g. a validity field). If the date is closer than n days, a tag is assigned, so that the fact sheet can be automatically included in a survey, or other measures can be taken, like breaking the quality seal.

Configuration: field: The date field
days: Number of days
tag_group: The tag group of the tag to be assigned
tag_name: The tag to be assigned

name = 'Due Date Tagger'
description = 'Assigns a tag if a date is about to be due.'
conditions = {'event_types': ['FactSheetUpdatedEvent'], 'fs_types': ['Application']}
config_template = {'field': 'security_assessment_validity', 'days': 30, 'tag_group': 'Security', 'tag_name': 'Assessment validity will expire soon'}
def handle(self, event, fs, **kwargs):

Called automatically whenever a FactSheetUpdated event comes in via webhook.