Skip to content

Commit

Permalink
docs: add suggestion about avoiding suffixes in data field names
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Dec 26, 2024
1 parent caba18f commit 5c22b93
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/how-tos/create-a-new-event.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ The :term:`Event Definition` should be implemented in the corresponding subdomai
- The ``event_name`` should be a constant that is used to identify the event in the code.
- 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.
- The ``data`` dictionary should contain the payload class that is used to define the data that is included in the event. This will help consumers understand the event and react to it. Try using a descriptive name for the data field, but keep consistency with the payload class name. Avoid using suffixes like ``_data`` or ``_payload`` in the data field name.
- The event should be an instance of the ``OpenEdxPublicSignal`` class to ensure that the event is consistent with the Open edX event framework.
- Receivers should be able to access the event payload in their receivers to react to the event.

Expand Down

0 comments on commit 5c22b93

Please sign in to comment.