Skip to main content

Module persistence

Module persistence 

Source
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§

AdjustmentMoveRow
An existing is_inventory move addressing a quant grain, as the adjustment door’s mint-once gate reads it.
BatchHeaderRow
Header fields of one picking batch (the projection probe surface).
BatchMemberRow
State of one member picking, as the projection probe reads it.
BinAvailabilityRow
A Bin’s available-to-commit columns.
BinBalanceRow
A Bin’s running balance — the moving-average state the valuation engine reads and rewrites.
BinRepository
Repository for Bin entities.
BinWarehouseAvailabilityRow
A Bin’s available-to-commit columns, carrying the warehouse the row came from.
DeliveryCancelHeaderRow
The cancel path’s header projection — everything needed to reverse the outflow and emit the posting_type='reversal' post. Carries the original accounting_post_id (to reverse) and any already-recorded reversal_accounting_post_id (the idempotency/recovery short-circuit).
DeliveryCancelItemRow
A delivery line as the CANCEL path reads it: the stored cogs_amount is 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.
DeliveryItemRow
A delivery line as the submit path reads it. id is carried because the movement writes the consumed rate + COGS back onto this exact line.
DeliveryNoteItemRepository
Repository for DeliveryNoteItem entities.
DeliveryNoteRepository
Repository for DeliveryNote entities.
DeliveryRepostHeaderRow
The repost path’s header projection — rebuilds the SAME envelope from the stored header.
DeliverySubmitHeaderRow
The submit path’s header projection — everything needed to drive the movement + the COGS post.
FilterParams
Filter parameters
GlSettlementState
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.
GlVoucherRepository
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).
InventoryCompanySettingRepository
Repository for InventoryCompanySetting entities.
LandedCostAdjustmentLineRepository
Repository for LandedCostAdjustmentLine entities.
LandedCostLineRepository
Repository for LandedCostLine entities.
LandedCostRepository
Repository for LandedCost entities.
LcHeaderRow
A landed-cost document header, as the validate/cancel verbs read it.
LcLineRow
One landed-cost charge line.
LocationFacts
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. usage decodes as text like every other enum here.
LocationRepository
Repository for Location entities.
LotRepository
Repository for Lot entities.
MoveLineRow
A move-line row as the engine reads it. state decodes as text.
MoveRow
A move row as the engine reads it. state / procure_method decode as text (the enum lives in the DB; string comparison against the snake_case vocabulary is the module’s proven pattern).
MoveStateRow
State of one member move, as the projection probe reads it.
NewBatchRow
A batch header insert. state starts at draft; membership writes and move transitions reproject — the stored value is always the projection of the member picking states.
NewDeliveryItemRow
The exact row a delivery line insert writes. valuation_rate/cogs_amount start as literal 0s — both are only known once the movement consumes the moving average at submit.
NewDeliveryRow
The exact row a draft Delivery Note header insert writes.
NewLandedCostRow
The draft header a create_landed_cost mints.
NewLcLineRow
One cost line of a draft landed cost.
NewMoveLineRow
The exact row a move-line insert writes (the reservation mirror minted by _action_assign).
NewMoveRow
The exact row a draft move insert writes. state starts draft; the pipeline (_action_confirm / _action_assign / _action_done / _action_cancel) is the only writer of any other state.
NewPickingRow
A transfer header insert. state starts at draft; 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.
NewReceiptItemRow
The exact row a receipt line insert writes. amount arrives already rounded.
NewReceiptRow
The exact row a draft Purchase Receipt header insert writes.
NewReconciliationItemRow
The exact row a counted reconciliation line insert writes.
NewReconciliationRow
The exact row a Stock Reconciliation header insert writes.
NewScrapRow
A scrap order insert. state starts at draft; the done-stamp is the door’s terminal close after the engine validated the move.
NewSleRow
The exact row an immutable Stock Ledger Entry insert writes.
NewStockEntryItemRow
The exact row a transfer line insert writes.
NewStockItemRow
The exact row a stock-item registration writes.
NewTransferRow
The exact row a transfer Stock Entry header insert writes.
NewWarehouseRow
The exact row a warehouse registration writes.
NewWorksheetRow
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.
OperationTypeFacts
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.
OperationTypeRepository
Repository for OperationType entities.
PackageRepository
Repository for Package entities.
PackageTypeRepository
Repository for PackageType entities.
PaginatedResult
Paginated result wrapper
PaginationInfo
PaginationParams
Pagination parameters
PickingBatchProjectionRepository
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.
PickingBatchRepository
Repository for PickingBatch entities.
PostgresRepository
PostgreSQL repository implementation with JSON-based dynamic queries
PostureRow
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.
PurchaseReceiptItemRepository
Repository for PurchaseReceiptItem entities.
PurchaseReceiptRepository
Repository for PurchaseReceipt entities.
PutawayRuleRepository
Repository for PutawayRule entities.
QuantCountRow
A locked quant + its location facts (the guard inputs the service checks).
QuantDims
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.
QuantOnHandRow
On-hand aggregation at one location — the available = quantity - reserved READ (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.
QuantRepository
Repository for Quant entities.
QuantRow
A quant row as the reservation engine sees it.
ReceiptCancelHeaderRow
The cancel path’s header projection — everything needed to reverse the inflow and emit the posting_type='reversal' post. Carries the original accounting_post_id (to reverse) and any already-recorded reversal_accounting_post_id (the idempotency/recovery short-circuit).
ReceiptItemRow
A receipt line as the submit path reads it: what arrived, and at what cost.
ReceiptRepostHeaderRow
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).
ReceiptSubmitHeaderRow
The submit path’s header projection — everything needed to drive the movement + the asset post.
ReconRepostHeaderRow
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).
ReorderingRuleRepository
Repository for ReorderingRule entities.
RouteRepository
Repository for Route entities.
RouteRuleRepository
Repository for RouteRule entities.
ScrapDoorRepository
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.
ScrapReasonTagRepository
Repository for ScrapReasonTag entities.
ScrapRepository
Repository for Scrap entities.
ScrapRow
The scrap probe surface: the header as the door reads it back.
SortParams
Sorting parameters
StagedCountRow
One row of the pending-count worklist (the staged counts at a location).
StockAdjustmentRepository
The quant staging/apply SQL. Stateless; every method takes the caller’s connection.
StockEntryItemRepository
Repository for StockEntryItem entities.
StockEntryRepository
Repository for StockEntry entities.
StockItemRepository
Repository for StockItem entities.
StockLedgerEntryRepository
Repository for StockLedgerEntry entities.
StockMoveLineRepository
Repository for StockMoveLine entities.
StockMoveRepository
Repository for StockMove entities.
StockPickingRepository
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).
StockReconciliationItemRepository
Repository for StockReconciliationItem entities.
StockReconciliationRepository
Repository for StockReconciliation entities.
StorageCategoryCapacityRepository
Repository for StorageCategoryCapacity entities.
StorageCategoryRepository
Repository for StorageCategory entities.
TransferHeaderRow
Header fields of one transfer (the projection probe surface).
TransferRepository
Repository for Transfer entities.
ValuationOverlayRepository
Hand-owned SQL for the valuation overlay. Stateless (methods take the caller’s connection or run scoped on the pool), mirroring super::GlVoucherRepository.
WarehouseRepository
Repository for Warehouse entities.
WorksheetRow
One transient allocation-worksheet row, as the recompute writes it and tests read it back.

Enums§

FilterCondition
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.
QuantSelector
How a count addresses a quant: by id, or by the (item, location) pair with all optional dimensions NULL — the bin-compatible quant grain.
SortDirection

Traits§

DatabaseOperations
Database operations trait - requires Serialize for write operations