diff --git a/EgwCoreLib.Lux.Data/Repository/Items/IItemRepository.cs b/EgwCoreLib.Lux.Data/Repository/Items/IItemRepository.cs
index bed34c7..5474b19 100644
--- a/EgwCoreLib.Lux.Data/Repository/Items/IItemRepository.cs
+++ b/EgwCoreLib.Lux.Data/Repository/Items/IItemRepository.cs
@@ -1,25 +1,68 @@
-namespace EgwCoreLib.Lux.Data.Repository.Items
+namespace EgwCoreLib.Lux.Data.Repository.Items
{
public interface IItemRepository : IBaseRepository
{
#region Public Methods
+ ///
+ /// Inserisce un nuovo record Item nel database.
+ ///
+ /// Record da inserire
Task AddAsync(ItemModel entity);
+ ///
+ /// Elimina un record Item dal database.
+ ///
+ /// Record da eliminare
Task DeleteAsync(ItemModel entity);
+ ///
+ /// Recupera un record Item specifico per ID.
+ ///
+ /// ID dell'item da recuperare
Task GetByIdAsync(int recId);
+ ///
+ /// Recupera l'elenco degli item alternativi per un item specifico (stesso parent o child).
+ ///
+ /// ID dell'item di riferimento
Task> GetAltAsync(int recId);
+ ///
+ /// Recupera gli item filtrati per gruppo e tipo classe.
+ ///
+ /// Codice del gruppo filtro (vuoto = tutti)
+ /// Tipo di classe filtro (ND = tutti)
Task> GetFiltAsync(string CodGroup, ItemClassType ItemType);
+ ///
+ /// Cerca item per descrizione, codice esterno o codice fornitore.
+ ///
+ /// Termine di ricerca
Task> GetSearchAsync(string term);
+ ///
+ /// Aggiorna in massa costi e margini basati su dimensioni (larghezza x altezza).
+ ///
+ /// Lista di item da aggiornare
+ /// Costo base per unità
+ /// Margine predefinito
+ /// Quantità massima predefinita
+ /// Unità di misura predefinita
+ /// Value per arrotondamento (0 = nessun arrotondamento)
+ /// Fattore di scala per il calcolo costo
Task MassUpdateAsync(List list2upd, double setCost, double defMargin, double defQtyMax, string defUM, int roundVal = 0, double scaleFactor = 1_000_000.0);
+ ///
+ /// Aggiorna un record Item esistente nel database.
+ ///
+ /// Record aggiornato
Task UpdateAsync(ItemModel entity);
+ ///
+ /// Inserisce item mancanti dalla BOM nel database con valori predefiniti.
+ ///
+ /// Lista BOM da processare
Task UpsertFromBomAsync(List bomList);
#endregion Public Methods
diff --git a/EgwCoreLib.Lux.Data/Repository/Items/ISellingItemRepository.cs b/EgwCoreLib.Lux.Data/Repository/Items/ISellingItemRepository.cs
index b532fa4..af2c4b1 100644
--- a/EgwCoreLib.Lux.Data/Repository/Items/ISellingItemRepository.cs
+++ b/EgwCoreLib.Lux.Data/Repository/Items/ISellingItemRepository.cs
@@ -1,19 +1,44 @@
-namespace EgwCoreLib.Lux.Data.Repository.Items
+namespace EgwCoreLib.Lux.Data.Repository.Items
{
public interface ISellingItemRepository : IBaseRepository
{
#region Public Methods
+ ///
+ /// Inserisce un nuovo record SellingItem nel database.
+ ///
+ /// Record da inserire
Task AddAsync(SellingItemModel entity);
+ ///
+ /// Elimina un record SellingItem dal database.
+ ///
+ /// Record da eliminare
Task DeleteAsync(SellingItemModel entity);
+ ///
+ /// Recupera un record SellingItem specifico per ID.
+ ///
+ /// ID dell'item di vendita da recuperare
Task GetByIdAsync(int recId);
+ ///
+ /// Recupera tutti gli item di vendita per un ambiente specifico.
+ ///
+ /// Ambiente di esecuzione
Task> GetByEnvirAsync(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS envir);
+ ///
+ /// Recupera gli item di vendita filtrati per ambiente e tipo sorgente.
+ ///
+ /// Ambiente di esecuzione (NULL = tutti)
+ /// Tipo di sorgente (ND = tutti)
Task> GetFiltAsync(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS envir, ItemSourceType sourceType);
+ ///
+ /// Aggiorna un record SellingItem esistente nel database.
+ ///
+ /// Record aggiornato
Task UpdateAsync(SellingItemModel entity);
#endregion Public Methods
diff --git a/EgwCoreLib.Lux.Data/Repository/Items/ItemRepository.cs b/EgwCoreLib.Lux.Data/Repository/Items/ItemRepository.cs
index 5b6aceb..0ab493d 100644
--- a/EgwCoreLib.Lux.Data/Repository/Items/ItemRepository.cs
+++ b/EgwCoreLib.Lux.Data/Repository/Items/ItemRepository.cs
@@ -14,6 +14,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
#region Public Methods
+ ///
public async Task AddAsync(ItemModel entity)
{
await using var dbCtx = await CreateContextAsync();
@@ -21,6 +22,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
return await dbCtx.SaveChangesAsync() > 0;
}
+ ///
public async Task DeleteAsync(ItemModel entity)
{
await using var dbCtx = await CreateContextAsync();
@@ -28,6 +30,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
return await dbCtx.SaveChangesAsync() > 0;
}
+ ///
public async Task> GetAltAsync(int recId)
{
await using var dbCtx = await CreateContextAsync();
@@ -61,6 +64,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
return dbResult;
}
+ ///
public async Task GetByIdAsync(int recId)
{
await using var dbCtx = await CreateContextAsync();
@@ -69,6 +73,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
.FirstOrDefaultAsync();
}
+ ///
public async Task> GetFiltAsync(string CodGroup, ItemClassType ItemType)
{
await using var dbCtx = await CreateContextAsync();
@@ -79,6 +84,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
.ToListAsync();
}
+ ///
public async Task> GetSearchAsync(string term)
{
await using var dbCtx = await CreateContextAsync();
@@ -89,6 +95,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
.ToListAsync();
}
+ ///
public async Task MassUpdateAsync(List list2upd, double setCost, double defMargin, double defQtyMax, string defUM, int roundVal = 0, double scaleFactor = 1_000_000.0)
{
bool answ = false;
@@ -195,6 +202,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
return answ;
}
+ ///
public async Task UpdateAsync(ItemModel entity)
{
await using var dbCtx = await CreateContextAsync();
@@ -213,6 +221,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
return await dbCtx.SaveChangesAsync() > 0;
}
+ ///
public async Task UpsertFromBomAsync(List bomList)
{
await using var dbCtx = await CreateContextAsync();
diff --git a/EgwCoreLib.Lux.Data/Repository/Items/SellingItemRepository.cs b/EgwCoreLib.Lux.Data/Repository/Items/SellingItemRepository.cs
index 880676f..702e609 100644
--- a/EgwCoreLib.Lux.Data/Repository/Items/SellingItemRepository.cs
+++ b/EgwCoreLib.Lux.Data/Repository/Items/SellingItemRepository.cs
@@ -12,6 +12,7 @@
#region Public Methods
+ ///
public async Task AddAsync(SellingItemModel entity)
{
await using var dbCtx = await CreateContextAsync();
@@ -19,6 +20,7 @@
return await dbCtx.SaveChangesAsync() > 0;
}
+ ///
public async Task DeleteAsync(SellingItemModel entity)
{
await using var dbCtx = await CreateContextAsync();
@@ -26,6 +28,7 @@
return await dbCtx.SaveChangesAsync() > 0;
}
+ ///
public async Task> GetByEnvirAsync(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS envir)
{
await using var dbCtx = await CreateContextAsync();
@@ -35,6 +38,7 @@
.ToListAsync();
}
+ ///
public async Task GetByIdAsync(int recId)
{
await using var dbCtx = await CreateContextAsync();
@@ -43,6 +47,7 @@
.FirstOrDefaultAsync();
}
+ ///
public async Task> GetFiltAsync(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS envir, ItemSourceType sourceType)
{
await using var dbCtx = await CreateContextAsync();
@@ -52,6 +57,7 @@
.ToListAsync();
}
+ ///
public async Task UpdateAsync(SellingItemModel entity)
{
await using var dbCtx = await CreateContextAsync();