diff --git a/docs/how-tos/create-a-new-event.rst b/docs/how-tos/create-a-new-event.rst index e3c889a3..4c1c2e21 100644 --- a/docs/how-tos/create-a-new-event.rst +++ b/docs/how-tos/create-a-new-event.rst @@ -188,7 +188,7 @@ The :term:`Event Definition` should be implemented in the corresponding subdomai - The event definition should be documented using in-line documentation with at least ``event_type``, ``event_name``, ``event_key_field``, ``event_description``, ``event_data`` and ``event_trigger_repository``. This will help consumers understand the event and react to it. See :doc:`../reference/in-line-code-annotations-for-an-event` for more information. - The :term:`Event Type` should be unique and follow the naming convention for event types specified in the :doc:`../decisions/0002-events-naming-and-versioning` ADR. This is used by consumers to identify the event. -- The ``event_name`` should be a constant that is used to identify the event in the code. +- The ``event_name`` should be the variable name storing the event instance used to trigger the event. The name of the variable usually matches the ``{Subject}_{Action}`` of the event type. See more about the name in the :doc:`../decisions/0002-events-naming-and-versioning` ADR. - The ``event_key_field`` should be a field in the payload that uniquely identifies the event. This is used by consumers to identify the event. - The ``event_description`` should describe what the event is about and why it is triggered. - The ``event_data`` should be the payload class that is used to define the data that is included in the event. diff --git a/docs/reference/in-line-code-annotations-for-an-event.rst b/docs/reference/in-line-code-annotations-for-an-event.rst index fa340771..8841c1d5 100644 --- a/docs/reference/in-line-code-annotations-for-an-event.rst +++ b/docs/reference/in-line-code-annotations-for-an-event.rst @@ -40,11 +40,11 @@ Consider the following example: In-line code annotations are also used when integrating the event into the service. -+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ -| Annotation | Description | -+=====================================+============================================================================================================================+ -| event_implemented_name (Required) | Name of the event that is being implemented. Use the variable name of the event instance. | -+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| Annotation | Description | ++===================================+============================================================================================================================================================+ +| event_implemented_name (Required) | Variable name storing the event instance used to trigger the event. The name of the variable usually matches the ``{Subject}_{Action}`` of the event type. | ++-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ Consider the following example: