Add movement retrieval and update functionality to stock

This commit is contained in:
2026-09-08 13:16:04 +05:30
parent f5872cedaf
commit 7e362be304
5 changed files with 146 additions and 21 deletions
+12 -3
View File
@@ -12,7 +12,8 @@ public record StockBalanceResponse(
Guid LocationId,
LocationType LocationType,
decimal Quantity,
DateTime UpdatedAt);
DateTime UpdatedAt,
string LocationName);
public record StockTotalResponse(
Guid ItemId,
@@ -34,7 +35,9 @@ public record StockMovementResponse(
string? ReasonCode,
Guid? ReferenceId,
DateTime CreatedAt,
Guid CreatedBy);
Guid CreatedBy,
string? FromLocationName,
string? ToLocationName);
// Write requests
public record TransferRequest(
@@ -64,4 +67,10 @@ public record AdjustmentRequest(
Guid LocationId,
LocationType LocationType,
decimal Quantity,
string ReasonCode);
string ReasonCode,
// TEMPORARY: required while auth doesn't resolve a logged-in user server-side — see testbug.md #28.
Guid? AdjustedByUserId = null);
// Movements are an immutable ledger — quantity, locations, and type can never change once recorded
// (the running stock balance is the sum of all movements). Only the free-text reason/note is editable.
public record UpdateMovementReasonRequest(string ReasonCode);