Skip to main content

Lib to post user events on transactional topics

Project description

Transactional Ruler

Lib to post user events on transactional topics

Running tests and lint

docker-compose up integration-tests docker-compose up lint

Installation

pip install jsm-transactional-ruler

Example Usage

from jsm_transactional_ruler.enums import EventType
from jsm_transactional_ruler.events import Event
from jsm_transactional_ruler.publisher import publish_event

event = Event(
    user_id="fake_id", event_type=EventType.T_EVENT_REGISTERED_USER, data={"email": "teste@juntossomosmais.com.br"}
)
publish_event(event_trigger=event)

The attribute event_type accepts only events registered in the EventType enum.

The publish_event method accepts the optional queue and publisher_parameters parameters to send to django-stomp:

event = Event(
    user_id="fake_id", event_type=EventType.T_EVENT_REGISTERED_USER, data={"email": "teste@juntossomosmais.com.br"}
)
publish_event(event_trigger=event, queue="/topic/VirtualTopic.user-update-transactions", persistent=False)

Versioning

This lib follows the pypi version format with the convention of using major.minor.patch version.

When to bump a patch version?

Bump the patch version if you are doing a quick fix, nothing that changes the library functionality.

When to bump the minor version?

Bump the minor version if you are adding new functionality without breaking backwards compatibility. For example, adding support to new events.

When to bump the major version?

Bump the major version if you are breaking backwards compatibility by adding new functionality or refactoring.

Contributing

This project uses a trunk based development flow, so that we have only one long-lived branch (master).

For any development, simply create a branch from it and follow the flow described below.

How to upload lib to PyPI

It is necessary to update the lib version using the command below:

$ poetry version major|minor|patch

After generating the version:

  • Create a new branch with the files updated by Poetry
  • Open PR based on the master branch
  • Merge PR into the master
  • Generate a new release based on the version. Document to generate release
  • After generating the new release "Github Actions" will upload the lib to PyPI using Poetry.
  • Good job!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsm_transactional_ruler-3.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsm_transactional_ruler-3.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file jsm_transactional_ruler-3.1.0.tar.gz.

File metadata

  • Download URL: jsm_transactional_ruler-3.1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.13 Linux/6.17.0-1008-azure

File hashes

Hashes for jsm_transactional_ruler-3.1.0.tar.gz
Algorithm Hash digest
SHA256 c68b8edf0eb386f2012d47b7c44f4a45b69072acb6da5747a242dff2c03bf28c
MD5 d9cd855f7e5ccacd5c880ccd117763cd
BLAKE2b-256 65bab24b20ef5f40f6e20cba440d7cc4653f8dca09cc716fe724ca4319df96c9

See more details on using hashes here.

File details

Details for the file jsm_transactional_ruler-3.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jsm_transactional_ruler-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 815ddad116ceaadf61f05e8d279ba263f2f1cde619cf70c66df81feaa858d28b
MD5 7dd20a36dd932031d7d0363a3b5197bc
BLAKE2b-256 ce95a2c0943cc253978df508c1a41bdc813e9a550657786b1afcb1afbcf99a71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page