Expand description
Repository implementations
Generated by metaphor-schema. Do not edit manually.
Uses backbone-orm’s DatabaseOperations<T> trait.
Re-exports§
pub use procurement_repository::ClaimedMoveRow;pub use procurement_repository::ForecastComponents;pub use procurement_repository::OrderpointComputes;pub use procurement_repository::OrderpointRow;pub use procurement_repository::ProcurementRepository;pub use procurement_repository::RuleRow;pub use stock_reservation_repository::HeldAtWarehouse;pub use stock_reservation_repository::HeldReservation;pub use stock_reservation_repository::ReservationRepoError;pub use stock_reservation_repository::StockReservationRepository;
Modules§
- procurement_
repository - Procurement SQL (hand-authored, user-owned): everything behind the routes/rules/orderpoints
service (
application/service/procurement_service.rs) and the daily scheduler (infrastructure/jobs/run_scheduler.rs). - stock_
reservation_ repository - The stock-reservation ledger’s persistence (hand-written; user-owned).
Structs§
- Adjustment
Move Row - An existing
is_inventorymove addressing a quant grain, as the adjustment door’s mint-once gate reads it. - Batch
Header Row - Header fields of one picking batch (the projection probe surface).
- Batch
Member Row - State of one member picking, as the projection probe reads it.
- BinAvailability
Row - A Bin’s available-to-commit columns.
- BinBalance
Row - A Bin’s running balance — the moving-average state the valuation engine reads and rewrites.
- BinRepository
- Repository for Bin entities.
- BinWarehouse
Availability Row - A Bin’s available-to-commit columns, carrying the warehouse the row came from.
- Delivery
Cancel Header Row - The cancel path’s header projection — everything needed to reverse the outflow and emit the
posting_type='reversal'post. Carries the originalaccounting_post_id(to reverse) and any already-recordedreversal_accounting_post_id(the idempotency/recovery short-circuit). - Delivery
Cancel Item Row - A delivery line as the CANCEL path reads it: the stored
cogs_amountis the exact value the outflow consumed (for the drain-to-zero line, the whole remaining value) — the cancellation restores that exact amount, so the bin reblends to its pre-delivery state. - Delivery
Item Row - A delivery line as the submit path reads it.
idis carried because the movement writes the consumed rate + COGS back onto this exact line. - Delivery
Note Item Repository - Repository for DeliveryNoteItem entities.
- Delivery
Note Repository - Repository for DeliveryNote entities.
- Delivery
Repost Header Row - The repost path’s header projection — rebuilds the SAME envelope from the stored header.
- Delivery
Submit Header Row - The submit path’s header projection — everything needed to drive the movement + the COGS post.
- Filter
Params - Filter parameters
- GlSettlement
State - A voucher’s GL settlement state, as the repost path reads it. Shared by every voucher header projection that carries it — the shape is identical across the three tables.
- GlVoucher
Repository - The GL reconcile’s SQL. Stateless: it holds no pool, because both methods run outside the movement’s transaction — the physical movement is already committed by the time a post is emitted, and the reconcile is deliberately a separate write (the GL leg is eventually consistent).
- Inventory
Company Setting Repository - Repository for InventoryCompanySetting entities.
- Landed
Cost Adjustment Line Repository - Repository for LandedCostAdjustmentLine entities.
- Landed
Cost Line Repository - Repository for LandedCostLine entities.
- Landed
Cost Repository - Repository for LandedCost entities.
- LcHeader
Row - A landed-cost document header, as the validate/cancel verbs read it.
- LcLine
Row - One landed-cost charge line.
- Location
Facts - The location facts a move’s guards and valuation core need: usage (supplier/view/internal/
customer/inventory/production/transit — the routing + reservation rules key off it), and the
warehouse a valuation bin resolves to.
usagedecodes as text like every other enum here. - Location
Repository - Repository for Location entities.
- LotRepository
- Repository for Lot entities.
- Move
Line Row - A move-line row as the engine reads it.
statedecodes as text. - MoveRow
- A move row as the engine reads it.
state/procure_methoddecode as text (the enum lives in the DB; string comparison against the snake_case vocabulary is the module’s proven pattern). - Move
State Row - State of one member move, as the projection probe reads it.
- NewBatch
Row - A batch header insert.
statestarts atdraft; membership writes and move transitions reproject — the stored value is always the projection of the member picking states. - NewDelivery
Item Row - The exact row a delivery line insert writes.
valuation_rate/cogs_amountstart as literal 0s — both are only known once the movement consumes the moving average at submit. - NewDelivery
Row - The exact row a draft Delivery Note header insert writes.
- NewLanded
Cost Row - The draft header a
create_landed_costmints. - NewLc
Line Row - One cost line of a draft landed cost.
- NewMove
Line Row - The exact row a move-line insert writes (the reservation mirror minted by
_action_assign). - NewMove
Row - The exact row a draft move insert writes.
statestartsdraft; the pipeline (_action_confirm/_action_assign/_action_done/_action_cancel) is the only writer of any other state. - NewPicking
Row - A transfer header insert.
statestarts atdraft; member moves are minted through the engine right after, and every mint/transition reprojects — so the stored value is always the projection of the member move states. - NewReceipt
Item Row - The exact row a receipt line insert writes.
amountarrives already rounded. - NewReceipt
Row - The exact row a draft Purchase Receipt header insert writes.
- NewReconciliation
Item Row - The exact row a counted reconciliation line insert writes.
- NewReconciliation
Row - The exact row a Stock Reconciliation header insert writes.
- NewScrap
Row - A scrap order insert.
statestarts atdraft; the done-stamp is the door’s terminal close after the engine validated the move. - NewSle
Row - The exact row an immutable Stock Ledger Entry insert writes.
- NewStock
Entry Item Row - The exact row a transfer line insert writes.
- NewStock
Item Row - The exact row a stock-item registration writes.
- NewTransfer
Row - The exact row a transfer Stock Entry header insert writes.
- NewWarehouse
Row - The exact row a warehouse registration writes.
- NewWorksheet
Row - One worksheet row insert. Rows are written ordered by
move_line_id(the caller sorts) so the last row is a deterministic rounding-diff recipient. - Operation
Type Facts - Facts of an operation type the picking mint/validate needs: the picking code (which GL leg shape its moves post), the reservation posture, the partial-validate backorder policy, the reference prefix its transfer names mint from, and its default shipping policy.
- Operation
Type Repository - Repository for OperationType entities.
- Package
Repository - Repository for Package entities.
- Package
Type Repository - Repository for PackageType entities.
- Paginated
Result - Paginated result wrapper
- Pagination
Info - Pagination
Params - Pagination parameters
- Picking
Batch Projection Repository - The batch mint/membership/probe SQL. Stateless — every method takes the caller’s connection so the header insert, the membership write, and the projection recompute commit as one unit.
- Picking
Batch Repository - Repository for PickingBatch entities.
- Postgres
Repository - PostgreSQL repository implementation with JSON-based dynamic queries
- Posture
Row - The valuation posture, as the settings row stores it. An ABSENT row means the
runtime defaults (
average/perpetual/ anglo off) — exactly the pre-overlay behavior. - Purchase
Receipt Item Repository - Repository for PurchaseReceiptItem entities.
- Purchase
Receipt Repository - Repository for PurchaseReceipt entities.
- Putaway
Rule Repository - Repository for PutawayRule entities.
- Quant
Count Row - A locked quant + its location facts (the guard inputs the service checks).
- Quant
Dims - The dimension tuple that identifies exactly ONE quant row: item x location x lot x package x
owner (spec §3). NULL dimensions are matched with
IS NOT DISTINCT FROM— the table’s unique index treats NULLs as distinct, so NULL-dimension dedup is the ENGINE’s responsibility (stock.hook.yaml R12), carried by the advisory lock + insert-guard below. - Quant
OnHand Row - On-hand aggregation at one location — the
available = quantity - reservedREAD (T2), summed over the location’s quant grain. Pool-based (each read its own unit of work), riding the ambient org scope like every read in the suite. - Quant
Repository - Repository for Quant entities.
- Quant
Row - A quant row as the reservation engine sees it.
- Receipt
Cancel Header Row - The cancel path’s header projection — everything needed to reverse the inflow and emit the
posting_type='reversal'post. Carries the originalaccounting_post_id(to reverse) and any already-recordedreversal_accounting_post_id(the idempotency/recovery short-circuit). - Receipt
Item Row - A receipt line as the submit path reads it: what arrived, and at what cost.
- Receipt
Repost Header Row - The repost path’s header projection — rebuilds the SAME envelope from the stored header, never re-touching the SLE/Bin (the physical movement already happened).
- Receipt
Submit Header Row - The submit path’s header projection — everything needed to drive the movement + the asset post.
- Recon
Repost Header Row - The repost path’s header projection — rebuilds the SAME value-diff envelope from the stored
header, never re-touching the SLE/Bin (the physical movement already happened). Mirrors the
receipt/delivery repost headers (council 2026-07-29, parking-lot item:
repost_reconciliation). - Reordering
Rule Repository - Repository for ReorderingRule entities.
- Route
Repository - Repository for Route entities.
- Route
Rule Repository - Repository for RouteRule entities.
- Scrap
Door Repository - The scrap door’s mint/probe/close SQL. Stateless — every method takes the caller’s connection so the header insert and the later done-stamp run under the caller’s scope.
- Scrap
Reason TagRepository - Repository for ScrapReasonTag entities.
- Scrap
Repository - Repository for Scrap entities.
- Scrap
Row - The scrap probe surface: the header as the door reads it back.
- Sort
Params - Sorting parameters
- Staged
Count Row - One row of the pending-count worklist (the staged counts at a location).
- Stock
Adjustment Repository - The quant staging/apply SQL. Stateless; every method takes the caller’s connection.
- Stock
Entry Item Repository - Repository for StockEntryItem entities.
- Stock
Entry Repository - Repository for StockEntry entities.
- Stock
Item Repository - Repository for StockItem entities.
- Stock
Ledger Entry Repository - Repository for StockLedgerEntry entities.
- Stock
Move Line Repository - Repository for StockMoveLine entities.
- Stock
Move Repository - Repository for StockMove entities.
- Stock
Picking Repository - The picking mint/probe/heal SQL. Stateless — every method takes the caller’s connection so the header, its moves, and the projection commit as one unit (moves themselves are minted through the engine’s own guarded transactions).
- Stock
Reconciliation Item Repository - Repository for StockReconciliationItem entities.
- Stock
Reconciliation Repository - Repository for StockReconciliation entities.
- Storage
Category Capacity Repository - Repository for StorageCategoryCapacity entities.
- Storage
Category Repository - Repository for StorageCategory entities.
- Transfer
Header Row - Header fields of one transfer (the projection probe surface).
- Transfer
Repository - Repository for Transfer entities.
- Valuation
Overlay Repository - Hand-owned SQL for the valuation overlay. Stateless (methods take the caller’s connection or
run scoped on the pool), mirroring
super::GlVoucherRepository. - Warehouse
Repository - Repository for Warehouse entities.
- Worksheet
Row - One transient allocation-worksheet row, as the recompute writes it and tests read it back.
Enums§
- Filter
Condition - GlVoucher
- Which voucher table a GL post reconciles against. A closed enum, so the interpolated table name can only ever be one of a few compile-time literals.
- Quant
Selector - How a count addresses a quant: by id, or by the (item, location) pair with all optional dimensions NULL — the bin-compatible quant grain.
- Sort
Direction
Traits§
- Database
Operations - Database operations trait - requires Serialize for write operations