update the migrations

This commit is contained in:
2026-09-24 17:24:43 +05:30
parent e8692b2474
commit 75b0a802c3
11 changed files with 12620 additions and 87 deletions
-1
View File
@@ -31,7 +31,6 @@ public class AppDBContext(DbContextOptions<AppDBContext> options) : DbContext(op
public DbSet<UserStoreScope> UserStoreScopes { get; set; } public DbSet<UserStoreScope> UserStoreScopes { get; set; }
public DbSet<StockBalance> StockBalances { get; set; } public DbSet<StockBalance> StockBalances { get; set; }
public DbSet<StockMovement> StockMovements { get; set; } public DbSet<StockMovement> StockMovements { get; set; }
public DbSet<StoreKycDocument> StoreKycDocuments { get; set; }
public DbSet<PriceList> PriceLists { get; set; } public DbSet<PriceList> PriceLists { get; set; }
public DbSet<PriceListItem> PriceListItems { get; set; } public DbSet<PriceListItem> PriceListItems { get; set; }
public DbSet<Supplier> Suppliers { get; set; } public DbSet<Supplier> Suppliers { get; set; }
@@ -21,7 +21,10 @@ public record LoadingSheetItemResponse(
Guid FK_WarehouseId, Guid FK_WarehouseId,
string WarehouseName, string WarehouseName,
decimal QuantityDispatched, decimal QuantityDispatched,
Guid? FK_ShopPOItemId); Guid? FK_ShopPOItemId,
Guid? ShopPOId = null,
Guid? StoreId = null,
string? StoreName = null);
public record LoadingSheetOrderResponse(Guid ShopPOId); public record LoadingSheetOrderResponse(Guid ShopPOId);
@@ -10,6 +10,7 @@ public class LoadingSheetRepository(AppDBContext context) : ILoadingSheetReposit
await context.LoadingSheets await context.LoadingSheets
.Include(s => s.Items).ThenInclude(i => i.Item) .Include(s => s.Items).ThenInclude(i => i.Item)
.Include(s => s.Items).ThenInclude(i => i.Warehouse) .Include(s => s.Items).ThenInclude(i => i.Warehouse)
.Include(s => s.Items).ThenInclude(i => i.ShopPOItem).ThenInclude(p => p!.ShopPO).ThenInclude(p => p.Store)
.Include(s => s.Orders) .Include(s => s.Orders)
.FirstOrDefaultAsync(s => s.Id == id); .FirstOrDefaultAsync(s => s.Id == id);
@@ -21,6 +22,7 @@ public class LoadingSheetRepository(AppDBContext context) : ILoadingSheetReposit
await context.LoadingSheets await context.LoadingSheets
.Include(s => s.Items).ThenInclude(i => i.Item) .Include(s => s.Items).ThenInclude(i => i.Item)
.Include(s => s.Items).ThenInclude(i => i.Warehouse) .Include(s => s.Items).ThenInclude(i => i.Warehouse)
.Include(s => s.Items).ThenInclude(i => i.ShopPOItem).ThenInclude(p => p!.ShopPO).ThenInclude(p => p.Store)
.Include(s => s.Orders) .Include(s => s.Orders)
.Where(s => .Where(s =>
(rideId == null || s.FK_RideId == rideId) && (rideId == null || s.FK_RideId == rideId) &&
@@ -148,28 +148,39 @@ public class LoadingSheetService(
private async Task ApplyLoadMovementsAsync(Guid sheetId, Guid vehicleId, List<LoadingSheetItem> items, Guid userId) private async Task ApplyLoadMovementsAsync(Guid sheetId, Guid vehicleId, List<LoadingSheetItem> items, Guid userId)
{ {
// Vehicle balances created during this confirm are only tracked, not yet saved, so a
// later row for the same item would not find them via the repository and would try to
// insert a duplicate (item, vehicle) balance.
var createdVehicleBalances = new Dictionary<Guid, StockBalance>();
foreach (var item in items.Where(i => i.QuantityDispatched > 0)) foreach (var item in items.Where(i => i.QuantityDispatched > 0))
{ {
var warehouseBalance = await stockRepo.GetBalanceAsync(item.FK_ItemId, item.FK_WarehouseId) var warehouseBalance = await stockRepo.GetBalanceAsync(item.FK_ItemId, item.FK_WarehouseId)
?? throw new InvalidOperationException($"No stock found in warehouse for item {item.FK_ItemId}"); ?? throw new InvalidOperationException(
$"No stock found for '{item.Item?.Name ?? item.FK_ItemId.ToString()}' in warehouse '{item.Warehouse?.Name ?? item.FK_WarehouseId.ToString()}'");
if (warehouseBalance.Quantity < item.QuantityDispatched) if (warehouseBalance.Quantity < item.QuantityDispatched)
throw new InvalidOperationException($"Insufficient warehouse stock for item {item.FK_ItemId}"); throw new InvalidOperationException(
$"Insufficient stock for '{item.Item?.Name ?? item.FK_ItemId.ToString()}' in warehouse '{item.Warehouse?.Name ?? item.FK_WarehouseId.ToString()}' " +
$"(available {warehouseBalance.Quantity}, needed {item.QuantityDispatched})");
warehouseBalance.Quantity -= item.QuantityDispatched; warehouseBalance.Quantity -= item.QuantityDispatched;
warehouseBalance.UpdatedAt = DateTime.Now; warehouseBalance.UpdatedAt = DateTime.Now;
stockRepo.UpdateBalance(warehouseBalance); stockRepo.UpdateBalance(warehouseBalance);
var vehicleBalance = await stockRepo.GetBalanceAsync(item.FK_ItemId, vehicleId); var vehicleBalance = createdVehicleBalances.GetValueOrDefault(item.FK_ItemId)
?? await stockRepo.GetBalanceAsync(item.FK_ItemId, vehicleId);
if (vehicleBalance is null) if (vehicleBalance is null)
{ {
await stockRepo.AddBalanceAsync(new StockBalance var created = new StockBalance
{ {
FK_ItemId = item.FK_ItemId, FK_ItemId = item.FK_ItemId,
LocationId = vehicleId, LocationId = vehicleId,
LocationType = LocationType.Vehicle, LocationType = LocationType.Vehicle,
Quantity = item.QuantityDispatched Quantity = item.QuantityDispatched
}); };
createdVehicleBalances[item.FK_ItemId] = created;
await stockRepo.AddBalanceAsync(created);
} }
else else
{ {
@@ -199,6 +210,9 @@ public class LoadingSheetService(
s.Items.Select(i => new LoadingSheetItemResponse( s.Items.Select(i => new LoadingSheetItemResponse(
i.Id, i.FK_ItemId, i.Item?.Name ?? string.Empty, i.Id, i.FK_ItemId, i.Item?.Name ?? string.Empty,
i.FK_WarehouseId, i.Warehouse?.Name ?? string.Empty, i.FK_WarehouseId, i.Warehouse?.Name ?? string.Empty,
i.QuantityDispatched, i.FK_ShopPOItemId)).ToList(), i.QuantityDispatched, i.FK_ShopPOItemId,
i.ShopPOItem?.FK_ShopPOId,
i.ShopPOItem?.ShopPO?.FK_StoreId,
i.ShopPOItem?.ShopPO?.Store?.StoreName)).ToList(),
s.Orders.Select(o => new LoadingSheetOrderResponse(o.FK_ShopPOId)).ToList()); s.Orders.Select(o => new LoadingSheetOrderResponse(o.FK_ShopPOId)).ToList());
} }
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,72 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Distribution.Migrations
{
/// <inheritdoc />
public partial class AddShopPOCancelInfo : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "CancelReason",
table: "ShopPOs",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<DateTime>(
name: "CancelledAt",
table: "ShopPOs",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "CancelledBy",
table: "ShopPOs",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "ShopPOs",
keyColumn: "Id",
keyValue: new Guid("33000000-0000-0000-0000-000000000001"),
columns: new[] { "CancelReason", "CancelledAt", "CancelledBy" },
values: new object[] { null, null, null });
migrationBuilder.UpdateData(
table: "ShopPOs",
keyColumn: "Id",
keyValue: new Guid("33000000-0000-0000-0000-000000000002"),
columns: new[] { "CancelReason", "CancelledAt", "CancelledBy" },
values: new object[] { null, null, null });
migrationBuilder.UpdateData(
table: "ShopPOs",
keyColumn: "Id",
keyValue: new Guid("33000000-0000-0000-0000-000000000003"),
columns: new[] { "CancelReason", "CancelledAt", "CancelledBy" },
values: new object[] { null, null, null });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CancelReason",
table: "ShopPOs");
migrationBuilder.DropColumn(
name: "CancelledAt",
table: "ShopPOs");
migrationBuilder.DropColumn(
name: "CancelledBy",
table: "ShopPOs");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,100 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Distribution.Migrations
{
/// <inheritdoc />
public partial class AddStoreContactNumberAndNullableOwner : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "OwnerName",
table: "Stores",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "ContactNumber",
table: "Stores",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000001"),
column: "ContactNumber",
value: null);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000002"),
column: "ContactNumber",
value: null);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000003"),
column: "ContactNumber",
value: null);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000004"),
column: "ContactNumber",
value: null);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000005"),
column: "ContactNumber",
value: null);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000006"),
column: "ContactNumber",
value: null);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ContactNumber",
table: "Stores");
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "OwnerName",
keyValue: null,
column: "OwnerName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "OwnerName",
table: "Stores",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,191 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Distribution.Migrations
{
/// <inheritdoc />
public partial class RouteOptionalFieldsAndStoreContactNumber : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "StoreKycDocuments");
migrationBuilder.DropColumn(
name: "KycStatus",
table: "Stores");
migrationBuilder.AlterColumn<string>(
name: "StartPoint",
table: "Routes",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<decimal>(
name: "Length",
table: "Routes",
type: "decimal(65,30)",
nullable: true,
oldClrType: typeof(decimal),
oldType: "decimal(65,30)");
migrationBuilder.AlterColumn<string>(
name: "EndPoint",
table: "Routes",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "KycStatus",
table: "Stores",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.UpdateData(
table: "Routes",
keyColumn: "StartPoint",
keyValue: null,
column: "StartPoint",
value: "");
migrationBuilder.AlterColumn<string>(
name: "StartPoint",
table: "Routes",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<decimal>(
name: "Length",
table: "Routes",
type: "decimal(65,30)",
nullable: false,
defaultValue: 0m,
oldClrType: typeof(decimal),
oldType: "decimal(65,30)",
oldNullable: true);
migrationBuilder.UpdateData(
table: "Routes",
keyColumn: "EndPoint",
keyValue: null,
column: "EndPoint",
value: "");
migrationBuilder.AlterColumn<string>(
name: "EndPoint",
table: "Routes",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "StoreKycDocuments",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FK_StoreId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
DocumentType = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FileReference = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
UploadedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StoreKycDocuments", x => x.Id);
table.ForeignKey(
name: "FK_StoreKycDocuments_Stores_FK_StoreId",
column: x => x.FK_StoreId,
principalTable: "Stores",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "StoreKycDocuments",
columns: new[] { "Id", "CreatedAt", "DocumentType", "FK_StoreId", "FileReference", "IsActive", "UploadedAt" },
values: new object[,]
{
{ new Guid("63000000-0000-0000-0000-000000000001"), new DateTime(2026, 8, 10, 0, 0, 0, 0, DateTimeKind.Unspecified), "Business Registration", new Guid("26000000-0000-0000-0000-000000000001"), "seed/kyc/fort-mini-mart-brc.pdf", true, new DateTime(2026, 8, 10, 0, 0, 0, 0, DateTimeKind.Unspecified) },
{ new Guid("63000000-0000-0000-0000-000000000002"), new DateTime(2026, 8, 12, 0, 0, 0, 0, DateTimeKind.Unspecified), "NIC", new Guid("26000000-0000-0000-0000-000000000003"), "seed/kyc/wattala-owner-nic.pdf", true, new DateTime(2026, 8, 12, 0, 0, 0, 0, DateTimeKind.Unspecified) }
});
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000001"),
column: "KycStatus",
value: 1);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000002"),
column: "KycStatus",
value: 1);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000003"),
column: "KycStatus",
value: 0);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000004"),
column: "KycStatus",
value: 0);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000005"),
column: "KycStatus",
value: 1);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000006"),
column: "KycStatus",
value: 0);
migrationBuilder.CreateIndex(
name: "IX_StoreKycDocuments_FK_StoreId",
table: "StoreKycDocuments",
column: "FK_StoreId");
}
}
}
@@ -1586,7 +1586,6 @@ namespace Distribution.Migrations
.HasColumnType("datetime(6)"); .HasColumnType("datetime(6)");
b.Property<string>("EndPoint") b.Property<string>("EndPoint")
.IsRequired()
.HasColumnType("longtext"); .HasColumnType("longtext");
b.Property<Guid?>("FK_OwnerUserId") b.Property<Guid?>("FK_OwnerUserId")
@@ -1598,7 +1597,7 @@ namespace Distribution.Migrations
b.Property<bool>("IsActive") b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)"); .HasColumnType("tinyint(1)");
b.Property<decimal>("Length") b.Property<decimal?>("Length")
.HasColumnType("decimal(65,30)"); .HasColumnType("decimal(65,30)");
b.Property<string>("RouteName") b.Property<string>("RouteName")
@@ -1606,7 +1605,6 @@ namespace Distribution.Migrations
.HasColumnType("longtext"); .HasColumnType("longtext");
b.Property<string>("StartPoint") b.Property<string>("StartPoint")
.IsRequired()
.HasColumnType("longtext"); .HasColumnType("longtext");
b.HasKey("Id"); b.HasKey("Id");
@@ -2062,6 +2060,15 @@ namespace Distribution.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("char(36)"); .HasColumnType("char(36)");
b.Property<string>("CancelReason")
.HasColumnType("longtext");
b.Property<DateTime?>("CancelledAt")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CancelledBy")
.HasColumnType("char(36)");
b.Property<DateTime?>("ConfirmedAt") b.Property<DateTime?>("ConfirmedAt")
.HasColumnType("datetime(6)"); .HasColumnType("datetime(6)");
@@ -2376,6 +2383,9 @@ namespace Distribution.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("char(36)"); .HasColumnType("char(36)");
b.Property<string>("ContactNumber")
.HasColumnType("longtext");
b.Property<DateTime>("CreatedAt") b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)"); .HasColumnType("datetime(6)");
@@ -2391,9 +2401,6 @@ namespace Distribution.Migrations
b.Property<bool>("IsActive") b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)"); .HasColumnType("tinyint(1)");
b.Property<int>("KycStatus")
.HasColumnType("int");
b.Property<decimal>("Latitude") b.Property<decimal>("Latitude")
.HasColumnType("decimal(65,30)"); .HasColumnType("decimal(65,30)");
@@ -2407,7 +2414,6 @@ namespace Distribution.Migrations
.HasColumnType("decimal(65,30)"); .HasColumnType("decimal(65,30)");
b.Property<string>("OwnerName") b.Property<string>("OwnerName")
.IsRequired()
.HasColumnType("longtext"); .HasColumnType("longtext");
b.Property<string>("Segment") b.Property<string>("Segment")
@@ -2436,7 +2442,6 @@ namespace Distribution.Migrations
CreditLimit = 50000m, CreditLimit = 50000m,
FK_RouteId = new Guid("25000000-0000-0000-0000-000000000001"), FK_RouteId = new Guid("25000000-0000-0000-0000-000000000001"),
IsActive = true, IsActive = true,
KycStatus = 1,
Latitude = 6.9344m, Latitude = 6.9344m,
Longitude = 79.8428m, Longitude = 79.8428m,
OneTimeAmount = 0m, OneTimeAmount = 0m,
@@ -2454,7 +2459,6 @@ namespace Distribution.Migrations
CreditLimit = 30000m, CreditLimit = 30000m,
FK_RouteId = new Guid("25000000-0000-0000-0000-000000000001"), FK_RouteId = new Guid("25000000-0000-0000-0000-000000000001"),
IsActive = true, IsActive = true,
KycStatus = 1,
Latitude = 6.8508m, Latitude = 6.8508m,
Longitude = 79.8654m, Longitude = 79.8654m,
OneTimeAmount = 0m, OneTimeAmount = 0m,
@@ -2472,7 +2476,6 @@ namespace Distribution.Migrations
CreditLimit = 40000m, CreditLimit = 40000m,
FK_RouteId = new Guid("25000000-0000-0000-0000-000000000002"), FK_RouteId = new Guid("25000000-0000-0000-0000-000000000002"),
IsActive = true, IsActive = true,
KycStatus = 0,
Latitude = 6.9890m, Latitude = 6.9890m,
Longitude = 79.8912m, Longitude = 79.8912m,
OneTimeAmount = 0m, OneTimeAmount = 0m,
@@ -2490,7 +2493,6 @@ namespace Distribution.Migrations
CreditLimit = 25000m, CreditLimit = 25000m,
FK_RouteId = new Guid("25000000-0000-0000-0000-000000000002"), FK_RouteId = new Guid("25000000-0000-0000-0000-000000000002"),
IsActive = true, IsActive = true,
KycStatus = 0,
Latitude = 7.2094m, Latitude = 7.2094m,
Longitude = 79.8380m, Longitude = 79.8380m,
OneTimeAmount = 0m, OneTimeAmount = 0m,
@@ -2507,7 +2509,6 @@ namespace Distribution.Migrations
CreditLimit = 35000m, CreditLimit = 35000m,
FK_RouteId = new Guid("25000000-0000-0000-0000-000000000003"), FK_RouteId = new Guid("25000000-0000-0000-0000-000000000003"),
IsActive = true, IsActive = true,
KycStatus = 1,
Latitude = 7.2906m, Latitude = 7.2906m,
Longitude = 80.6337m, Longitude = 80.6337m,
OneTimeAmount = 0m, OneTimeAmount = 0m,
@@ -2525,7 +2526,6 @@ namespace Distribution.Migrations
CreditLimit = 20000m, CreditLimit = 20000m,
FK_RouteId = new Guid("25000000-0000-0000-0000-000000000004"), FK_RouteId = new Guid("25000000-0000-0000-0000-000000000004"),
IsActive = true, IsActive = true,
KycStatus = 0,
Latitude = 7.4675m, Latitude = 7.4675m,
Longitude = 80.6234m, Longitude = 80.6234m,
OneTimeAmount = 0m, OneTimeAmount = 0m,
@@ -2536,61 +2536,6 @@ namespace Distribution.Migrations
}); });
}); });
modelBuilder.Entity("Distribution.Models.StoreKycDocument", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("DocumentType")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("FK_StoreId")
.HasColumnType("char(36)");
b.Property<string>("FileReference")
.IsRequired()
.HasColumnType("longtext");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("UploadedAt")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("FK_StoreId");
b.ToTable("StoreKycDocuments");
b.HasData(
new
{
Id = new Guid("63000000-0000-0000-0000-000000000001"),
CreatedAt = new DateTime(2026, 8, 10, 0, 0, 0, 0, DateTimeKind.Unspecified),
DocumentType = "Business Registration",
FK_StoreId = new Guid("26000000-0000-0000-0000-000000000001"),
FileReference = "seed/kyc/fort-mini-mart-brc.pdf",
IsActive = true,
UploadedAt = new DateTime(2026, 8, 10, 0, 0, 0, 0, DateTimeKind.Unspecified)
},
new
{
Id = new Guid("63000000-0000-0000-0000-000000000002"),
CreatedAt = new DateTime(2026, 8, 12, 0, 0, 0, 0, DateTimeKind.Unspecified),
DocumentType = "NIC",
FK_StoreId = new Guid("26000000-0000-0000-0000-000000000003"),
FileReference = "seed/kyc/wattala-owner-nic.pdf",
IsActive = true,
UploadedAt = new DateTime(2026, 8, 12, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Distribution.Models.SubCategory", b => modelBuilder.Entity("Distribution.Models.SubCategory", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@@ -3828,17 +3773,6 @@ namespace Distribution.Migrations
b.Navigation("Route"); b.Navigation("Route");
}); });
modelBuilder.Entity("Distribution.Models.StoreKycDocument", b =>
{
b.HasOne("Distribution.Models.Store", "Store")
.WithMany()
.HasForeignKey("FK_StoreId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Store");
});
modelBuilder.Entity("Distribution.Models.SubCategory", b => modelBuilder.Entity("Distribution.Models.SubCategory", b =>
{ {
b.HasOne("Distribution.Models.Category", "Category") b.HasOne("Distribution.Models.Category", "Category")