[CLAUDE] Supplier: Excel-import Phase B (upload NCC preview/confirm) + Mig 63
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m25s

Import Excel 'Database NCC': upload→preview classify (New/Update/Skip/Error)→confirm all-or-nothing upsert-by-Code (OrdinalIgnoreCase dedup, fill-nulls-safe). Mig 63 +SourceUpdatedAt/By (2 nullable). Parser layout-locked header-fingerprint NFC-normalized + absolute-cell-index + #REF!-null + NAS-backslash-raw. Type-lạ→NhaCungCap. FE dialog fe-admin+fe-user byte-identical. 10 test SupplierExcelImportServiceTests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-07-12 16:13:46 +07:00
parent a829d0df99
commit e100ef065b
20 changed files with 8268 additions and 14 deletions

View File

@ -41,6 +41,9 @@ public class SupplierConfiguration : IEntityTypeConfiguration<Supplier>
b.Property(x => x.OwnerPmh).HasMaxLength(150);
b.Property(x => x.Status).HasConversion<int>(); // nullable int enum
// Import provenance (Supplier Phase B). SourceUpdatedAt = DateTime? (no length). SourceUpdatedBy = text.
b.Property(x => x.SourceUpdatedBy).HasMaxLength(200);
b.HasIndex(x => x.Code).IsUnique().HasFilter("[IsDeleted] = 0"); // Mig 47 (gotcha #57 EXT) — soft-deleted slot reusable, khớp HasQueryFilter !IsDeleted app-check
b.HasIndex(x => x.Type);

View File

@ -0,0 +1,40 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SolutionErp.Infrastructure.Persistence.Migrations
{
/// <inheritdoc />
public partial class AddSupplierImportSourceFields : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "SourceUpdatedAt",
table: "Suppliers",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SourceUpdatedBy",
table: "Suppliers",
type: "nvarchar(200)",
maxLength: 200,
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SourceUpdatedAt",
table: "Suppliers");
migrationBuilder.DropColumn(
name: "SourceUpdatedBy",
table: "Suppliers");
}
}
}

View File

@ -3327,6 +3327,13 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<DateTime?>("SourceUpdatedAt")
.HasColumnType("datetime2");
b.Property<string>("SourceUpdatedBy")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<int?>("Status")
.HasColumnType("int");