Skip to content

Inventory Allocation — Current Source Reconciliation

  • Status: SOURCE_RECONCILED CURRENT MK ADAPTER / TARGET POLICY BLOCKED
  • Parent Task: NS0-003
  • Reviewed source revision: qa/master@1529bce22ae39c7c2c11e1b9b07e457e1e4c4355
  • Profile: mk-order; reusable capability candidate for other profiles
  • Restriction delta: RD-000 / NONE
  • Effects: documentation/catalog only

1. Current Owner And Routes

Current active route family:

GET  /api/oms/allocations/workbench
GET  /api/oms/allocations/target-shipments
GET  /api/oms/allocations/allocatable-lots/search
POST /api/oms/allocations/apply

Current implementation owners:

app/systems/OMS/allocation/**
app/systems/OMS/inbound-order/mk_post_helper.php
frontend/pages/system/OMS/allocation/mk-allocation-workbench.php
public/assets/js/modules/oms/allocation-workbench.js

2. Current Authority

T_INVENTORY_LOT
= source lot and current remaining balance

T_LOAD_ALLOCATION
= accepted source-lot to target-line relation

T_LOAD_ITEM
= Apply-created target outbound line

T_LOAD
= existing outbound Sales execution target

The browser basket and visible source/target lists are projections, not authority.

3. Current Apply Transaction

validate existing target shipment/equipment bridge
validate active source lot and weight balance
create target T_LOAD_ITEM
insert T_LOAD_ALLOCATION
conditionally decrement T_INVENTORY_LOT.REMAIN_NET_WEIGHT
synchronize compatibility projections
return target and created item IDs
reread Workbench

Current source allows partial allocated weight. Use Full Remain is convenience, not a universal full-lot rule.

4. Quantity / Weight Asymmetry

Current Apply persists both quantity and net weight, but immediately decrements only:

REMAIN_NET_WEIGHT

It does not immediately decrement:

REMAIN_QUANTITY

Therefore:

quantity
!= weight
!= UOM conversion

Target policy cannot infer one from the other without approved UOM/precision rules.

5. Duplicate, Concurrency And Unknown Result

Current writer uses a conditional remaining-weight update and requires an affected row, which is a source-level overdraw guard. It does not provide a durable request token.

A response-loss replay can create duplicate target lines/allocations if enough balance remains.

Safe current recovery:

reread target T_LOAD_ITEM rows
+reread active T_LOAD_ALLOCATION rows
+reread source T_INVENTORY_LOT balance
-> classify intended relation present/missing/conflicting
-> no blind replay

6. Correction And Reversal

No general public Reverse/Unallocate command is source-confirmed. Soft delete columns are not permission to treat direct deletion as a business reversal.

Target candidate command family:

PreviewAllocation
ApplyAllocation
ReverseAllocation
ReconcileAllocation

Each command requires one owner and immutable correction lineage.

7. Target Boundary

Allocation owns accepted source consumption and relation evidence. It must not own:

Inbound receipt/lot creation
ordinary Outbound CRUD
Booking lifecycle
Scale completion
Delivery completion
Settlement

8. Open Decisions

  • partial/full allocation policy by UOM;
  • quantity/weight consumption rule;
  • target demand and lifecycle eligibility;
  • lot status after partial/full consumption;
  • rate snapshot owner;
  • reverse/reconcile authority;
  • durable idempotency identity;
  • source correction after allocation;
  • allocated target-line correction;
  • role/action/record scope;
  • live schema/index/data integrity.

9. Page And Wiki Boundary

No Runtime page changed. Page-specific browser scripts, screenshots, in-app User Wiki and page CHANGELOG are NOT_APPLICABLE.

---

Source: new-system/docs/reconstruction/INVENTORY_ALLOCATION_SOURCE_RECONCILED.md — ctc repository · This page is an English translation of the source document. Identifiers, file paths and code symbols are unchanged.