//
using System;
using Distribution.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Distribution.Migrations
{
[DbContext(typeof(AppDBContext))]
[Migration("20261020123138_AddInvoiceItems")]
partial class AddInvoiceItems
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Distribution.Models.BankAccount", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("AccountName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("AccountNumber")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("AccountType")
.HasColumnType("int");
b.Property("BankName")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("CashAccountTypeName")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("CurrencyCode")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("IsDefault")
.HasColumnType("tinyint(1)");
b.HasKey("Id");
b.HasIndex("AccountType", "AccountName")
.IsUnique();
b.ToTable("BankAccounts");
b.HasData(
new
{
Id = new Guid("11111111-1111-1111-1111-000000000001"),
AccountName = "Petty Cash",
AccountType = 0,
CashAccountTypeName = "Petty Cash",
CreatedAt = new DateTime(2026, 10, 19, 0, 0, 0, 0, DateTimeKind.Unspecified),
CurrencyCode = "LKR",
IsActive = true,
IsDefault = true
});
});
modelBuilder.Entity("Distribution.Models.Brand", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("ExternalErpId")
.HasColumnType("int");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Brands");
b.HasData(
new
{
Id = new Guid("21000000-0000-0000-0000-000000000001"),
CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsActive = true,
Name = "Coca-Cola"
},
new
{
Id = new Guid("21000000-0000-0000-0000-000000000002"),
CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsActive = true,
Name = "Lays"
});
});
modelBuilder.Entity("Distribution.Models.Category", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("AllowCustomerReturn")
.HasColumnType("tinyint(1)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("ExternalErpId")
.HasColumnType("int");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Categories");
b.HasData(
new
{
Id = new Guid("20000000-0000-0000-0000-000000000001"),
AllowCustomerReturn = false,
CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsActive = true,
Name = "Beverages"
},
new
{
Id = new Guid("20000000-0000-0000-0000-000000000002"),
AllowCustomerReturn = false,
CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsActive = true,
Name = "Snacks"
});
});
modelBuilder.Entity("Distribution.Models.ChequeBook", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("BranchId")
.HasColumnType("int");
b.Property("ChequeBookNo")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("CreatedBy")
.HasColumnType("longtext");
b.Property("Description")
.HasColumnType("longtext");
b.Property("EndChequeNo")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("FK_BankAccountId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("ReceivedDate")
.HasColumnType("datetime(6)");
b.Property("StartChequeNo")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("Status")
.HasColumnType("int");
b.Property("TotalLeaves")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ChequeBookNo")
.IsUnique();
b.HasIndex("FK_BankAccountId");
b.ToTable("ChequeBooks");
});
modelBuilder.Entity("Distribution.Models.ChequePage", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("Amount")
.HasColumnType("decimal(65,30)");
b.Property("CancelReason")
.HasColumnType("longtext");
b.Property("ChequeNo")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("ClearedByBank")
.HasColumnType("tinyint(1)");
b.Property("ClearedDate")
.HasColumnType("datetime(6)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("CurrencyCode")
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.Property("FK_ChequeBookId")
.HasColumnType("char(36)");
b.Property("IsAccountPayee")
.HasColumnType("tinyint(1)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("IsCrossCheque")
.HasColumnType("tinyint(1)");
b.Property("IsPostDated")
.HasColumnType("tinyint(1)");
b.Property("IssueDate")
.HasColumnType("datetime(6)");
b.Property("IssueStatus")
.HasColumnType("int");
b.Property("Notes")
.HasColumnType("longtext");
b.Property("PayeeId")
.HasColumnType("int");
b.Property("PayeeName")
.HasColumnType("longtext");
b.Property("PayeeType")
.HasColumnType("int");
b.Property("PrintedAt")
.HasColumnType("datetime(6)");
b.Property("PrintedBy")
.HasColumnType("longtext");
b.Property("Purpose")
.HasColumnType("longtext");
b.Property("ReferenceNo")
.HasColumnType("longtext");
b.Property("VoucherId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ChequeNo")
.IsUnique();
b.HasIndex("FK_ChequeBookId");
b.ToTable("ChequePages");
});
modelBuilder.Entity("Distribution.Models.Claim", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("Details")
.IsRequired()
.HasColumnType("longtext");
b.Property("FK_AgencyUserId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("SettledAt")
.HasColumnType("datetime(6)");
b.Property("SettledByUserId")
.HasColumnType("char(36)");
b.Property("SettlementAmount")
.HasColumnType("decimal(65,30)");
b.Property("Status")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("FK_AgencyUserId");
b.HasIndex("SettledByUserId");
b.ToTable("Claims");
b.HasData(
new
{
Id = new Guid("53000000-0000-0000-0000-000000000001"),
CreatedAt = new DateTime(2026, 8, 27, 0, 0, 0, 0, DateTimeKind.Unspecified),
Details = "Distributor margin claim for Q3 promotional shortfall",
FK_AgencyUserId = new Guid("70000000-0000-0000-0000-000000000001"),
IsActive = true,
SettledAt = new DateTime(2026, 8, 28, 0, 0, 0, 0, DateTimeKind.Unspecified),
SettledByUserId = new Guid("29000000-0000-0000-0000-000000000006"),
SettlementAmount = 15000m,
Status = 1
});
});
modelBuilder.Entity("Distribution.Models.CreditNote", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("Amount")
.HasColumnType("decimal(65,30)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("FK_SaleReturnId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("IssuedAt")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("FK_SaleReturnId");
b.ToTable("CreditNotes");
b.HasData(
new
{
Id = new Guid("54000000-0000-0000-0000-000000000001"),
Amount = 300m,
CreatedAt = new DateTime(2026, 8, 26, 0, 0, 0, 0, DateTimeKind.Unspecified),
FK_SaleReturnId = new Guid("51000000-0000-0000-0000-000000000001"),
IsActive = true,
IssuedAt = new DateTime(2026, 8, 26, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Distribution.Models.DeliveryRun", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CancelReason")
.HasColumnType("longtext");
b.Property("CancelTypeCode")
.HasColumnType("int");
b.Property("ClosedAt")
.HasColumnType("datetime(6)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("FK_DriverProfileId")
.HasColumnType("char(36)");
b.Property("FK_VehicleId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("Meterend")
.HasColumnType("int");
b.Property("Meterstart")
.HasColumnType("int");
b.Property("StartedAt")
.HasColumnType("datetime(6)");
b.Property("Status")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("FK_DriverProfileId");
b.HasIndex("FK_VehicleId");
b.ToTable("DeliveryRuns");
b.HasData(
new
{
Id = new Guid("31000000-0000-0000-0000-000000000001"),
ClosedAt = new DateTime(2026, 8, 25, 14, 0, 0, 0, DateTimeKind.Unspecified),
CreatedAt = new DateTime(2026, 8, 25, 7, 30, 0, 0, DateTimeKind.Unspecified),
FK_DriverProfileId = new Guid("30000000-0000-0000-0000-000000000001"),
FK_VehicleId = new Guid("28000000-0000-0000-0000-000000000001"),
IsActive = true,
Meterend = 10550,
Meterstart = 10500,
StartedAt = new DateTime(2026, 8, 25, 8, 0, 0, 0, DateTimeKind.Unspecified),
Status = 2
},
new
{
Id = new Guid("31000000-0000-0000-0000-000000000002"),
CreatedAt = new DateTime(2026, 8, 30, 8, 45, 0, 0, DateTimeKind.Unspecified),
FK_DriverProfileId = new Guid("30000000-0000-0000-0000-000000000002"),
FK_VehicleId = new Guid("28000000-0000-0000-0000-000000000002"),
IsActive = true,
Meterend = 0,
Meterstart = 20300,
StartedAt = new DateTime(2026, 8, 30, 9, 0, 0, 0, DateTimeKind.Unspecified),
Status = 0
});
});
modelBuilder.Entity("Distribution.Models.DeliveryTask", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("ConfirmedAt")
.HasColumnType("datetime(6)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("CustomerConfirmed")
.HasColumnType("tinyint(1)");
b.Property("FK_RideId")
.HasColumnType("char(36)");
b.Property("FK_ShopPOId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("Note")
.HasColumnType("longtext");
b.Property("Sequence")
.HasColumnType("int");
b.Property("Status")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("FK_RideId");
b.HasIndex("FK_ShopPOId");
b.ToTable("DeliveryTasks");
b.HasData(
new
{
Id = new Guid("37000000-0000-0000-0000-000000000001"),
CreatedAt = new DateTime(2026, 8, 30, 10, 5, 0, 0, DateTimeKind.Unspecified),
CustomerConfirmed = false,
FK_RideId = new Guid("31000000-0000-0000-0000-000000000002"),
FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000002"),
IsActive = true,
Sequence = 1,
Status = 0
});
});
modelBuilder.Entity("Distribution.Models.DriverComplianceConfig", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("EnforceLicenseExpiry")
.HasColumnType("tinyint(1)");
b.Property("EnforceMedicalClearance")
.HasColumnType("tinyint(1)");
b.Property("UpdatedAt")
.HasColumnType("datetime(6)");
b.Property("UpdatedBy")
.HasColumnType("char(36)");
b.HasKey("Id");
b.ToTable("DriverComplianceConfigs");
b.HasData(
new
{
Id = new Guid("64000000-0000-0000-0000-000000000001"),
EnforceLicenseExpiry = true,
EnforceMedicalClearance = true,
UpdatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified),
UpdatedBy = new Guid("29000000-0000-0000-0000-000000000001")
});
});
modelBuilder.Entity("Distribution.Models.DriverProfile", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("FK_UserId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("LicenseExpiry")
.HasColumnType("datetime(6)");
b.Property("LicenseNumber")
.IsRequired()
.HasColumnType("longtext");
b.Property("MedicalClearanceExpiry")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("FK_UserId")
.IsUnique();
b.ToTable("DriverProfiles");
b.HasData(
new
{
Id = new Guid("30000000-0000-0000-0000-000000000001"),
CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified),
FK_UserId = new Guid("29000000-0000-0000-0000-000000000004"),
IsActive = true,
LicenseExpiry = new DateTime(2027, 6, 30, 0, 0, 0, 0, DateTimeKind.Unspecified),
LicenseNumber = "B1234567",
MedicalClearanceExpiry = new DateTime(2027, 1, 31, 0, 0, 0, 0, DateTimeKind.Unspecified)
},
new
{
Id = new Guid("30000000-0000-0000-0000-000000000002"),
CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified),
FK_UserId = new Guid("29000000-0000-0000-0000-000000000005"),
IsActive = true,
LicenseExpiry = new DateTime(2027, 9, 30, 0, 0, 0, 0, DateTimeKind.Unspecified),
LicenseNumber = "B7654321",
MedicalClearanceExpiry = new DateTime(2027, 3, 31, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Distribution.Models.GoodsReceipt", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("DiscountPercent")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.Property("FK_PurchaseOrderId")
.HasColumnType("char(36)");
b.Property("FK_ReceivedByUserId")
.HasColumnType("char(36)");
b.Property("FK_SupplierId")
.HasColumnType("char(36)");
b.Property("FK_WarehouseId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("NbtPercent")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.Property("ReceivedAt")
.HasColumnType("datetime(6)");
b.Property("VatPercent")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.HasKey("Id");
b.HasIndex("FK_PurchaseOrderId");
b.HasIndex("FK_SupplierId");
b.HasIndex("FK_WarehouseId");
b.ToTable("GoodsReceipts");
b.HasData(
new
{
Id = new Guid("43000000-0000-0000-0000-000000000001"),
CreatedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified),
DiscountPercent = 0m,
FK_PurchaseOrderId = new Guid("41000000-0000-0000-0000-000000000001"),
FK_ReceivedByUserId = new Guid("29000000-0000-0000-0000-000000000001"),
FK_WarehouseId = new Guid("27000000-0000-0000-0000-000000000001"),
IsActive = true,
NbtPercent = 0m,
ReceivedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified),
VatPercent = 0m
});
});
modelBuilder.Entity("Distribution.Models.GoodsReceiptItem", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("AcceptedQuantity")
.HasColumnType("int");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("DiscountPercent")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.Property("FK_GoodsReceiptId")
.HasColumnType("char(36)");
b.Property("FK_ItemId")
.HasColumnType("char(36)");
b.Property("FK_PurchaseOrderItemId")
.HasColumnType("char(36)");
b.Property("FreeQuantity")
.HasColumnType("int");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("NbtPercent")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.Property("RejectedQuantity")
.HasColumnType("int");
b.Property("UnitCost")
.HasPrecision(18, 2)
.HasColumnType("decimal(18,2)");
b.Property("VatPercent")
.HasPrecision(5, 2)
.HasColumnType("decimal(5,2)");
b.HasKey("Id");
b.HasIndex("FK_GoodsReceiptId");
b.HasIndex("FK_ItemId");
b.HasIndex("FK_PurchaseOrderItemId");
b.ToTable("GoodsReceiptItems");
b.HasData(
new
{
Id = new Guid("44000000-0000-0000-0000-000000000001"),
AcceptedQuantity = 200,
CreatedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified),
DiscountPercent = 0m,
FK_GoodsReceiptId = new Guid("43000000-0000-0000-0000-000000000001"),
FK_PurchaseOrderItemId = new Guid("42000000-0000-0000-0000-000000000001"),
FreeQuantity = 0,
IsActive = true,
NbtPercent = 0m,
RejectedQuantity = 0,
UnitCost = 0m,
VatPercent = 0m
},
new
{
Id = new Guid("44000000-0000-0000-0000-000000000002"),
AcceptedQuantity = 98,
CreatedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified),
DiscountPercent = 0m,
FK_GoodsReceiptId = new Guid("43000000-0000-0000-0000-000000000001"),
FK_PurchaseOrderItemId = new Guid("42000000-0000-0000-0000-000000000002"),
FreeQuantity = 0,
IsActive = true,
NbtPercent = 0m,
RejectedQuantity = 2,
UnitCost = 0m,
VatPercent = 0m
});
});
modelBuilder.Entity("Distribution.Models.GoodsReceiptItemBatch", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("FK_GoodsReceiptItemId")
.HasColumnType("char(36)");
b.Property("FK_ItemBatchId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("Quantity")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("FK_GoodsReceiptItemId");
b.HasIndex("FK_ItemBatchId");
b.ToTable("GoodsReceiptItemBatches");
});
modelBuilder.Entity("Distribution.Models.GoodsReceiptItemSerial", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("FK_GoodsReceiptItemId")
.HasColumnType("char(36)");
b.Property("FK_ItemSerialNumberId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.HasKey("Id");
b.HasIndex("FK_GoodsReceiptItemId");
b.HasIndex("FK_ItemSerialNumberId");
b.ToTable("GoodsReceiptItemSerials");
});
modelBuilder.Entity("Distribution.Models.Invoice", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("CreatedBy")
.HasColumnType("char(36)");
b.Property("FK_ShopPOId")
.HasColumnType("char(36)");
b.Property("FinalizedAt")
.HasColumnType("datetime(6)");
b.Property("FinalizedBy")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("PaymentStatus")
.HasColumnType("int");
b.Property("PrintedAt")
.HasColumnType("datetime(6)");
b.Property("PrintedBy")
.HasColumnType("char(36)");
b.Property("Status")
.HasColumnType("int");
b.Property("TotalAmount")
.HasColumnType("decimal(65,30)");
b.HasKey("Id");
b.HasIndex("FK_ShopPOId");
b.ToTable("Invoices");
b.HasData(
new
{
Id = new Guid("34500000-0000-0000-0000-000000000001"),
CreatedAt = new DateTime(2026, 8, 25, 8, 30, 0, 0, DateTimeKind.Unspecified),
CreatedBy = new Guid("29000000-0000-0000-0000-000000000002"),
FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000001"),
FinalizedAt = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified),
FinalizedBy = new Guid("29000000-0000-0000-0000-000000000001"),
IsActive = true,
PaymentStatus = 2,
PrintedAt = new DateTime(2026, 8, 25, 8, 45, 0, 0, DateTimeKind.Unspecified),
PrintedBy = new Guid("29000000-0000-0000-0000-000000000002"),
Status = 2,
TotalAmount = 3000m
},
new
{
Id = new Guid("34500000-0000-0000-0000-000000000002"),
CreatedAt = new DateTime(2026, 8, 31, 9, 0, 0, 0, DateTimeKind.Unspecified),
CreatedBy = new Guid("29000000-0000-0000-0000-000000000003"),
FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000003"),
IsActive = true,
PaymentStatus = 1,
PrintedAt = new DateTime(2026, 8, 31, 9, 15, 0, 0, DateTimeKind.Unspecified),
PrintedBy = new Guid("29000000-0000-0000-0000-000000000003"),
Status = 1,
TotalAmount = 2400m
});
});
modelBuilder.Entity("Distribution.Models.InvoiceItem", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("FK_InvoiceId")
.HasColumnType("char(36)");
b.Property("FK_ItemId")
.HasColumnType("char(36)");
b.Property("FK_ShopPOItemId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("Quantity")
.HasColumnType("int");
b.Property("UnitPrice")
.HasColumnType("decimal(65,30)");
b.HasKey("Id");
b.HasIndex("FK_InvoiceId");
b.HasIndex("FK_ItemId");
b.HasIndex("FK_ShopPOItemId");
b.ToTable("InvoiceItems");
});
modelBuilder.Entity("Distribution.Models.Item", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("AllowCustomWarrantyPeriod")
.HasColumnType("tinyint(1)");
b.Property("CostPrice")
.HasColumnType("decimal(65,30)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("Description")
.HasColumnType("longtext");
b.Property("ExternalErpItemId")
.HasColumnType("int");
b.Property("FK_BaseUomId")
.HasColumnType("char(36)");
b.Property("FK_BrandId")
.HasColumnType("char(36)");
b.Property("FK_CategoryId")
.HasColumnType("char(36)");
b.Property("FK_SubCategoryId")
.HasColumnType("char(36)");
b.Property("HasWarranty")
.HasColumnType("tinyint(1)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("LastSyncedAt")
.HasColumnType("datetime(6)");
b.Property("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property("ReorderLevel")
.HasColumnType("decimal(65,30)");
b.Property("SalePrice")
.HasColumnType("decimal(65,30)");
b.Property("Sku")
.IsRequired()
.HasColumnType("longtext");
b.Property("SyncSource")
.HasColumnType("int");
b.Property("TracksBatches")
.HasColumnType("tinyint(1)");
b.Property("TracksExpiryDate")
.HasColumnType("tinyint(1)");
b.Property("TracksSerialNumbers")
.HasColumnType("tinyint(1)");
b.Property("WarrantyPeriodDays")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("FK_BaseUomId");
b.HasIndex("FK_BrandId");
b.HasIndex("FK_CategoryId");
b.HasIndex("FK_SubCategoryId");
b.ToTable("Items");
b.HasData(
new
{
Id = new Guid("23000000-0000-0000-0000-000000000001"),
AllowCustomWarrantyPeriod = false,
CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified),
Description = "Coca-Cola 500ml bottle",
FK_BaseUomId = new Guid("22000000-0000-0000-0000-000000000001"),
FK_BrandId = new Guid("21000000-0000-0000-0000-000000000001"),
FK_CategoryId = new Guid("20000000-0000-0000-0000-000000000001"),
HasWarranty = false,
IsActive = true,
Name = "Coca-Cola 500ml",
SalePrice = 60m,
Sku = "BEV-COKE-500",
SyncSource = 0,
TracksBatches = false,
TracksExpiryDate = false,
TracksSerialNumbers = false
},
new
{
Id = new Guid("23000000-0000-0000-0000-000000000002"),
AllowCustomWarrantyPeriod = false,
CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified),
Description = "Coca-Cola 1.5L bottle",
FK_BaseUomId = new Guid("22000000-0000-0000-0000-000000000001"),
FK_BrandId = new Guid("21000000-0000-0000-0000-000000000001"),
FK_CategoryId = new Guid("20000000-0000-0000-0000-000000000001"),
HasWarranty = false,
IsActive = true,
Name = "Coca-Cola 1.5L",
SalePrice = 120m,
Sku = "BEV-COKE-1500",
SyncSource = 0,
TracksBatches = false,
TracksExpiryDate = false,
TracksSerialNumbers = false
},
new
{
Id = new Guid("23000000-0000-0000-0000-000000000003"),
AllowCustomWarrantyPeriod = false,
CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified),
Description = "Lays Classic Salted 52g pack",
FK_BaseUomId = new Guid("22000000-0000-0000-0000-000000000001"),
FK_BrandId = new Guid("21000000-0000-0000-0000-000000000002"),
FK_CategoryId = new Guid("20000000-0000-0000-0000-000000000002"),
HasWarranty = false,
IsActive = true,
Name = "Lays Classic 52g",
SalePrice = 50m,
Sku = "SNK-LAYS-52",
SyncSource = 0,
TracksBatches = false,
TracksExpiryDate = false,
TracksSerialNumbers = false
},
new
{
Id = new Guid("23000000-0000-0000-0000-000000000004"),
AllowCustomWarrantyPeriod = false,
CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified),
Description = "Lays Family Pack 150g",
FK_BaseUomId = new Guid("22000000-0000-0000-0000-000000000001"),
FK_BrandId = new Guid("21000000-0000-0000-0000-000000000002"),
FK_CategoryId = new Guid("20000000-0000-0000-0000-000000000002"),
HasWarranty = false,
IsActive = true,
Name = "Lays Family Pack 150g",
SalePrice = 150m,
Sku = "SNK-LAYS-FAM",
SyncSource = 0,
TracksBatches = false,
TracksExpiryDate = false,
TracksSerialNumbers = false
});
});
modelBuilder.Entity("Distribution.Models.ItemBatch", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("BatchNumber")
.HasColumnType("varchar(255)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("ExpiryDate")
.HasColumnType("datetime(6)");
b.Property("FK_ItemId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("ManufactureDate")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("FK_ItemId", "BatchNumber");
b.ToTable("ItemBatches");
});
modelBuilder.Entity("Distribution.Models.ItemSerialNumber", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("CurrentLocationId")
.HasColumnType("char(36)");
b.Property("CurrentLocationType")
.HasColumnType("int");
b.Property("FK_ItemId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("ReceivedAt")
.HasColumnType("datetime(6)");
b.Property("SerialNumber")
.IsRequired()
.HasColumnType("varchar(255)");
b.Property("Status")
.HasColumnType("int");
b.Property("WarrantyExpiresAt")
.HasColumnType("datetime(6)");
b.Property("WarrantyPeriodDaysOverride")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("FK_ItemId", "SerialNumber")
.IsUnique();
b.ToTable("ItemSerialNumbers");
});
modelBuilder.Entity("Distribution.Models.LoadingSheet", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("ConfirmedAt")
.HasColumnType("datetime(6)");
b.Property("ConfirmedBy")
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("FK_RideId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("PopulatedAt")
.HasColumnType("datetime(6)");
b.Property("PopulatedBy")
.HasColumnType("char(36)");
b.Property("Status")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("FK_RideId");
b.ToTable("LoadingSheets");
b.HasData(
new
{
Id = new Guid("35000000-0000-0000-0000-000000000001"),
ConfirmedAt = new DateTime(2026, 8, 25, 7, 45, 0, 0, DateTimeKind.Unspecified),
ConfirmedBy = new Guid("29000000-0000-0000-0000-000000000001"),
CreatedAt = new DateTime(2026, 8, 25, 7, 30, 0, 0, DateTimeKind.Unspecified),
FK_RideId = new Guid("31000000-0000-0000-0000-000000000001"),
IsActive = true,
PopulatedAt = new DateTime(2026, 8, 25, 7, 30, 0, 0, DateTimeKind.Unspecified),
PopulatedBy = new Guid("29000000-0000-0000-0000-000000000001"),
Status = 1
});
});
modelBuilder.Entity("Distribution.Models.LoadingSheetItem", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("FK_ItemId")
.HasColumnType("char(36)");
b.Property("FK_LoadingSheetId")
.HasColumnType("char(36)");
b.Property("FK_ShopPOItemId")
.HasColumnType("char(36)");
b.Property("FK_WarehouseId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("QuantityDispatched")
.HasColumnType("decimal(65,30)");
b.HasKey("Id");
b.HasIndex("FK_ItemId");
b.HasIndex("FK_LoadingSheetId");
b.HasIndex("FK_ShopPOItemId");
b.HasIndex("FK_WarehouseId");
b.ToTable("LoadingSheetItems");
b.HasData(
new
{
Id = new Guid("36000000-0000-0000-0000-000000000001"),
CreatedAt = new DateTime(2026, 8, 25, 7, 30, 0, 0, DateTimeKind.Unspecified),
FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"),
FK_LoadingSheetId = new Guid("35000000-0000-0000-0000-000000000001"),
FK_WarehouseId = new Guid("27000000-0000-0000-0000-000000000001"),
IsActive = true,
QuantityDispatched = 50m
},
new
{
Id = new Guid("36000000-0000-0000-0000-000000000002"),
CreatedAt = new DateTime(2026, 8, 25, 7, 30, 0, 0, DateTimeKind.Unspecified),
FK_ItemId = new Guid("23000000-0000-0000-0000-000000000003"),
FK_LoadingSheetId = new Guid("35000000-0000-0000-0000-000000000001"),
FK_WarehouseId = new Guid("27000000-0000-0000-0000-000000000001"),
IsActive = true,
QuantityDispatched = 30m
});
});
modelBuilder.Entity("Distribution.Models.LoadingSheetOrder", b =>
{
b.Property("FK_LoadingSheetId")
.HasColumnType("char(36)");
b.Property("FK_ShopPOId")
.HasColumnType("char(36)");
b.HasKey("FK_LoadingSheetId", "FK_ShopPOId");
b.HasIndex("FK_ShopPOId");
b.ToTable("LoadingSheetOrders");
});
modelBuilder.Entity("Distribution.Models.Notification", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("CreatedByUserId")
.HasColumnType("char(36)");
b.Property("EntityId")
.HasColumnType("char(36)");
b.Property("EntityType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("Link")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("Message")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property("Severity")
.HasColumnType("int");
b.Property("Title")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("varchar(150)");
b.Property("Type")
.IsRequired()
.HasMaxLength(60)
.HasColumnType("varchar(60)");
b.HasKey("Id");
b.HasIndex("EntityType", "EntityId");
b.ToTable("Notifications");
});
modelBuilder.Entity("Distribution.Models.NotificationRecipient", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("FK_NotificationId")
.HasColumnType("char(36)");
b.Property("FK_UserId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("IsRead")
.HasColumnType("tinyint(1)");
b.Property("ReadAt")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("FK_NotificationId", "FK_UserId")
.IsUnique();
b.HasIndex("FK_UserId", "IsRead");
b.ToTable("NotificationRecipients");
});
modelBuilder.Entity("Distribution.Models.Payment", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("Amount")
.HasColumnType("decimal(65,30)");
b.Property("ChequeDate")
.HasColumnType("datetime(6)");
b.Property("ChequeNumber")
.HasColumnType("longtext");
b.Property("CollectedAt")
.HasColumnType("datetime(6)");
b.Property("CollectedBy")
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("EntryMode")
.HasColumnType("int");
b.Property("FK_BankAccountId")
.HasColumnType("char(36)");
b.Property("FK_InvoiceId")
.HasColumnType("char(36)");
b.Property("FK_ReceivedChequeId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("Method")
.HasColumnType("int");
b.Property("RecordedBy")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("FK_BankAccountId");
b.HasIndex("FK_InvoiceId");
b.HasIndex("FK_ReceivedChequeId");
b.ToTable("Payments");
b.HasData(
new
{
Id = new Guid("47000000-0000-0000-0000-000000000001"),
Amount = 3000m,
CollectedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified),
CollectedBy = new Guid("29000000-0000-0000-0000-000000000002"),
CreatedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified),
EntryMode = 0,
FK_InvoiceId = new Guid("34500000-0000-0000-0000-000000000001"),
IsActive = true,
Method = 0
},
new
{
Id = new Guid("47000000-0000-0000-0000-000000000002"),
Amount = 1000m,
CollectedAt = new DateTime(2026, 8, 31, 9, 20, 0, 0, DateTimeKind.Unspecified),
CollectedBy = new Guid("29000000-0000-0000-0000-000000000003"),
CreatedAt = new DateTime(2026, 8, 31, 9, 20, 0, 0, DateTimeKind.Unspecified),
EntryMode = 0,
FK_InvoiceId = new Guid("34500000-0000-0000-0000-000000000002"),
IsActive = true,
Method = 0
},
new
{
Id = new Guid("47000000-0000-0000-0000-000000000003"),
Amount = 800m,
ChequeDate = new DateTime(2026, 8, 31, 0, 0, 0, 0, DateTimeKind.Unspecified),
ChequeNumber = "000456",
CollectedAt = new DateTime(2026, 8, 31, 11, 0, 0, 0, DateTimeKind.Unspecified),
CollectedBy = new Guid("29000000-0000-0000-0000-000000000003"),
CreatedAt = new DateTime(2026, 8, 31, 18, 0, 0, 0, DateTimeKind.Unspecified),
EntryMode = 1,
FK_InvoiceId = new Guid("34500000-0000-0000-0000-000000000002"),
IsActive = true,
Method = 1,
RecordedBy = new Guid("29000000-0000-0000-0000-000000000001")
},
new
{
Id = new Guid("47000000-0000-0000-0000-000000000004"),
Amount = 300m,
CollectedAt = new DateTime(2026, 8, 31, 11, 5, 0, 0, DateTimeKind.Unspecified),
CollectedBy = new Guid("29000000-0000-0000-0000-000000000003"),
CreatedAt = new DateTime(2026, 8, 31, 11, 5, 0, 0, DateTimeKind.Unspecified),
EntryMode = 0,
FK_InvoiceId = new Guid("34500000-0000-0000-0000-000000000002"),
IsActive = true,
Method = 2
});
});
modelBuilder.Entity("Distribution.Models.Permission", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property