test(fleet): resolve raw position ownership through its balance
This commit is contained in:
@@ -152,6 +152,8 @@ function model(fault = '') {
|
||||
assert.equal(scope.marker, context.marker); assert.equal(scope.warehouseId, options.warehouseId)
|
||||
const facts = stock(transfers.find(row => row.customerId === scope.customerId))
|
||||
const raw = { scope: { ...scope, coverage: 'CUSTOMER_WAREHOUSE_COMPLETE' }, balances: [facts.balance], positions: facts.positions, ledger: facts.ledger }
|
||||
// The physical position table links to its inbound through balance_id; only the public joined DTO has inboundCode.
|
||||
for (const position of raw.positions) delete position.inboundCode
|
||||
if (fault === 'wrong raw scope') raw.scope.marker = 'OLD'
|
||||
if (fault === 'wrong raw ledger position') raw.ledger[0].positionId = 'OTHER'
|
||||
if (fault === 'wrong raw ledger balance') raw.ledger[0].balanceId = 'OTHER'
|
||||
|
||||
Reference in New Issue
Block a user