15 lines
1.3 KiB
Python
15 lines
1.3 KiB
Python
"""Allowlisted workflow interfaces, shared by builder and evaluator."""
|
|
|
|
METHODS = {'invoice', 'subscription', 'prepaid', 'internal', 'non_billable'}
|
|
FIELDS = {'customer_id', 'case_id', 'description', 'hours', 'worked_date', 'tags', 'tag_ids', 'status', 'billable', 'entity_type', 'sla_status', 'priority', 'subject', 'has_active_agreement', 'has_active_card'}
|
|
FIELDS.update({'remaining_card_hours','has_available_card'})
|
|
OPERATORS = {'eq', 'ne', 'contains', 'not_contains', 'in', 'not_in', 'gt', 'gte', 'lt', 'lte', 'exists'}
|
|
TRIGGERS = {'time.created', 'time.updated', 'case.created', 'case.updated', 'tags.changed', 'mail.received', 'sla.changed', 'customer.updated', 'task.updated', 'reminder.due', 'notification.created'}
|
|
TRIGGERS.update({'case.closed','tags.added','tags.removed','customer.created','task.created'})
|
|
ACTIONS = {'set_billing', 'add_tag', 'remove_tag', 'suggest_tag', 'notify', 'create_task', 'create_reminder', 'set_field', 'assign_user', 'assign_group', 'start_workflow'}
|
|
ACTIONS.add('send_to_review')
|
|
EXECUTABLE_ACTIONS = set(ACTIONS)
|
|
|
|
def catalog():
|
|
return {'fields': sorted(FIELDS), 'operators': sorted(OPERATORS), 'triggers': sorted(TRIGGERS), 'actions': sorted(ACTIONS), 'billing_methods': sorted(METHODS), 'executable_actions': sorted(EXECUTABLE_ACTIONS)}
|