Browse Source

Committing a comment I forgot to commit

Kenric Nugteren 6 days ago
parent
commit
1897cbd116
1 changed files with 4 additions and 0 deletions
  1. 4 0
      prs.stores/StockMovementStore.cs

+ 4 - 0
prs.stores/StockMovementStore.cs

@@ -71,10 +71,14 @@ public class StockMovementStore : BaseStore<StockMovement>
 
     protected override void AfterSave(IEnumerable<StockMovement> entities)
     {
+        // Find all movements that weren't loaded in BeforeSave - i.e., they are new stock movements.
         var newIDs = entities.Select(x => x.ID).Where(x => !currentIDs.Contains(x)).ToArray();
+        // Grab the data for these movements.
         var newMvts = StockHoldingStore.LoadMovementData(this, newIDs);
+        // Load all the stock holdings for these movements, but only if we haven't loaded them already.
         StockHoldingStore.LoadStockHoldings(this, newMvts, holdingData);
 
+        // Add the new movement data to our data. Note that the above line does the same for holdings.
         mvtData = mvtData.Concatenate(newMvts);
         
         // Update the Relevant StockHolding with the details of this movement