stock_ledger completed need to test

This commit is contained in:
Kalana B. Thilakarathna
2026-08-20 09:42:33 +05:30
parent aa7ea37ab6
commit f95fda3806
37 changed files with 1976 additions and 5805 deletions
+1
View File
@@ -4,5 +4,6 @@ namespace Distribution.Models
{
public string Name { get; set; }
public int? ExternalErpId { get; set; }
public bool AllowCustomerReturn { get; set; } = false;
}
}
+13
View File
@@ -0,0 +1,13 @@
namespace Distribution.Models
{
public enum LocationType { Warehouse, Vehicle }
public enum MovementType
{
Sale,
CustomerReturn,
Transfer,
Damage,
Adjustment
}
}
+19
View File
@@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace Distribution.Models
{
public class StockBalance
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid FK_ItemId { get; set; }
[ForeignKey("FK_ItemId")]
public Item Item { get; set; }
public Guid LocationId { get; set; }
public LocationType LocationType { get; set; }
public decimal Quantity { get; set; }
public DateTime UpdatedAt { get; set; } = DateTime.Now;
}
}
+28
View File
@@ -0,0 +1,28 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace Distribution.Models
{
public class StockMovement
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid FK_ItemId { get; set; }
[ForeignKey("FK_ItemId")]
public Item Item { get; set; }
public Guid? FromLocationId { get; set; }
public LocationType? FromLocationType { get; set; }
public Guid? ToLocationId { get; set; }
public LocationType? ToLocationType { get; set; }
public decimal Quantity { get; set; }
public MovementType Type { get; set; }
public string? ReasonCode { get; set; }
public Guid? ReferenceId { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.Now;
public Guid CreatedBy { get; set; }
}
}