Fix seed stock movement external locations in migrations
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using Distribution.Features.Stock;
|
||||||
using Distribution.Models;
|
using Distribution.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
@@ -80,9 +81,9 @@ public static class OperationsExtrasSeed
|
|||||||
);
|
);
|
||||||
|
|
||||||
modelBuilder.Entity<StockMovement>().HasData(
|
modelBuilder.Entity<StockMovement>().HasData(
|
||||||
new StockMovement { Id = StockMovement1Id, FK_ItemId = MasterDataSeed.Coke500ItemId, FromLocationId = null, FromLocationType = null, ToLocationId = MasterDataSeed.ColomboWarehouseId, ToLocationType = LocationType.Warehouse, Quantity = 200m, Type = MovementType.PurchaseReceipt, ReasonCode = null, ReferenceId = ProcurementSeed.GoodsReceipt1Id, CreatedAt = new DateTime(2026, 8, 15), CreatedBy = MasterDataSeed.Supervisor1UserId },
|
new StockMovement { Id = StockMovement1Id, FK_ItemId = MasterDataSeed.Coke500ItemId, FromLocationId = StockService.ExternalLocationId, FromLocationType = LocationType.External, ToLocationId = MasterDataSeed.ColomboWarehouseId, ToLocationType = LocationType.Warehouse, Quantity = 200m, Type = MovementType.PurchaseReceipt, ReasonCode = null, ReferenceId = ProcurementSeed.GoodsReceipt1Id, CreatedAt = new DateTime(2026, 8, 15), CreatedBy = MasterDataSeed.Supervisor1UserId },
|
||||||
new StockMovement { Id = StockMovement2Id, FK_ItemId = MasterDataSeed.Coke500ItemId, FromLocationId = MasterDataSeed.ColomboWarehouseId, FromLocationType = LocationType.Warehouse, ToLocationId = MasterDataSeed.VanVehicleId, ToLocationType = LocationType.Vehicle, Quantity = 50m, Type = MovementType.Load, ReasonCode = null, ReferenceId = OperationsDataSeed.LoadingSheet1Id, CreatedAt = new DateTime(2026, 8, 25, 7, 30, 0), CreatedBy = MasterDataSeed.Supervisor1UserId },
|
new StockMovement { Id = StockMovement2Id, FK_ItemId = MasterDataSeed.Coke500ItemId, FromLocationId = MasterDataSeed.ColomboWarehouseId, FromLocationType = LocationType.Warehouse, ToLocationId = MasterDataSeed.VanVehicleId, ToLocationType = LocationType.Vehicle, Quantity = 50m, Type = MovementType.Load, ReasonCode = null, ReferenceId = OperationsDataSeed.LoadingSheet1Id, CreatedAt = new DateTime(2026, 8, 25, 7, 30, 0), CreatedBy = MasterDataSeed.Supervisor1UserId },
|
||||||
new StockMovement { Id = StockMovement3Id, FK_ItemId = MasterDataSeed.Coke500ItemId, FromLocationId = MasterDataSeed.VanVehicleId, FromLocationType = LocationType.Vehicle, ToLocationId = null, ToLocationType = null, Quantity = 30m, Type = MovementType.Sale, ReasonCode = null, ReferenceId = OperationsDataSeed.Sale1Id, CreatedAt = new DateTime(2026, 8, 25, 9, 30, 0), CreatedBy = MasterDataSeed.SalesRep1UserId }
|
new StockMovement { Id = StockMovement3Id, FK_ItemId = MasterDataSeed.Coke500ItemId, FromLocationId = MasterDataSeed.VanVehicleId, FromLocationType = LocationType.Vehicle, ToLocationId = StockService.ExternalLocationId, ToLocationType = LocationType.External, Quantity = 30m, Type = MovementType.Sale, ReasonCode = null, ReferenceId = OperationsDataSeed.Sale1Id, CreatedAt = new DateTime(2026, 8, 25, 9, 30, 0), CreatedBy = MasterDataSeed.SalesRep1UserId }
|
||||||
);
|
);
|
||||||
|
|
||||||
modelBuilder.Entity<StoreKycDocument>().HasData(
|
modelBuilder.Entity<StoreKycDocument>().HasData(
|
||||||
|
|||||||
+4051
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,47 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Distribution.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class FixSeedStockMovementExternalLocations : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "StockMovements",
|
||||||
|
keyColumn: "Id",
|
||||||
|
keyValue: new Guid("62000000-0000-0000-0000-000000000001"),
|
||||||
|
columns: new[] { "FromLocationId", "FromLocationType" },
|
||||||
|
values: new object[] { new Guid("00000000-0000-0000-0000-000000000000"), 2 });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "StockMovements",
|
||||||
|
keyColumn: "Id",
|
||||||
|
keyValue: new Guid("62000000-0000-0000-0000-000000000003"),
|
||||||
|
columns: new[] { "ToLocationId", "ToLocationType" },
|
||||||
|
values: new object[] { new Guid("00000000-0000-0000-0000-000000000000"), 2 });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "StockMovements",
|
||||||
|
keyColumn: "Id",
|
||||||
|
keyValue: new Guid("62000000-0000-0000-0000-000000000001"),
|
||||||
|
columns: new[] { "FromLocationId", "FromLocationType" },
|
||||||
|
values: new object[] { null, null });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "StockMovements",
|
||||||
|
keyColumn: "Id",
|
||||||
|
keyValue: new Guid("62000000-0000-0000-0000-000000000003"),
|
||||||
|
columns: new[] { "ToLocationId", "ToLocationType" },
|
||||||
|
values: new object[] { null, null });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2299,6 +2299,8 @@ namespace Distribution.Migrations
|
|||||||
CreatedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
CreatedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||||
CreatedBy = new Guid("29000000-0000-0000-0000-000000000001"),
|
CreatedBy = new Guid("29000000-0000-0000-0000-000000000001"),
|
||||||
FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"),
|
FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"),
|
||||||
|
FromLocationId = new Guid("00000000-0000-0000-0000-000000000000"),
|
||||||
|
FromLocationType = 2,
|
||||||
Quantity = 200m,
|
Quantity = 200m,
|
||||||
ReferenceId = new Guid("43000000-0000-0000-0000-000000000001"),
|
ReferenceId = new Guid("43000000-0000-0000-0000-000000000001"),
|
||||||
ToLocationId = new Guid("27000000-0000-0000-0000-000000000001"),
|
ToLocationId = new Guid("27000000-0000-0000-0000-000000000001"),
|
||||||
@@ -2329,6 +2331,8 @@ namespace Distribution.Migrations
|
|||||||
FromLocationType = 1,
|
FromLocationType = 1,
|
||||||
Quantity = 30m,
|
Quantity = 30m,
|
||||||
ReferenceId = new Guid("32000000-0000-0000-0000-000000000001"),
|
ReferenceId = new Guid("32000000-0000-0000-0000-000000000001"),
|
||||||
|
ToLocationId = new Guid("00000000-0000-0000-0000-000000000000"),
|
||||||
|
ToLocationType = 2,
|
||||||
Type = 0
|
Type = 0
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user