"""This module contains the helpers for the ``eventlog`` app"""

from .models import EventLog


# pylint: disable=unused-argument
def event_log(subject, action, source=None, target=None, **kwargs):
    """The helper for the events we want to log

    Parameters
    ----------
    subject : The event subject, an instance of a Django Model
        The given object must own a primary key field
    action : The type of action we want to log.
        Must be a constant coming from ``mtp.apps.eventlog.models.Constants``
    source : The event source, an instance of a Django Model
        The given object must own a primary key field
        Can be Null
    target : The event target, an instance of a Django Model
        The given object must own a primary key field
        Can be Null
    kwargs : A dict of additional data to save to the event

    """

    EventLog.objects.create(subject=subject, action=action, source=source, target=target)
