Merge dev into feat-notification
CI/CD - ERP Distribution / Build & Deploy Backend (pull_request) Failing after 12m21s
CI/CD - ERP Distribution / Build & Deploy Frontend (pull_request) Failing after 16m5s

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-10-20 17:19:51 +05:30
28 changed files with 7310 additions and 88 deletions
@@ -1,4 +1,4 @@
// <auto-generated />
// <auto-generated />
using System;
using Distribution.Data;
using Microsoft.EntityFrameworkCore;
@@ -67,7 +67,7 @@ namespace Distribution.Migrations
b.HasIndex("AccountType", "AccountName")
.IsUnique();
b.ToTable("BankAccounts");
b.ToTable("BankAccounts", (string)null);
b.HasData(
new
@@ -104,7 +104,7 @@ namespace Distribution.Migrations
b.HasKey("Id");
b.ToTable("Brands");
b.ToTable("Brands", (string)null);
b.HasData(
new
@@ -147,7 +147,7 @@ namespace Distribution.Migrations
b.HasKey("Id");
b.ToTable("Categories");
b.ToTable("Categories", (string)null);
b.HasData(
new
@@ -223,7 +223,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_BankAccountId");
b.ToTable("ChequeBooks");
b.ToTable("ChequeBooks", (string)null);
});
modelBuilder.Entity("Distribution.Models.ChequePage", b =>
@@ -311,7 +311,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ChequeBookId");
b.ToTable("ChequePages");
b.ToTable("ChequePages", (string)null);
});
modelBuilder.Entity("Distribution.Models.Claim", b =>
@@ -351,7 +351,7 @@ namespace Distribution.Migrations
b.HasIndex("SettledByUserId");
b.ToTable("Claims");
b.ToTable("Claims", (string)null);
b.HasData(
new
@@ -393,7 +393,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_SaleReturnId");
b.ToTable("CreditNotes");
b.ToTable("CreditNotes", (string)null);
b.HasData(
new
@@ -452,7 +452,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_VehicleId");
b.ToTable("DeliveryRuns");
b.ToTable("DeliveryRuns", (string)null);
b.HasData(
new
@@ -521,7 +521,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ShopPOId");
b.ToTable("DeliveryTasks");
b.ToTable("DeliveryTasks", (string)null);
b.HasData(
new
@@ -557,7 +557,7 @@ namespace Distribution.Migrations
b.HasKey("Id");
b.ToTable("DriverComplianceConfigs");
b.ToTable("DriverComplianceConfigs", (string)null);
b.HasData(
new
@@ -600,7 +600,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_UserId")
.IsUnique();
b.ToTable("DriverProfiles");
b.ToTable("DriverProfiles", (string)null);
b.HasData(
new
@@ -672,7 +672,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_WarehouseId");
b.ToTable("GoodsReceipts");
b.ToTable("GoodsReceipts", (string)null);
b.HasData(
new
@@ -744,7 +744,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_PurchaseOrderItemId");
b.ToTable("GoodsReceiptItems");
b.ToTable("GoodsReceiptItems", (string)null);
b.HasData(
new
@@ -806,7 +806,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ItemBatchId");
b.ToTable("GoodsReceiptItemBatches");
b.ToTable("GoodsReceiptItemBatches", (string)null);
});
modelBuilder.Entity("Distribution.Models.GoodsReceiptItemSerial", b =>
@@ -833,7 +833,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ItemSerialNumberId");
b.ToTable("GoodsReceiptItemSerials");
b.ToTable("GoodsReceiptItemSerials", (string)null);
});
modelBuilder.Entity("Distribution.Models.Invoice", b =>
@@ -879,7 +879,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ShopPOId");
b.ToTable("Invoices");
b.ToTable("Invoices", (string)null);
b.HasData(
new
@@ -993,7 +993,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_SubCategoryId");
b.ToTable("Items");
b.ToTable("Items", (string)null);
b.HasData(
new
@@ -1102,7 +1102,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ItemId", "BatchNumber");
b.ToTable("ItemBatches");
b.ToTable("ItemBatches", (string)null);
});
modelBuilder.Entity("Distribution.Models.ItemSerialNumber", b =>
@@ -1147,7 +1147,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ItemId", "SerialNumber")
.IsUnique();
b.ToTable("ItemSerialNumbers");
b.ToTable("ItemSerialNumbers", (string)null);
});
modelBuilder.Entity("Distribution.Models.LoadingSheet", b =>
@@ -1184,7 +1184,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_RideId");
b.ToTable("LoadingSheets");
b.ToTable("LoadingSheets", (string)null);
b.HasData(
new
@@ -1238,7 +1238,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_WarehouseId");
b.ToTable("LoadingSheetItems");
b.ToTable("LoadingSheetItems", (string)null);
b.HasData(
new
@@ -1275,7 +1275,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ShopPOId");
b.ToTable("LoadingSheetOrders");
b.ToTable("LoadingSheetOrders", (string)null);
});
modelBuilder.Entity("Distribution.Models.Notification", b =>
@@ -1418,7 +1418,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ReceivedChequeId");
b.ToTable("Payments");
b.ToTable("Payments", (string)null);
b.HasData(
new
@@ -1496,7 +1496,7 @@ namespace Distribution.Migrations
b.HasKey("Id");
b.ToTable("Permissions");
b.ToTable("Permissions", (string)null);
b.HasData(
new
@@ -1930,7 +1930,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_RegionId");
b.ToTable("PriceLists");
b.ToTable("PriceLists", (string)null);
b.HasData(
new
@@ -1982,7 +1982,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_PriceListId", "FK_ItemId")
.IsUnique();
b.ToTable("PriceListItems");
b.ToTable("PriceListItems", (string)null);
b.HasData(
new
@@ -2035,7 +2035,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_SupplierId");
b.ToTable("PurchaseOrders");
b.ToTable("PurchaseOrders", (string)null);
b.HasData(
new
@@ -2097,7 +2097,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_PurchaseOrderId");
b.ToTable("PurchaseOrderItems");
b.ToTable("PurchaseOrderItems", (string)null);
b.HasData(
new
@@ -2164,7 +2164,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_PurchaseOrderId");
b.ToTable("PurchaseReturns");
b.ToTable("PurchaseReturns", (string)null);
b.HasData(
new
@@ -2204,7 +2204,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_PurchaseReturnId");
b.ToTable("PurchaseReturnItems");
b.ToTable("PurchaseReturnItems", (string)null);
b.HasData(
new
@@ -2297,7 +2297,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_DepositBankAccountId");
b.ToTable("ReceivedCheques");
b.ToTable("ReceivedCheques", (string)null);
});
modelBuilder.Entity("Distribution.Models.Region", b =>
@@ -2326,7 +2326,7 @@ namespace Distribution.Migrations
b.HasIndex("Code")
.IsUnique();
b.ToTable("Regions");
b.ToTable("Regions", (string)null);
b.HasData(
new
@@ -2372,7 +2372,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_RegionId", "FK_AgencyUserId")
.IsUnique();
b.ToTable("RegionAgencyMaps");
b.ToTable("RegionAgencyMaps", (string)null);
b.HasData(
new
@@ -2412,7 +2412,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_RegionId", "Period")
.IsUnique();
b.ToTable("RegionalBudgets");
b.ToTable("RegionalBudgets", (string)null);
b.HasData(
new
@@ -2453,7 +2453,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_RegionId", "Period")
.IsUnique();
b.ToTable("RegionalTargets");
b.ToTable("RegionalTargets", (string)null);
b.HasData(
new
@@ -2491,7 +2491,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_RegionId")
.IsUnique();
b.ToTable("RegionalTaxRules");
b.ToTable("RegionalTaxRules", (string)null);
b.HasData(
new
@@ -2525,7 +2525,7 @@ namespace Distribution.Migrations
b.HasKey("Id");
b.ToTable("Roles");
b.ToTable("Roles", (string)null);
b.HasData(
new
@@ -2607,7 +2607,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_PermissionId");
b.ToTable("RolePermissions");
b.ToTable("RolePermissions", (string)null);
b.HasData(
new
@@ -3049,7 +3049,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_RegionId");
b.ToTable("Routes");
b.ToTable("Routes", (string)null);
b.HasData(
new
@@ -3146,7 +3146,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_UserId");
b.ToTable("RouteVisitLogs");
b.ToTable("RouteVisitLogs", (string)null);
b.HasData(
new
@@ -3208,7 +3208,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ShopPOId");
b.ToTable("SaleReturns");
b.ToTable("SaleReturns", (string)null);
b.HasData(
new
@@ -3256,7 +3256,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_SaleReturnId");
b.ToTable("SaleReturnItems");
b.ToTable("SaleReturnItems", (string)null);
b.HasData(
new
@@ -3286,7 +3286,7 @@ namespace Distribution.Migrations
b.HasKey("Id");
b.ToTable("SaleRoutes");
b.ToTable("SaleRoutes", (string)null);
b.HasData(
new
@@ -3366,7 +3366,7 @@ namespace Distribution.Migrations
b.HasIndex("RegionId");
b.ToTable("Schemes");
b.ToTable("Schemes", (string)null);
b.HasData(
new
@@ -3424,7 +3424,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_SchemeId", "FK_ItemId")
.IsUnique();
b.ToTable("SchemeBundleComponents");
b.ToTable("SchemeBundleComponents", (string)null);
b.HasData(
new
@@ -3474,7 +3474,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ShopPOId");
b.ToTable("SchemeRedemptions");
b.ToTable("SchemeRedemptions", (string)null);
b.HasData(
new
@@ -3540,7 +3540,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_StoreId");
b.ToTable("ShopPOs");
b.ToTable("ShopPOs", (string)null);
b.HasData(
new
@@ -3616,7 +3616,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ShopPOId");
b.ToTable("ShopPOItems");
b.ToTable("ShopPOItems", (string)null);
b.HasData(
new
@@ -3701,7 +3701,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ItemId", "LocationId", "FK_ItemBatchId", "FK_ItemSerialNumberId")
.IsUnique();
b.ToTable("StockBalances");
b.ToTable("StockBalances", (string)null);
b.HasData(
new
@@ -3786,7 +3786,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ItemSerialNumberId");
b.ToTable("StockMovements");
b.ToTable("StockMovements", (string)null);
b.HasData(
new
@@ -3887,7 +3887,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_RouteId");
b.ToTable("Stores");
b.ToTable("Stores", (string)null);
b.HasData(
new
@@ -3992,6 +3992,54 @@ namespace Distribution.Migrations
});
});
modelBuilder.Entity("Distribution.Models.StoreCreditMovement", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<decimal>("Amount")
.HasPrecision(18, 2)
.HasColumnType("decimal(18,2)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<int>("Direction")
.HasColumnType("int");
b.Property<Guid?>("FK_InvoiceId")
.HasColumnType("char(36)");
b.Property<Guid?>("FK_PaymentId")
.HasColumnType("char(36)");
b.Property<Guid>("FK_StoreId")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<string>("Notes")
.HasColumnType("longtext");
b.Property<DateTime>("OccurredAt")
.HasColumnType("datetime(6)");
b.Property<Guid?>("RecordedBy")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("FK_InvoiceId");
b.HasIndex("FK_PaymentId");
b.HasIndex("FK_StoreId", "OccurredAt");
b.ToTable("StoreCreditMovements", (string)null);
});
modelBuilder.Entity("Distribution.Models.SubCategory", b =>
{
b.Property<Guid>("Id")
@@ -4018,7 +4066,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_CategoryId");
b.ToTable("SubCategories");
b.ToTable("SubCategories", (string)null);
});
modelBuilder.Entity("Distribution.Models.Supplier", b =>
@@ -4045,7 +4093,7 @@ namespace Distribution.Migrations
b.HasKey("Id");
b.ToTable("Suppliers");
b.ToTable("Suppliers", (string)null);
b.HasData(
new
@@ -4123,7 +4171,7 @@ namespace Distribution.Migrations
b.HasIndex("ResolvedByUserId");
b.ToTable("SupplierClaims");
b.ToTable("SupplierClaims", (string)null);
b.HasData(
new
@@ -4174,7 +4222,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_SupplierClaimId");
b.ToTable("SupplierClaimItems");
b.ToTable("SupplierClaimItems", (string)null);
b.HasData(
new
@@ -4234,7 +4282,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_SupplierId");
b.ToTable("SupplierPayments");
b.ToTable("SupplierPayments", (string)null);
});
modelBuilder.Entity("Distribution.Models.SupplierPaymentGRN", b =>
@@ -4265,7 +4313,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_SupplierPaymentId");
b.ToTable("SupplierPaymentGRNs");
b.ToTable("SupplierPaymentGRNs", (string)null);
});
modelBuilder.Entity("Distribution.Models.SysConfig", b =>
@@ -4286,7 +4334,7 @@ namespace Distribution.Migrations
b.HasKey("Key");
b.ToTable("SysConfigs");
b.ToTable("SysConfigs", (string)null);
b.HasData(
new
@@ -4354,7 +4402,7 @@ namespace Distribution.Migrations
b.HasKey("Id");
b.ToTable("Uoms");
b.ToTable("Uoms", (string)null);
b.HasData(
new
@@ -4399,7 +4447,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_ToUomId");
b.ToTable("UomConversions");
b.ToTable("UomConversions", (string)null);
b.HasData(
new
@@ -4447,7 +4495,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_RoleId");
b.ToTable("Users");
b.ToTable("Users", (string)null);
b.HasData(
new
@@ -4549,7 +4597,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_RegionId");
b.ToTable("UserRegionScopes");
b.ToTable("UserRegionScopes", (string)null);
b.HasData(
new
@@ -4583,7 +4631,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_RouteId");
b.ToTable("UserRouteScopes");
b.ToTable("UserRouteScopes", (string)null);
b.HasData(
new
@@ -4617,7 +4665,7 @@ namespace Distribution.Migrations
b.HasIndex("FK_StoreId");
b.ToTable("UserStoreScopes");
b.ToTable("UserStoreScopes", (string)null);
b.HasData(
new
@@ -4660,7 +4708,7 @@ namespace Distribution.Migrations
b.HasIndex("DefaultWarehouseId");
b.ToTable("Vehicles");
b.ToTable("Vehicles", (string)null);
b.HasData(
new
@@ -4715,7 +4763,7 @@ namespace Distribution.Migrations
b.HasIndex("VehicleId");
b.ToTable("Warehouses");
b.ToTable("Warehouses", (string)null);
b.HasData(
new
@@ -5505,6 +5553,31 @@ namespace Distribution.Migrations
b.Navigation("Route");
});
modelBuilder.Entity("Distribution.Models.StoreCreditMovement", b =>
{
b.HasOne("Distribution.Models.Invoice", "Invoice")
.WithMany()
.HasForeignKey("FK_InvoiceId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("Distribution.Models.Payment", "Payment")
.WithMany()
.HasForeignKey("FK_PaymentId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("Distribution.Models.Store", "Store")
.WithMany()
.HasForeignKey("FK_StoreId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Invoice");
b.Navigation("Payment");
b.Navigation("Store");
});
modelBuilder.Entity("Distribution.Models.SubCategory", b =>
{
b.HasOne("Distribution.Models.Category", "Category")