This commit is contained in:
2025-07-09 15:05:10 +01:00
parent c0f7f1a476
commit eb959dd6e2
15 changed files with 704 additions and 836 deletions

View File

@@ -21,15 +21,14 @@ namespace bnhtrade.Core.Logic.Inventory
{
throw new ArgumentException("Stock journal ID must be greater than zero", nameof(stockJournalId));
}
bool result = uow.StockJournalRepository.DeleteStockJournal(stockJournalId);
uow.StockJournalRepository.StockJournalDelete(stockJournalId);
CommitIfOwned(uow);
if (!result)
{
throw new InvalidOperationException($"Failed to delete stock journal with ID {stockJournalId}");
}
});
}
// can be used before commiting an sql insert, update or delete to the stock journal to ensure a status does not fall below 0
// (unless the status is enabled to do so)
// set empty list or statusIdEffected to null to check entier stock entries for consistency
public bool WIP_StockJournalConsistencyCheck(int stockId, List<int> statusIdEffected = null)
{
return WithUnitOfWork(uow =>