magento / magento/inventory

Add updated_at field + database trigger into inventory source item table

Open
#3,444 2 comments 0 reactions 1 assignee Claimed by @engcom-Hotel View on GitHub
Feature Request Issue: ready for confirmation Triage: Dev.Experience
Dominant language
PHP
Stars
357
Forks
262
PR merge metrics
No merged PRs in 30d

Description

### Description (*)
update_at field into the stock inventory table

```
select * from inventory_source_item limit 10;
+----------------+-------------+------------+----------+--------+
| source_item_id | source_code | sku | quantity | status |
+----------------+-------------+------------+----------+--------+
| 1 | default | POS-104002 | 4.0000 | 1 |
| 2 | default | POS-104003 | 2.0000 | 1 |
| 3 | default | POS-124005 | 8.0000 | 1 |
| 4 | default | POS-SFR-6612 | 0.0000 | 1 |
| 5 | default | POS-104004 | 2.0000 | 1 |
| 6 | default | POS-104006 | 1.0000 | 1 |
| 7 | default | POS-104007 | 2.0000 | 1 |
| 8 | default | POS-104008 | 4.0000 | 1 |
| 9 | default | POS-104009 | 4.0000 | 1 |
| 10 | default | POS-104011 | 3.0000 | 1 |
+----------------+-------------+------------+----------+--------+
```
### Expected behavior (*)
Expected behaviour is to add it to the database, and let the database manage the updated_at field on save

### Benefits
Currently there is no way of knowing when stock was updated. We're running a sync, and the product update_at isn't changed on stock changes, and the inventory table also is not changed.

This prevents a partial sync to other systems. e.g.
```
select * from inventory_source_item where updated_at > last_sync_time;
````

### Additional information
Should be available via the api in some fashion, ideally in the export_salable_qty rest api endpoint to allow bulk lookups.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.