Inventory adjusted

Indicates a change in inventory level

Event Recently updated! Broker:Apache Kafka

Inventory Adjusted 1.0.1 is in draft

New version of Inventory Adjusted is in draft

This is a new version of the Inventory Adjusted event. It is not yet ready for production. We are still working on it and collecting feedback from the team.

You can use this version in lower environments, but please be aware that it is still in draft and may change.

You can still use a previous version of the event, Inventory Adjusted 1.0.0, until that version is deprecated.

If you would like to provide feedback, please contact us at feedback@eventcatalog.io or our slack channel Order Management

Overview

The Inventory Adjusted event is triggered whenever there is a change in the inventory levels of a product. This could occur due to various reasons such as receiving new stock, sales, returns, or manual adjustments by the inventory management team. The event ensures that all parts of the system that rely on inventory data are kept up-to-date with the latest inventory levels.

Contact the team

Any questions? Feel free to contact the owners

View the schema

View the schema directly in your browser

Architecture diagram

Payload example

Event example you my see being published.

{
"Name": "John Doe",
"Age": 30,
"Department": "Engineering",
"Position": "Software Engineer",
"Salary": 85000.50,
"JoinDate": "2024-01-15"
}

Schema (avro)

Inventory Adjusted Schema (avro)
{
"type": "record",
"namespace": "Tutorialspoint",
"name": "Employee",
"doc": "Represents an employee in the organisation HR system.",
"fields": [
{ "name": "Name", "type": "string", "doc": "Full name of the employee." },
{ "name": "Age", "type": "int", "doc": "Age in years at time of record creation.", "default": 0 },
{ "name": "Department", "type": "string", "doc": "The department the employee belongs to.", "default": "Unknown" },
{ "name": "Position", "type": "string", "doc": "The employee's job title or role.", "default": "Unknown" },
{ "name": "Salary", "type": "double", "doc": "Annual salary in the company currency.", "default": 0.0 },
{ "name": "JoinDate", "type": "string", "logicalType": "date", "doc": "Date employee joined the company. Format: YYYY-MM-DD.", "default": "" }
]
}

Producing the Event

Select the language you want to produce the event in to see an example.

Consuming the Event

To consume an Inventory Adjusted event, use the following example Kafka consumer configuration in Python:

Consuming the event with python
from kafka import KafkaConsumer
import json
# Kafka configuration
consumer = KafkaConsumer(
'inventory.adjusted',
bootstrap_servers=['localhost:9092'],
auto_offset_reset='earliest',
enable_auto_commit=True,
group_id='inventory_group',
value_serializer=lambda v: json.dumps(v).encode('utf-8')
)
# Consume events
for message in consumer:
event_data = json.loads(message.value)
print(f"Received Inventory Adjusted event: {event_data}")
Event-driven architecture documentation: FlowMart

JSON Schema

6 properties

A record representing an employee

Namestring
required

The name of the employee

Ageinteger
required

The age of the employee

Departmentstring
required

The department where the employee works

Positionstring
required

The position or title of the employee within the department

Salarynumber<double>
required

The salary of the employee

JoinDatestring<date>
required

The date when the employee joined the company

Avro schema

6 fields
Record:Employee(Tutorialspoint)

Represents an employee in the organisation HR system.

Namestringrequired

Full name of the employee.

Ageint

Age in years at time of record creation.

Departmentstring

The department the employee belongs to.

Positionstring

The employee's job title or role.

Salarydouble

Annual salary in the company currency.

JoinDatestring

Date employee joined the company. Format: YYYY-MM-DD.