# Release Notes

## New Feature: Object Metadata Fields in Queue Table

We introduced new columns in the queue table to improve traceability of queued objects:

- `object_type`
- `object_id`
- `object_metadata_1`
- `object_metadata_2`
- `object_metadata_3`
- `object_metadata_4`

### Default Behavior
- `object_type`: if not specified in the `payload`, it will automatically be set to the **entity type** of the processed object.
- `object_id`: if not specified in the `payload`, it will automatically be set to the **entity ID** of the processed object.
- `object_metadata_*`: optional fields that can be used to store custom contextual data.

By default, metadata fields are available in the admin grid but **disabled (hidden)**.  
Administrators can enable them via the *Columns* selector in the grid view.

---

## How to Populate Metadata Fields

These fields can be populated directly from the **ESB producer configuration**.  
Within the `payload` section, you can specify the values for `object_type`, `object_id`, and the metadata fields depending on the object being processed.

### Example Configuration

```json
{
    "conditions": [
        [
            {
                "field": "{data/customer_email}",
                "operator": "neq",
                "value": "sistemi@filoblu.com"
            }
        ],
        "and",
        [
            [
                {
                    "field": "{data/status}",
                    "operator": "in",
                    "value": [
                        "confirmed",
                        "pending",
                        "pending_payment"
                    ]
                },
                "and",
                {
                    "field": "{origdata/status}",
                    "operator": "eq",
                    "value": null
                }
            ]
        ]
    ],
    // here we populate the metadata fields
    "payload": {
        "object_type": "order",
        "object_id": "{data/entity_id}",
        "increment_id": "{data/increment_id}",
        "from_status": "{origdata/status}",
        "to_status": "{data/status}",
        "object_metadata_1": "{data/increment_id}",
        "object_metadata_2": "{data/status}"
    }
}
