This is an internal working record, not an everyday instruction. It was written while the system was being rebuilt, for whoever maintains it. If you are here to do today's work, use the everyday documents instead: Procedures · Processes · Runbooks · The working day, step by step
MK Trade / Export / Cost / Rate / Outputs — Current Caller, Effect And Output Matrix — 2026-08-09¶
- Status:
CURRENT STATIC MATRIX / ENVIRONMENT EVIDENCE REQUIRED - Source refresh:
MK_TRADE_CURRENT_LINEAGE_AND_SOURCE_REFRESH_2026-08-09.md - Historical Process packet:
MK_TRADE_COST_RATE_DOCUMENT_OUTPUTS_RECONCILIATION.md - Evidence package:
RBR-TRADE-001-READONLY-CURRENT-SURFACE-PREFLIGHT.md - Phase implementation:
USER HOLD
1. Matrix Rule¶
Every row separates:
UI/Page
Route or direct page
Actor/Access
Application owner
Authoritative records
Derived output
Local write
External/File effect
Completion
Unknown-result recovery
A shared page or helper does not merge these authorities.
2. Summary Matrix¶
| Capability | Current UI/Page | Current owner | Authority | Effect | Completion evidence |
|---|---|---|---|---|---|
| Trade Summary list/detail | mk-trade-summary, mk-deal-ledger alias |
BMS report/query family | OMS/TMS/BMS source rows | read projection / CSV download | source breakdown and current query fingerprint |
| Export Brokerage preview | mk-export-brokerage |
OMS Export Brokerage | selected source rows | read-only proposed child set | validated proposal only |
| Export Brokerage create | same | OMS orchestration + child owners | Purchase/Booking/Outbound/Inventory/Equipment/Allocation | multi-table local commit | exact child manifest/readback |
| Export Brokerage cancel/reverse | same | OMS orchestration + child owners | generated child rows and balances | compensation | per-child compensation/residual manifest |
| Outbound Cost read | outbound order/cost surface | OMS Outbound + BMS Transaction | exact linked AP transaction | read | transaction and line readback |
| Outbound Cost create/update/delete | same | BMS Transaction command under outbound context | T_TRANSACTION and lines |
local write; optional file link separately | exact transaction ID, status, lines, outbound relation |
| Packing Rate read | Packing List | TMS Booking/report | Sales/Outbound load item | read/render | every intended item/rate readback |
| Packing Rate update | Packing List | TMS Booking command | Booking-linked Sales/Outbound item rate | local write | per-item result and server reread |
| Packing document | mkPackingList / packingList |
TMS Booking/report | Booking/Order/Equipment/Rate | render/print; email only through separate command | source fingerprint; separate file/mail result |
| Purchase Local Invoice | localInvoice |
BMS invoice/report | Purchase/Order/Rate/Fee/Credit | render/print | formula/source fingerprint |
| Booking Confirmation | bookingConfirmation |
TMS Booking/report | Booking and references | render/print | source/template fingerprint |
| Sales Weight Ticket — order derived | Weight Ticket page/report | BMS/TMS report | Sales/Outbound order data | render/print | explicit ORDER_DERIVED evidence label |
| Sales Weight Ticket — physical | Scale Ticket output | Scale owner | T_SCALE_TICKET and related source |
render/print | physical ticket identity and source state |
3. Trade Summary¶
3.1 Query path¶
Page request
-> report query helper
-> tenant-scoped source queries
-> derived totals/status/margin
-> browser table/detail
3.2 Required source classes¶
The current query must identify which of the following are included:
- Commercial/Purchase/Sales order;
- Booking;
- Equipment and Equipment Load;
- Transload/shipping references;
- Equipment-linked AP/AR;
- Outbound-order-linked AP;
- dates and shipment markers.
3.3 Current output states¶
DERIVED OPEN/SHIPPED/CLOSED-LIKE LABEL
DERIVED CLAIMED/NEGATIVE-MARGIN FILTER
DERIVED MARGIN
DERIVED HEADER TOTALS
None is a durable business transition unless another owner stores it.
3.4 Recovery¶
A wrong total is corrected at the owning Purchase, Sales, Booking, Equipment, or Transaction source. The Trade projection is then rerun. Direct report-row mutation is not a recovery method.
4. Export Brokerage¶
4.1 Preview¶
selected source
-> normalize proposal
-> show candidate Purchase/Booking/Outbound/Equipment/Allocation children
Preview must not imply create approval.
4.2 Create¶
Expected current child families include, subject to exact current source evidence:
Inbound/Purchase header and items
Transload or inventory-lot relation
Booking relation/generated Booking
Outbound/Sales header and items
Equipment/Equipment Load
Allocation/balance relation
compatibility markers
4.3 Current generated markers¶
[EB:generated]
[EB:generated-booking]
They support search/recovery but are not sufficient for idempotency.
4.4 Create result states¶
| State | Meaning |
|---|---|
ABSENT |
no child set found |
COMPLETE_MATCH |
one coherent child set found |
PARTIAL |
some expected children found |
MULTIPLE_MATCHES |
more than one candidate set |
CONFLICT |
identity/state/balance disagreement |
UNKNOWN |
evidence insufficient |
4.5 Cancel/reverse¶
Cancellation must produce per-child dispositions:
COMPENSATED
ALREADY_COMPENSATED
BLOCKED_DOWNSTREAM
NOT_FOUND
CONFLICT
UNKNOWN
One HTTP success flag is not enough.
5. Outbound Cost¶
5.1 Read selection¶
Required selector hierarchy:
explicit transaction ID
-> exact tenant/outbound relation
-> allowed transaction type/status
A latest-row fallback is compatibility behavior and must be visible in evidence.
5.2 Write effects¶
header insert/update/delete
line insert/update/replace/soft-delete
outbound relation
trade projection change
optional file metadata/link change through separate owner
5.3 Non-implications¶
Cost saved
!= QBO delivered
!= Accounting approved
!= Trade settled
!= File uploaded
6. Packing Rate¶
6.1 Current request¶
Booking ID
+ item IDs
+ requested rate
6.2 Current eligibility¶
same tenant
active item
active order
Sales class
Outbound direction
same Booking
6.3 Required result matrix¶
| Requested item | Result | Required evidence |
|---|---|---|
| eligible and changed | UPDATED |
old/new rate |
| eligible and same | UNCHANGED |
current rate |
| expected old mismatch | STALE |
expected/current |
| wrong tenant/role | DENIED |
safe reason only |
| missing/deleted | NOT_FOUND |
safe identity |
| wrong order/booking/class | INVALID |
stable reason |
The current numeric updated count is insufficient for target parity.
7. Packing Document¶
7.1 Source composition¶
Booking
Sales/Outbound Items
Equipment Loads
Equipment commodity/detail
Rate
browser-only presentation values where present
7.2 Output states¶
SOURCE_READY
SOURCE_PARTIAL
RATE_PENDING
RENDERED
PRINT_DIALOG_OPENED
FILE_STORED — only if separately implemented
EMAIL_ACCEPTED — only if separate mail command proves it
7.3 Recovery¶
When save and print overlap, reread rates and source records, regenerate, then print. Do not treat the previously opened browser document as current evidence.
8. Purchase Local Invoice¶
8.1 Formula authority¶
The report owner must return:
- source quantity/weight;
- UOM;
- rate;
- conversion divisor;
- rounding;
- trucking fee;
- credit;
- total;
- source record identities.
8.2 Current completion¶
formula evaluated + page rendered
= rendered invoice projection
It does not prove a durable invoice record, accounting post, file, or delivery.
9. Booking Confirmation¶
9.1 Inputs¶
Booking
Company/party references
optional Sales reference
template/fixed text
current or source date
branding
9.2 Open decisions¶
- recipient authority;
- reference precedence;
- current date versus business date;
- tenant-specific template ownership;
- snapshot/file/email retention;
- direct-page role parity.
10. Sales Weight Ticket¶
10.1 Order-derived branch¶
Sales/Outbound rows
-> derived weight ticket output
Evidence label:
ORDER_DERIVED
10.2 Physical branch¶
T_SCALE_TICKET identity
+ physical measurement state
-> physical ticket output
Evidence label:
PHYSICAL_SCALE
The two branches must never share an unlabeled completion statement.
11. Access Matrix Inputs¶
| Action | Current access input to verify |
|---|---|
| View Trade | page/menu/module/record disclosure |
| Export CSV | same read scope plus bounded data export |
| Export Brokerage preview | read access to every proposed child source |
| Export Brokerage create/cancel | named action role plus all child state predicates |
| Cost write | finance/office action role plus exact transaction/outbound state |
| Packing Rate write | current numeric route roles versus approved role bundle |
| Document render/print | source read role and sensitive-field disclosure |
| Physical Weight Ticket | physical scale record access |
12. Current Evidence Result¶
Static caller/effect matrix:
COMPLETE FOR NAMED CAPABILITIES
Current environment rows:
NOT READ
Current authenticated behavior:
NOT RUN
Current print/file/mail/provider evidence:
NOT RUN
Accepted current role policy:
OPEN
M3 / M4:
NO / NO
---¶
Source:
docs/processes/MK_TRADE_CURRENT_CALLER_EFFECT_AND_OUTPUT_MATRIX_2026-08-09.md— ctc repository · This page is an English translation of the source document. Identifiers, file paths and code symbols are unchanged.