* Introduced Marelli packing list

This commit is contained in:
2025-09-09 07:00:05 +02:00
parent 89792d3d28
commit 50a25ff996
12 changed files with 477 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
namespace SytelineSaAppEfDataModel.Dtos;
public class WzRowMareliDto
public class WzRowMarelliDto
{
public Guid ID { get; set; }
public Guid? FKHeader { get; set; }
@@ -11,4 +11,6 @@ public class WzRowMareliDto
public int? Quantity { get; set; }
public string OrderNumber { get; set; }
public string WzNumber { get; set; }
public string FaIndex { get; set; }
public int? TransactionNumber { get; set; }
}

View File

@@ -1,6 +1,6 @@
namespace SytelineSaAppEfDataModel.Entities;
public class WzRowMareli
public class WzRowMarelli
{
public Guid ID { get; set; }
public Guid? FKHeader { get; set; }
@@ -11,6 +11,8 @@ public class WzRowMareli
public int? Quantity { get; set; }
public string OrderNumber { get; set; }
public string WzNumber { get; set; }
public string FaIndex { get; set; }
public int? TransactionNumber { get; set; }
// Navigation property
public WzHeader Header { get; set; }

View File

@@ -32,7 +32,7 @@ namespace SytelineSaAppEfDataModel
CreateMap<VatCodeAssociation, VatCodeAssociationDto>().ReverseMap();
CreateMap<ItemCustPriceAll, ItemCustPriceAllDto>().ReverseMap();
CreateMap<EdiLog, EdiLogDto>().ReverseMap();
CreateMap<WzRowMareli, WzRowMareliDto>().ReverseMap();
CreateMap<WzRowMarelli, WzRowMarelliDto>().ReverseMap();
}
}
}

View File

@@ -4,8 +4,8 @@ namespace SytelineSaAppEfDataModel.Services;
public interface IWzRowMareliService
{
Task<IEnumerable<WzRowMareliDto>> GetAll();
Task CreateRows(IEnumerable<WzRowMareliDto> rows);
Task<IEnumerable<WzRowMareliDto>> GetByWzHeaderId(Guid wzHeaderId);
Task UpdateRows(IEnumerable<WzRowMareliDto> rows);
Task<IEnumerable<WzRowMarelliDto>> GetAll();
Task CreateRows(IEnumerable<WzRowMarelliDto> rows);
Task<IEnumerable<WzRowMarelliDto>> GetByWzHeaderId(Guid wzHeaderId);
Task UpdateRows(IEnumerable<WzRowMarelliDto> rows);
}

View File

@@ -7,29 +7,29 @@ namespace SytelineSaAppEfDataModel.Services;
public class WzRowMareliService(SytelineSaAppDbContext context, IMapper mapper) : IWzRowMareliService
{
public async Task<IEnumerable<WzRowMareliDto>> GetAll()
public async Task<IEnumerable<WzRowMarelliDto>> GetAll()
{
return await context.WzRowsMeyle.Select(x => mapper.Map<WzRowMareliDto>(x)).ToListAsync();
return await context.WzRowsMeyle.Select(x => mapper.Map<WzRowMarelliDto>(x)).ToListAsync();
}
public async Task CreateRows(IEnumerable<WzRowMareliDto> rows)
public async Task CreateRows(IEnumerable<WzRowMarelliDto> rows)
{
var entities = mapper.Map<IEnumerable<WzRowMareli>>(rows);
var entities = mapper.Map<IEnumerable<WzRowMarelli>>(rows);
await context.WzRowsMareli.AddRangeAsync(entities);
await context.SaveChangesAsync();
}
public async Task<IEnumerable<WzRowMareliDto>> GetByWzHeaderId(Guid wzHeaderId)
public async Task<IEnumerable<WzRowMarelliDto>> GetByWzHeaderId(Guid wzHeaderId)
{
return await context.WzRowsMareli
.Where(x => x.FKHeader == wzHeaderId)
.Select(x => mapper.Map<WzRowMareliDto>(x))
.Select(x => mapper.Map<WzRowMarelliDto>(x))
.ToListAsync();
}
public async Task UpdateRows(IEnumerable<WzRowMareliDto> rows)
public async Task UpdateRows(IEnumerable<WzRowMarelliDto> rows)
{
var entities = mapper.Map<IEnumerable<WzRowMareli>>(rows);
var entities = mapper.Map<IEnumerable<WzRowMarelli>>(rows);
context.WzRowsMareli.UpdateRange(entities);
await context.SaveChangesAsync();
}

View File

@@ -22,7 +22,7 @@ namespace SytelineSaAppEfDataModel
public DbSet<WzClient> WzClients { get; set; }
public DbSet<WzHeader> WzHeaders { get; set; }
public DbSet<WzRowMeyle> WzRowsMeyle { get; set; }
public DbSet<WzRowMareli> WzRowsMareli { get; set; }
public DbSet<WzRowMarelli> WzRowsMareli { get; set; }
public DbSet<ItemCust> ItemCusts { get; set; }
public DbSet<Lot> Lots { get; set; }
public DbSet<EdiCustomerOrderImport> EdiCustomerOrderImports { get; set; }
@@ -2508,7 +2508,7 @@ namespace SytelineSaAppEfDataModel
.IsRequired();
});
modelBuilder.Entity<WzRowMareli>(entity =>
modelBuilder.Entity<WzRowMarelli>(entity =>
{
entity.ToTable("wz_row_mareli");
@@ -2558,6 +2558,16 @@ namespace SytelineSaAppEfDataModel
.HasColumnName("wz_number")
.HasMaxLength(50)
.IsRequired(false);
entity.Property(e => e.WzNumber)
.HasColumnName("fa_index")
.HasMaxLength(30)
.IsRequired(false);
entity.Property(e => e.TransactionNumber)
.HasColumnName("trans_num")
.HasColumnType("int")
.IsRequired(false);
// Foreign Key
entity.HasOne(e => e.Header)